Whamcloud - gitweb
Many files:
[tools/e2fsprogs.git] / lib / e2p / getversion.c
1 /*
2  * getversion.c         - Get a file version on an ext2 file system
3  *
4  * Copyright (C) 1993, 1994  Remy Card <card@masi.ibp.fr>
5  *                           Laboratoire MASI, Institut Blaise Pascal
6  *                           Universite Pierre et Marie Curie (Paris VI)
7  *
8  * This file can be redistributed under the terms of the GNU Library General
9  * Public License
10  */
11
12 /*
13  * History:
14  * 93/10/30     - Creation
15  */
16
17 #if HAVE_ERRNO_H
18 #include <errno.h>
19 #endif
20 #include <sys/ioctl.h>
21
22 #include "e2p.h"
23
24 int getversion (int fd, unsigned long * version)
25 {
26 #if HAVE_EXT2_IOCTLS
27         return ioctl (fd, EXT2_IOC_GETVERSION, version);
28 #else /* ! HAVE_EXT2_IOCTLS */
29         extern int errno;
30         errno = EOPNOTSUPP;
31         return -1;
32 #endif /* ! HAVE_EXT2_IOCTLS */
33 }