~ubuntu-branches/debian/jessie/arcboot/jessie

« back to all changes in this revision

Viewing changes to e2fslib/tst_getsize.c

  • Committer: Bazaar Package Importer
  • Author(s): Guido Guenther
  • Date: 2004-03-02 12:01:14 UTC
  • Revision ID: james.westby@ubuntu.com-20040302120114-0pukal9hlpt3k0l7
Tags: 0.3.8.1
correct subarch detection for IP32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * tst_getsize.c --- this function tests the getsize function
 
3
 * 
 
4
 * Copyright (C) 1997 by Theodore Ts'o.
 
5
 * 
 
6
 * %Begin-Header%
 
7
 * This file may be redistributed under the terms of the GNU Public
 
8
 * License.
 
9
 * %End-Header%
 
10
 */
 
11
 
 
12
#include <stdio.h>
 
13
#include <string.h>
 
14
#if HAVE_UNISTD_H
 
15
#include <unistd.h>
 
16
#endif
 
17
#include <fcntl.h>
 
18
#include <time.h>
 
19
#include <sys/stat.h>
 
20
#include <sys/types.h>
 
21
#if HAVE_ERRNO_H
 
22
#include <errno.h>
 
23
#endif
 
24
 
 
25
#include "ext2_fs.h"
 
26
#include "ext2fs.h"
 
27
 
 
28
int main(int argc, const char *argv[])
 
29
{
 
30
        errcode_t       retval;
 
31
        blk_t           blocks;
 
32
 
 
33
        if (argc < 2) {
 
34
                fprintf(stderr, "%s device\n", argv[0]);
 
35
                exit(1);
 
36
        }
 
37
        retval = ext2fs_get_device_size(argv[1], 1024, &blocks);
 
38
        if (retval) {
 
39
                com_err(argv[0], retval, "while getting device size");
 
40
                exit(1);
 
41
        }
 
42
        printf("%s is device has %d blocks.\n", argv[1], blocks);
 
43
        return 0;
 
44
}