• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * setversion.c		- Set 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 
setversion(int fd,unsigned long version)24 int setversion (int fd, unsigned long version)
25 {
26 #if HAVE_EXT2_IOCTLS
27 	int ver;
28 
29 	ver = (int) version;
30 	return ioctl (fd, EXT2_IOC_SETVERSION, &ver);
31 #else /* ! HAVE_EXT2_IOCTLS */
32 	extern int errno;
33 	errno = EOPNOTSUPP;
34 	return -1;
35 #endif /* ! HAVE_EXT2_IOCTLS */
36 }
37