ChangeLog, Makefile.in, Makefile.pq, ext2_err.et.in, tst_getsize.c:

Makefile.in, tst_getsize.c: Added new file which is used to test the
  	ext2fs_get_device_size function.
  ext2_err.et.in (EXT2_ET_UNIMPLEMENTED): Added new error code.
bitmap-optimize
Theodore Ts'o 1997-11-12 03:48:07 +00:00
parent c654c76769
commit d36d835b48
5 changed files with 60 additions and 1 deletions

View File

@ -1,3 +1,10 @@
Tue Nov 11 22:46:45 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Makefile.in, tst_getsize.c: Added new file which is used to test
the ext2fs_get_device_size function.
* ext2_err.et.in (EXT2_ET_UNIMPLEMENTED): Added new error code.
Sun Nov 2 20:36:13 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* ext2fs.h: Make ext2fs_get_mem take an unsigned argument.

View File

@ -165,6 +165,10 @@ tst_iscan: tst_iscan.o inode.o $(STATIC_LIBEXT2FS)
$(CC) -o tst_iscan tst_iscan.o inode.o $(STATIC_LIBEXT2FS) \
$(LIBCOM_ERR)
tst_getsize: tst_getsize.o getsize.o $(STATIC_LIBEXT2FS)
$(CC) -o tst_getsize tst_getsize.o getsize.o $(STATIC_LIBEXT2FS) \
$(LIBCOM_ERR)
check:: tst_badblocks tst_iscan
./tst_badblocks
./tst_iscan

View File

@ -24,7 +24,6 @@ OBJS= alloc.obj \
fileio.obj \
freefs.obj \
get_pathname.obj \
getsize.obj \
icount.obj \
initialize.obj \
inline.obj \

View File

@ -248,5 +248,8 @@ ec EXT2_ET_DB_NOT_FOUND,
ec EXT2_ET_DIR_EXISTS,
"Ext2 directory already exists"
ec EXT2_ET_UNIMPLEMENTED,
"Unimplemented ext2 library function"
end

46
lib/ext2fs/tst_getsize.c Normal file
View File

@ -0,0 +1,46 @@
/*
* tst_getsize.c --- this function tests the getsize function
*
* Copyright (C) 1997 by Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
*/
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
#if HAVE_ERRNO_H
#include <errno.h>
#endif
#include <linux/ext2_fs.h>
#include "ext2fs.h"
int main(int argc, const char *argv[])
{
errcode_t retval;
blk_t blocks;
if (argc < 2) {
fprintf(stderr, "%s device\n", argv[0]);
exit(1);
}
retval = ext2fs_get_device_size(argv[1], 1024, &blocks);
if (retval) {
com_err(argv[0], retval, "while getting device size");
exit(1);
}
printf("%s is device has %d blocks.\n", argv[1], blocks);
return 0;
}