2 * tst_getsize.c --- this function tests the getsize function
4 * Copyright (C) 1997 by Theodore Ts'o.
7 * This file may be redistributed under the terms of the GNU Library
8 * General Public License, version 2.
21 #include <sys/types.h>
29 int main(int argc, char **argv)
31 int lsectsize, psectsize;
36 fprintf(stderr, "Usage: %s device\n", argv[0]);
40 retval = ext2fs_get_device_sectsize(argv[1], &lsectsize);
42 com_err(argv[0], retval,
43 "while calling ext2fs_get_device_sectsize");
46 retval = ext2fs_get_device_phys_sectsize(argv[1], &psectsize);
48 com_err(argv[0], retval,
49 "while calling ext2fs_get_device_phys_sectsize");
52 printf("Device %s has logical/physical sector size of %d/%d.\n",
53 argv[1], lsectsize, psectsize);
54 fd = open(argv[1], O_RDONLY);
59 printf("The device's DIO alignment is %d\n",
60 ext2fs_get_dio_alignment(fd));