Home | History | Annotate | Download | only in e2p
      1 /*
      2  * setversion.c		- Set a file version on an ext2 file system
      3  *
      4  * Copyright (C) 1993, 1994  Remy Card <card (at) masi.ibp.fr>
      5  *                           Laboratoire MASI, Institut Blaise Pascal
      6  *                           Universite Pierre et Marie Curie (Paris VI)
      7  *
      8  * %Begin-Header%
      9  * This file may be redistributed under the terms of the GNU Library
     10  * General Public License, version 2.
     11  * %End-Header%
     12  */
     13 
     14 /*
     15  * History:
     16  * 93/10/30	- Creation
     17  */
     18 
     19 #if HAVE_ERRNO_H
     20 #include <errno.h>
     21 #endif
     22 #include <sys/ioctl.h>
     23 
     24 #include "e2p.h"
     25 
     26 int setversion (int fd, unsigned long version)
     27 {
     28 #if HAVE_EXT2_IOCTLS
     29 	int ver;
     30 
     31 	ver = (int) version;
     32 	return ioctl (fd, EXT2_IOC_SETVERSION, &ver);
     33 #else /* ! HAVE_EXT2_IOCTLS */
     34 	extern int errno;
     35 	errno = EOPNOTSUPP;
     36 	return -1;
     37 #endif /* ! HAVE_EXT2_IOCTLS */
     38 }
     39