L4Re/departure

libext2fs/lib/libe2p/getversion.c

617:2733e5770ee9
9 months ago Paul Boddie Made the run command wait for completion, introducing the spawn command to run programs in the background. Introduced conveniences for waiting for the last job to be initiated and for piping from the last job, also subscribing to signals from pipe-supplying jobs so that they may be transparently removed from the job list upon completion. Augmented the job listing with the "+" notation familiar from Unix. Prevented new jobs from being started when no job slots are available.
     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  * %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 #include "config.h"    20 #if HAVE_ERRNO_H    21 #include <errno.h>    22 #endif    23 #if HAVE_SYS_IOCTL_H    24 #include <sys/ioctl.h>    25 #endif    26     27 #include "e2p.h"    28     29 int getversion (int fd, unsigned long * version)    30 {    31 #if HAVE_EXT2_IOCTLS    32 	int	r, ver;    33     34 	r = ioctl (fd, EXT2_IOC_GETVERSION, &ver);    35 	*version = ver;    36 	return r;    37 #else /* ! HAVE_EXT2_IOCTLS */    38 	extern int errno;    39 	errno = EOPNOTSUPP;    40 	return -1;    41 #endif /* ! HAVE_EXT2_IOCTLS */    42 }