libsysio-commit Mailing List for libsysio (Page 24)
Brought to you by:
lward
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
(28) |
Jun
(25) |
Jul
(30) |
Aug
(60) |
Sep
(52) |
Oct
(100) |
Nov
(15) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(89) |
Feb
(48) |
Mar
(22) |
Apr
(59) |
May
(16) |
Jun
(15) |
Jul
(50) |
Aug
(26) |
Sep
(40) |
Oct
(27) |
Nov
(12) |
Dec
|
2005 |
Jan
(24) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(14) |
Sep
(21) |
Oct
(10) |
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
(5) |
Mar
(2) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
(3) |
Feb
(5) |
Mar
(20) |
Apr
(41) |
May
(21) |
Jun
(3) |
Jul
(5) |
Aug
(12) |
Sep
(21) |
Oct
(5) |
Nov
(16) |
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(23) |
May
|
Jun
(22) |
Jul
(13) |
Aug
|
Sep
|
Oct
(9) |
Nov
(3) |
Dec
(13) |
2009 |
Jan
(14) |
Feb
(10) |
Mar
(2) |
Apr
(11) |
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
(36) |
Sep
(12) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: MeiJia <me...@us...> - 2004-08-05 18:30:08
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25758/src Modified Files: fcntl.c Log Message: lustre hacking specific code: add ioctl support in socket/native driver. not clear how to do with stdfd Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- fcntl.c 27 Jul 2004 15:00:43 -0000 1.20 +++ fcntl.c 5 Aug 2004 18:29:57 -0000 1.21 @@ -59,29 +59,9 @@ static int _sysio_fcntl(int fd, int cmd, va_list ap, int *rtn) { - long arg; + long arg = va_arg(ap, long); - switch (cmd) { - case F_GETFD: - case F_GETFL: - case F_GETOWN: - *rtn = syscall(SYS_fcntl, fd, cmd); - break; - case F_DUPFD: - case F_SETFD: - case F_SETFL: - case F_GETLK: - case F_SETLK: - case F_SETLKW: - case F_SETOWN: - arg = va_arg(ap, long); *rtn = syscall(SYS_fcntl, fd, cmd, arg); - break; - default: - *rtn = -1; - errno = EINVAL; - } - return *rtn == -1 ? -errno : 0; } #endif |
From: MeiJia <me...@us...> - 2004-08-05 18:30:08
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25758/drivers/native Modified Files: fs_native.c Log Message: lustre hacking specific code: add ioctl support in socket/native driver. not clear how to do with stdfd Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -w -b -B -p -r1.43 -r1.44 --- fs_native.c 26 Jul 2004 16:37:59 -0000 1.43 +++ fs_native.c 5 Aug 2004 18:29:57 -0000 1.44 @@ -1746,6 +1746,25 @@ native_inop_datasync(struct inode *ino) return err; } +#ifdef HAVE_LUSTRE_HACK +static int +native_inop_ioctl(struct inode *ino, + unsigned long int request, + va_list ap) +{ + long arg1, arg2, arg3, arg4; + + assert(I2NI(ino)->ni_fd >= 0); + + arg1 = va_arg(ap, long); + arg2 = va_arg(ap, long); + arg3 = va_arg(ap, long); + arg4 = va_arg(ap, long); + + return syscall(SYS_ioctl, I2NI(ino)->ni_fd, request, + arg1, arg2, arg3, arg4); +} +#else static int native_inop_ioctl(struct inode *ino __IS_UNUSED, unsigned long int request __IS_UNUSED, @@ -1758,6 +1777,7 @@ native_inop_ioctl(struct inode *ino __IS errno = ENOTTY; return -1; } +#endif static void native_inop_gone(struct inode *ino) |
From: MeiJia <me...@us...> - 2004-08-05 18:30:08
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25758/drivers/sockets Modified Files: sockets.c Log Message: lustre hacking specific code: add ioctl support in socket/native driver. not clear how to do with stdfd Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- sockets.c 28 Jul 2004 06:39:20 -0000 1.9 +++ sockets.c 5 Aug 2004 18:29:57 -0000 1.10 @@ -302,6 +302,29 @@ sockets_inop_datasync(struct inode *ino) return syscall(SYS_fdatasync, I2SKI(ino)->ski_fd); } +#ifdef HAVE_LUSTRE_HACK +/* + * we blindly extract 4 params and pass to host kernel, the stack + * should be ok. hope no ioctl will consume more then 4 params... + */ +static int +sockets_inop_ioctl(struct inode *ino, + unsigned long int request, + va_list ap) +{ + long arg1, arg2, arg3, arg4; + + assert(I2SKI(ino)->ski_fd >= 0); + + arg1 = va_arg(ap, long); + arg2 = va_arg(ap, long); + arg3 = va_arg(ap, long); + arg4 = va_arg(ap, long); + + return syscall(SYS_ioctl, I2SKI(ino)->ski_fd, request, + arg1, arg2, arg3, arg4); +} +#else static int sockets_inop_ioctl(struct inode *ino __IS_UNUSED, unsigned long int request __IS_UNUSED, @@ -312,6 +335,7 @@ sockets_inop_ioctl(struct inode *ino __I */ return -ENOTTY; } +#endif static void sockets_inop_gone(struct inode *ino) |
From: Lee W. <lw...@us...> - 2004-07-31 14:28:59
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30301 Modified Files: access.c Log Message: From Cray SPR 729654: access(path, -1) sets errno 13 instead of 22. We weren't checking to see if the passed mode was restricted only to the supported mask combinations. Fixed now. Fixed another as well. We didn't support F_OK. Do now. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- access.c 27 Jul 2004 15:00:43 -0000 1.8 +++ access.c 31 Jul 2004 14:28:51 -0000 1.9 @@ -64,6 +64,12 @@ SYSIO_INTERFACE_NAME(access)(const char SYSIO_INTERFACE_ENTER; err = 0; + /* + * Check amode. + */ + if ((amode & (R_OK|W_OK|X_OK)) != amode) + SYSIO_INTERFACE_RETURN(-1, -EINVAL); + n = getgroups(0, NULL); list = NULL; if (n) { @@ -82,6 +88,9 @@ SYSIO_INTERFACE_NAME(access)(const char err = -errno; goto out; } + if (!amode) + SYSIO_INTERFACE_RETURN(0, 0); + mask = 0; if (amode & R_OK) |
From: Sonja T. <so...@us...> - 2004-07-28 14:58:30
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25792/tests Modified Files: helper.pm Log Message: Check for null return value in helper.pm in order to attempt to give possibly helpful error returns. Index: helper.pm =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/helper.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- helper.pm 11 Mar 2004 14:40:53 -0000 1.4 +++ helper.pm 28 Jul 2004 14:58:21 -0000 1.5 @@ -26,7 +26,10 @@ sub print_and_exit print $cmdfh $cmdstr; my $res = <$outfh>; + if (defined $res) { chop($res); + } + print $cmdfh "exit\n"; close $outfh; @@ -47,7 +50,12 @@ sub send_cmd print $cmdfh $cmdstr; my $res = <$outfh>; + if (defined $res) { chop($res); + } else { + print_and_exit($cmdfh, $outfh, 1, "ERROR! Cmd $cmdstr returned null value!\n"); + } + if ($res ne "0000 ") { print_and_exit($cmdfh, $outfh, 1, "ERROR! Command $cmd failed with code $res\n"); } @@ -65,7 +73,11 @@ sub verify_cmd send_cmd($cmdfh, $outfh, "PRINT", $cmdstr); my $res = <$outfh>; + if (defined $res) { chop($res); + } else { + print_and_exit($cmdfh, $outfh, 1, "ERROR! Cmd $cmdstr returned null value!\n"); + } if ($res eq "0xffffffff") { @@ -75,7 +87,12 @@ sub verify_cmd send_cmd($cmdfh, $outfh, "PRINT", $cmdstr); my $err = <$outfh>; + if (defined $err) { chop($err); + } else { + print_and_exit($cmdfh, $outfh, 1, "ERROR! Cmd $cmdstr returned null value!\n"); + } + print_and_exit($cmdfh, $outfh, 1, "ERROR! $cmd returned $err\n"); } return $res; |
From: Lee W. <lw...@us...> - 2004-07-28 14:57:01
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25262/src Modified Files: file.c Log Message: Two changes: Fixed a bug in how fd_grow was called. It was always called with the desired index of the file table instead of desired size -- Thanks Ruth. Also, fd_grow was *very* aggressive when asked to grow the table. Now, it only grows to what is ever only actually required. We still do not trim the table though. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- file.c 27 Jul 2004 15:00:43 -0000 1.15 +++ file.c 28 Jul 2004 14:56:52 -0000 1.16 @@ -118,29 +118,27 @@ _sysio_fcompletio(struct ioctx *ioctx, s static int fd_grow(size_t n) { - int fd; size_t count; struct file **noftab, **filp; /* * Sanity check the new size. */ - fd = (int )n; - if ((size_t )fd != n) + if ((int )n < 0) return -EMFILE; - if (n < 8) - n = 8; - if (n >= _sysio_oftab_size && n - _sysio_oftab_size < _sysio_oftab_size) - n = (n + 1) * 2; + /* + * We never shrink the table. + */ + if (n <= _sysio_oftab_size) + return 0; + noftab = realloc(_sysio_oftab, n * sizeof(struct file *)); if (!noftab) return -ENOMEM; _sysio_oftab = noftab; count = _sysio_oftab_size; _sysio_oftab_size = n; - if (n < count) - return 0; filp = _sysio_oftab + count; n -= count; while (n--) @@ -176,7 +174,7 @@ find_free_fildes(int low) if (n < 0) return -ENFILE; if ((unsigned )n >= _sysio_oftab_size) { - err = fd_grow((size_t )n); + err = fd_grow((unsigned )n + 1); if (err) return err; filp = &_sysio_oftab[n]; @@ -240,7 +238,7 @@ _sysio_fd_set(struct file *fil, int fd, } if ((unsigned )fd >= _sysio_oftab_size) { - err = fd_grow(fd); + err = fd_grow((unsigned )fd + 1); if (err) return err; } |
From: MeiJia <me...@us...> - 2004-07-28 06:39:29
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16504/src Modified Files: file_hack.c Log Message: lustre hack code to follow the changes of sysio_fd_set() Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- file_hack.c 27 Jul 2004 15:00:43 -0000 1.4 +++ file_hack.c 28 Jul 2004 06:39:21 -0000 1.5 @@ -203,24 +203,27 @@ _sysio_fd_shutdown() #endif /* - * Find a free slot in the open files table. - * target < 0: any free slot - * target >= 0: get slot [target] + * Find a free slot in the open files table which >= @low + * low < 0 means any */ static int -find_free_fildes(oftab_t *oftab, int target) +find_free_fildes(oftab_t *oftab, int low) { int n; int err; struct file **filp; - if (target < 0) { - for (n = 0, filp = oftab->table; + if (low < 0) + low = oftab->offset; + + n = low - oftab->offset; + if (n < 0) + return -ENFILE; + + for (filp = oftab->table + n; n < oftab->size && *filp; n++, filp++) ; - } else - n = target - oftab->offset; if (n >= oftab->size) { err = fd_grow(oftab, n); @@ -230,18 +233,6 @@ find_free_fildes(oftab_t *oftab, int tar assert(!*filp); } -#ifdef HAVE_LUSTRE_HACK - /* FIXME sometimes we could intercept open/socket to create - * a fd, but missing close()? currently we have this problem - * with resolv lib. as a workaround simply destroy the file - * struct here. - */ - if (oftab->table[n]) { - free(oftab->table[n]); - oftab->table[n] = NULL; - } -#endif - return oftab->offset + n; } @@ -298,35 +289,55 @@ _sysio_fd_close(int fd) } /* - * Associate open file record with given file descriptor or any available - * file descriptor if less than zero. + * Associate open file record with given file descriptor (if forced), or any + * available file descriptor if less than zero, or any available descriptor + * greater than or equal to the given one if not forced. */ int -_sysio_fd_set(struct file *fil, int fd) +_sysio_fd_set(struct file *fil, int fd, int force) { int err; struct file *ofil; oftab_t *oftab; + if (force && fd < 0) + abort(); + init_oftab(); oftab = select_oftab(fd); /* - * New fd < 0 => any available descriptor. + * Search for a free descriptor if needed. */ + if (!force) { fd = find_free_fildes(oftab, fd); if (fd < 0) return fd; + } - assert(fd < oftab->offset + oftab->size); + if (fd - oftab->offset >= oftab->size) { + err = fd_grow(oftab, fd - oftab->offset); + if (err) + return err; + } /* * Remember old. */ ofil = __sysio_fd_get(fd, 1); - if (ofil) + if (ofil) { + /* FIXME sometimes we could intercept open/socket to create + * a fd, but missing close()? currently we have this problem + * with resolv lib. as a workaround simply destroy the file + * struct here. And this hack will break the behavior of + * DUPFD. + */ + if (fd >= 0 && oftab == &_sysio_oftab[0]) + free(ofil); + else F_RELE(ofil); + } oftab->table[fd - oftab->offset] = fil; @@ -337,10 +348,12 @@ _sysio_fd_set(struct file *fil, int fd) * Duplicate old file descriptor. * * If the new file descriptor is less than zero, the new file descriptor - * is chosen freely. + * is chosen freely. Otherwise, choose an available descriptor greater + * than or equal to the new, if not forced. Otherwise, if forced, (re)use + * the new. */ int -_sysio_fd_dup2(int oldfd, int newfd) +_sysio_fd_dup(int oldfd, int newfd, int force) { struct file *fil; int fd; @@ -358,7 +371,7 @@ _sysio_fd_dup2(int oldfd, int newfd) if (select_oftab(oldfd) != select_oftab(newfd)) return -EINVAL; - fd = _sysio_fd_set(fil, newfd); + fd = _sysio_fd_set(fil, newfd, force); if (fd >= 0) F_REF(fil); return fd; |
From: MeiJia <me...@us...> - 2004-07-28 06:39:29
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16504/drivers/sockets Modified Files: sockets.c Log Message: lustre hack code to follow the changes of sysio_fd_set() Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- sockets.c 27 Jul 2004 14:11:14 -0000 1.8 +++ sockets.c 28 Jul 2004 06:39:20 -0000 1.9 @@ -394,7 +394,7 @@ socket(int domain, int type, int protoco goto error; } -#ifdef WITH_LUSTRE_HACK +#ifdef HAVE_LUSTRE_HACK err = _sysio_fd_set(fil, ski->ski_fd, 1); #else err = _sysio_fd_set(fil, -1, 0); @@ -462,8 +462,8 @@ accept(int s, struct sockaddr *addr, soc goto error; } -#ifdef WITH_LUSTRE_HACK - err = _sysio_fd_set(nfil, ski->ski_fd); +#ifdef HAVE_LUSTRE_HACK + err = _sysio_fd_set(nfil, ski->ski_fd, 1); #else err = _sysio_fd_set(nfil, -1, 0); #endif |
From: Lee W. <lw...@us...> - 2004-07-27 15:01:36
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10818/include Modified Files: inode.h Log Message: The public include xtio.h was mostly unneeded, except for the definition of ioid_t. For the internals, we are converted to using the address of the IO context record as the identifier. Removed, finally, xtio.h from everything not involving the data path. Externally, of course, everything is the same. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- inode.h 26 Jul 2004 16:38:01 -0000 1.20 +++ inode.h 27 Jul 2004 15:00:41 -0000 1.21 @@ -370,7 +370,6 @@ struct ioctx { ioctx_fast : 1, /* from stack space */ ioctx_done : 1, /* transfer complete */ ioctx_write : 1; /* op is a write */ - ioid_t ioctx_id; /* unique ident */ struct inode *ioctx_ino; /* i-node */ const struct iovec *ioctx_iov; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ @@ -385,12 +384,11 @@ struct ioctx { /* * Init IO context record. */ -#define IOCTX_INIT(ioctx, fast, id, wr, ino, iov, iovlen, xtv, xtvlen) \ +#define IOCTX_INIT(ioctx, fast, wr, ino, iov, iovlen, xtv, xtvlen) \ do { \ (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_write = (wr) ? 1 : 0; \ - (ioctx)->ioctx_id = (id); \ (ioctx)->ioctx_ino = (ino); \ (ioctx)->ioctx_iov = (iov); \ (ioctx)->ioctx_iovlen = (iovlen); \ @@ -486,7 +484,7 @@ extern int _sysio_ioctx_cb(struct ioctx void (*f)(struct ioctx *, void *), void *data); extern void _sysio_ioctx_cb_free(struct ioctx_callback *cb); -extern struct ioctx *_sysio_ioctx_find(ioid_t id); +extern struct ioctx *_sysio_ioctx_find(void *id); extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen, |
From: Lee W. <lw...@us...> - 2004-07-27 15:01:10
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10818/src Modified Files: access.c chdir.c chmod.c chown.c dev.c dup.c fcntl.c file.c file_hack.c fs.c fsync.c getdirentries.c init.c inode.c ioctl.c ioctx.c iowait.c link.c lseek.c mkdir.c mknod.c mount.c namei.c open.c readlink.c rename.c rmdir.c rw.c stat.c stat64.c statvfs.c statvfs64.c stdlib.c symlink.c truncate.c unlink.c utime.c Log Message: The public include xtio.h was mostly unneeded, except for the definition of ioid_t. For the internals, we are converted to using the address of the IO context record as the identifier. Removed, finally, xtio.h from everything not involving the data path. Externally, of course, everything is the same. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- access.c 3 Jul 2004 05:47:13 -0000 1.7 +++ access.c 27 Jul 2004 15:00:43 -0000 1.8 @@ -48,7 +48,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "sysio-symbols.h" Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- chdir.c 3 Jul 2004 05:47:13 -0000 1.18 +++ chdir.c 27 Jul 2004 15:00:43 -0000 1.19 @@ -73,7 +73,6 @@ #include <assert.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "mount.h" Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- chmod.c 3 Jul 2004 05:47:13 -0000 1.13 +++ chmod.c 27 Jul 2004 15:00:43 -0000 1.14 @@ -49,7 +49,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- chown.c 3 Jul 2004 05:47:13 -0000 1.12 +++ chown.c 27 Jul 2004 15:00:43 -0000 1.13 @@ -49,7 +49,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- dev.c 3 Jul 2004 05:47:13 -0000 1.8 +++ dev.c 27 Jul 2004 15:00:43 -0000 1.9 @@ -48,7 +48,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "dev.h" Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- dup.c 27 Jul 2004 14:20:43 -0000 1.10 +++ dup.c 27 Jul 2004 15:00:43 -0000 1.11 @@ -46,7 +46,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "file.h" #include "sysio-symbols.h" Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- fcntl.c 27 Jul 2004 14:20:43 -0000 1.19 +++ fcntl.c 27 Jul 2004 15:00:43 -0000 1.20 @@ -47,7 +47,6 @@ #include <fcntl.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- file.c 27 Jul 2004 14:20:43 -0000 1.14 +++ file.c 27 Jul 2004 15:00:43 -0000 1.15 @@ -47,7 +47,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "file.h" #include "inode.h" Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- file_hack.c 3 Jul 2004 05:47:13 -0000 1.3 +++ file_hack.c 27 Jul 2004 15:00:43 -0000 1.4 @@ -48,7 +48,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "file.h" #include "inode.h" Index: fs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fs.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- fs.c 3 Jul 2004 05:47:13 -0000 1.12 +++ fs.c 27 Jul 2004 15:00:43 -0000 1.13 @@ -48,7 +48,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "fs.h" #include "inode.h" Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- fsync.c 3 Jul 2004 05:47:13 -0000 1.6 +++ fsync.c 27 Jul 2004 15:00:43 -0000 1.7 @@ -46,7 +46,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "file.h" #include "inode.h" Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- getdirentries.c 3 Jul 2004 05:47:13 -0000 1.16 +++ getdirentries.c 27 Jul 2004 15:00:43 -0000 1.17 @@ -75,7 +75,6 @@ #include <dirent.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- init.c 27 Jul 2004 14:20:43 -0000 1.12 +++ init.c 27 Jul 2004 15:00:43 -0000 1.13 @@ -392,7 +392,6 @@ do_creat(char *args) xtvec.xtv_len = iovec.iov_len; IOCTX_INIT(&io_context, 1, - (ioid_t )&io_context, 1, ino, &iovec, 1, Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- inode.c 21 Jul 2004 21:22:24 -0000 1.18 +++ inode.c 27 Jul 2004 15:00:43 -0000 1.19 @@ -49,7 +49,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "fs.h" #include "mount.h" Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- ioctl.c 3 Jul 2004 05:47:13 -0000 1.10 +++ ioctl.c 27 Jul 2004 15:00:48 -0000 1.11 @@ -46,7 +46,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- ioctx.c 12 Jul 2004 22:51:51 -0000 1.18 +++ ioctx.c 27 Jul 2004 15:00:48 -0000 1.19 @@ -125,7 +125,6 @@ _sysio_ioctx_new(struct inode *ino, IOCTX_INIT(ioctx, 0, - (ioid_t )ioctx, wr, ino, iov, iovlen, @@ -172,12 +171,12 @@ _sysio_ioctx_cb(struct ioctx *ioctx, * this implementation. */ struct ioctx * -_sysio_ioctx_find(ioid_t id) +_sysio_ioctx_find(void *id) { struct ioctx *ioctx; for (ioctx = aioq.lh_first; ioctx; ioctx = ioctx->ioctx_link.le_next) - if (ioctx->ioctx_id == id) + if (ioctx == id) return ioctx; return NULL; Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- iowait.c 3 Jul 2004 05:47:13 -0000 1.8 +++ iowait.c 27 Jul 2004 15:00:48 -0000 1.9 @@ -45,7 +45,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" @@ -57,7 +56,7 @@ * Poll status of asynch IO request. */ int -SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid) +SYSIO_INTERFACE_NAME(iodone)(void *ioid) { struct ioctx *ioctx; int rc; @@ -82,7 +81,7 @@ SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid * The identifier is no longer valid after return. */ ssize_t -SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid) +SYSIO_INTERFACE_NAME(iowait)(void *ioid) { struct ioctx *ioctx; ssize_t cc; Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- link.c 3 Jul 2004 05:47:13 -0000 1.9 +++ link.c 27 Jul 2004 15:00:48 -0000 1.10 @@ -49,7 +49,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "mount.h" #include "inode.h" Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- lseek.c 3 Jul 2004 05:47:13 -0000 1.22 +++ lseek.c 27 Jul 2004 15:00:48 -0000 1.23 @@ -48,7 +48,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- mkdir.c 3 Jul 2004 05:47:13 -0000 1.12 +++ mkdir.c 27 Jul 2004 15:00:48 -0000 1.13 @@ -47,7 +47,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "fs.h" Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- mknod.c 3 Jul 2004 05:47:13 -0000 1.14 +++ mknod.c 27 Jul 2004 15:00:48 -0000 1.15 @@ -52,7 +52,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "fs.h" Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- mount.c 3 Jul 2004 05:47:13 -0000 1.15 +++ mount.c 27 Jul 2004 15:00:48 -0000 1.16 @@ -616,7 +616,6 @@ _sysio_automount(struct pnode *mntpno) xtvec.xtv_len = stbuf.st_size; IOCTX_INIT(&iocontext, 1, - (ioid_t )&iocontext, 0, ino, &iovec, 1, Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- namei.c 3 Jul 2004 05:47:13 -0000 1.13 +++ namei.c 27 Jul 2004 15:00:48 -0000 1.14 @@ -54,7 +54,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "mount.h" #include "inode.h" Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- open.c 27 Jul 2004 14:20:43 -0000 1.22 +++ open.c 27 Jul 2004 15:00:48 -0000 1.23 @@ -55,7 +55,6 @@ #include <fcntl.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: readlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/readlink.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- readlink.c 3 Jul 2004 05:47:13 -0000 1.2 +++ readlink.c 27 Jul 2004 15:00:48 -0000 1.3 @@ -47,7 +47,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "sysio-symbols.h" Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- rename.c 3 Jul 2004 05:47:13 -0000 1.6 +++ rename.c 27 Jul 2004 15:00:48 -0000 1.7 @@ -50,7 +50,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "mount.h" #include "inode.h" Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- rmdir.c 3 Jul 2004 05:47:13 -0000 1.14 +++ rmdir.c 27 Jul 2004 15:00:48 -0000 1.15 @@ -47,7 +47,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "fs.h" Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- rw.c 3 Jul 2004 05:47:13 -0000 1.11 +++ rw.c 27 Jul 2004 15:00:48 -0000 1.12 @@ -267,7 +267,7 @@ SYSIO_INTERFACE_NAME(ireadv)(int fd, con free(xtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } ssize_t @@ -351,7 +351,7 @@ SYSIO_INTERFACE_NAME(iread)(int fd, void free(iov); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } ssize_t @@ -464,7 +464,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv) free(xtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } #if _LARGEFILE64_SOURCE @@ -578,7 +578,7 @@ error: free(xtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } #if _LARGEFILE64_SOURCE @@ -693,7 +693,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)) NULL, &ioctx); - SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err); } #if _LARGEFILE64_SOURCE @@ -743,7 +743,7 @@ SYSIO_INTERFACE_NAME(ireadx)(int fd, free(ixtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } #else #undef ireadx @@ -833,7 +833,7 @@ SYSIO_INTERFACE_NAME(iwritev)(int fd, free(xtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } ssize_t @@ -909,7 +909,7 @@ SYSIO_INTERFACE_NAME(iwrite)(int fd, con free(iov); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } ssize_t @@ -983,7 +983,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev free(xtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } #if _LARGEFILE64_SOURCE @@ -1097,7 +1097,7 @@ error: free(xtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } #if _LARGEFILE64_SOURCE @@ -1212,7 +1212,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(iwritex) NULL, &ioctx); - SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err); } #if _LARGEFILE64_SOURCE @@ -1262,7 +1262,7 @@ SYSIO_INTERFACE_NAME(iwritex)(int fd, free(ixtv); SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); + SYSIO_INTERFACE_RETURN(ioctx, 0); } #else #undef iwritex Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- stat.c 3 Jul 2004 05:47:13 -0000 1.15 +++ stat.c 27 Jul 2004 15:00:48 -0000 1.16 @@ -48,7 +48,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- stat64.c 3 Jul 2004 05:47:13 -0000 1.11 +++ stat64.c 27 Jul 2004 15:00:48 -0000 1.12 @@ -50,7 +50,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- statvfs.c 3 Jul 2004 05:47:13 -0000 1.11 +++ statvfs.c 27 Jul 2004 15:00:48 -0000 1.12 @@ -50,7 +50,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- statvfs64.c 3 Jul 2004 05:47:13 -0000 1.13 +++ statvfs64.c 27 Jul 2004 15:00:48 -0000 1.14 @@ -49,7 +49,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: stdlib.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stdlib.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- stdlib.c 18 Jul 2004 15:57:45 -0000 1.4 +++ stdlib.c 27 Jul 2004 15:00:48 -0000 1.5 @@ -35,7 +35,6 @@ #include <fcntl.h> #include <dirent.h> -#include "xtio.h" #include <sysio.h> #include "sysio-symbols.h" Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- symlink.c 3 Jul 2004 05:47:13 -0000 1.10 +++ symlink.c 27 Jul 2004 15:00:48 -0000 1.11 @@ -47,7 +47,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "fs.h" Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- truncate.c 3 Jul 2004 05:47:13 -0000 1.11 +++ truncate.c 27 Jul 2004 15:00:48 -0000 1.12 @@ -49,7 +49,6 @@ #include <sys/stat.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- unlink.c 3 Jul 2004 05:47:13 -0000 1.13 +++ unlink.c 27 Jul 2004 15:00:48 -0000 1.14 @@ -47,7 +47,6 @@ #include <sys/types.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "fs.h" Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- utime.c 3 Jul 2004 05:47:13 -0000 1.5 +++ utime.c 27 Jul 2004 15:00:48 -0000 1.6 @@ -51,7 +51,6 @@ #include <unistd.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" #include "inode.h" #include "file.h" |
From: Lee W. <lw...@us...> - 2004-07-27 14:20:54
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2742/src Modified Files: dup.c fcntl.c file.c init.c open.c Log Message: _sysio_fd_dup2 name and usage has changed: 1) New name is _sysio_fd_dup 2) newfd < 0; Same behavior as before. 3) newfd >= 0 && force; Same behavior as before (dup2). 4) newfd >= 0 && !force; Find an available descriptor >= newfd (see fcntl-DUPFD) _sysio_set_fd usage has changed. It takes a new `force' flag. See discussion above (2, 3, and 4) for description. Fixed a bug in fcntl. The error return logic was wrong. Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- dup.c 3 Jul 2004 05:47:13 -0000 1.9 +++ dup.c 27 Jul 2004 14:20:43 -0000 1.10 @@ -70,7 +70,7 @@ SYSIO_INTERFACE_NAME(dup2)(int oldfd, in SYSIO_INTERFACE_RETURN(newfd, 0); } - fd = _sysio_fd_dup2(oldfd, newfd); + fd = _sysio_fd_dup(oldfd, newfd, 1); SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); } @@ -87,7 +87,7 @@ SYSIO_INTERFACE_NAME(dup)(int oldfd) SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - fd = _sysio_fd_dup2(oldfd, -1); + fd = _sysio_fd_dup(oldfd, -1, 0); SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); } Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- fcntl.c 26 Jul 2004 17:07:49 -0000 1.18 +++ fcntl.c 27 Jul 2004 14:20:43 -0000 1.19 @@ -127,8 +127,11 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int err = -EBADF; goto out; } - err = _sysio_fd_dup2(fd, (int )newfd); - rtn = !err ? (int )newfd : -1; + rtn = _sysio_fd_dup(fd, (int )newfd, 0); + if (rtn < 0) { + err = rtn; + rtn = -1; + } } break; default: Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- file.c 26 Jul 2004 18:53:31 -0000 1.13 +++ file.c 27 Jul 2004 14:20:43 -0000 1.14 @@ -160,21 +160,24 @@ _sysio_fd_shutdown() #endif /* - * Find a free slot in the open files table. + * Find a free slot in the open files table greater than or equal to the + * argument. */ static int -find_free_fildes() +find_free_fildes(int low) { - size_t n; + int n; int err; struct file **filp; - for (n = 0, filp = _sysio_oftab; - n < _sysio_oftab_size && *filp; + for (n = low, filp = _sysio_oftab + low; + n >= 0 && (unsigned )n < _sysio_oftab_size && *filp; n++, filp++) ; - if (n >= _sysio_oftab_size) { - err = fd_grow(n); + if (n < 0) + return -ENFILE; + if ((unsigned )n >= _sysio_oftab_size) { + err = fd_grow((size_t )n); if (err) return err; filp = &_sysio_oftab[n]; @@ -216,20 +219,23 @@ _sysio_fd_close(int fd) } /* - * Associate open file record with given file descriptor or any available - * file descriptor if less than zero. + * Associate open file record with given file descriptor (if forced), or any + * available file descriptor if less than zero, or any available descriptor + * greater than or equal to the given one if not forced. */ int -_sysio_fd_set(struct file *fil, int fd) +_sysio_fd_set(struct file *fil, int fd, int force) { int err; struct file *ofil; /* - * New fd < 0 => any available descriptor. + * Search for a free descriptor if needed. */ - if (fd < 0) { - fd = find_free_fildes(); + if (fd < 0 || !force) { + if (fd < 0) + fd = 0; + fd = find_free_fildes(fd); if (fd < 0) return fd; } @@ -258,10 +264,12 @@ _sysio_fd_set(struct file *fil, int fd) * Duplicate old file descriptor. * * If the new file descriptor is less than zero, the new file descriptor - * is chosen freely. + * is chosen freely. Otherwise, choose an available descriptor greater + * than or equal to the new, if not forced. Otherwise, if forced, (re)use + * the new. */ int -_sysio_fd_dup2(int oldfd, int newfd) +_sysio_fd_dup(int oldfd, int newfd, int force) { struct file *fil; int fd; @@ -273,7 +281,7 @@ _sysio_fd_dup2(int oldfd, int newfd) if (!fil) return -EBADF; - fd = _sysio_fd_set(fil, newfd); + fd = _sysio_fd_set(fil, newfd, force); if (fd >= 0) F_REF(fil); return fd; Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- init.c 3 Jul 2004 05:47:13 -0000 1.11 +++ init.c 27 Jul 2004 14:20:43 -0000 1.12 @@ -597,7 +597,7 @@ do_open(char *args) err = -ENOMEM; break; } - err = _sysio_fd_set(fil, fd); + err = _sysio_fd_set(fil, fd, 1); if (err < 0) break; P_RELE(pno); Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- open.c 3 Jul 2004 05:47:13 -0000 1.21 +++ open.c 27 Jul 2004 14:20:43 -0000 1.22 @@ -199,7 +199,7 @@ SYSIO_INTERFACE_NAME(open)(const char *p rtn = -ENOMEM; goto error; } - rtn = _sysio_fd_set(fil, -1); + rtn = _sysio_fd_set(fil, -1, 0); if (rtn < 0) goto error; |
From: Lee W. <lw...@us...> - 2004-07-27 14:20:52
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2742/include Modified Files: file.h Log Message: _sysio_fd_dup2 name and usage has changed: 1) New name is _sysio_fd_dup 2) newfd < 0; Same behavior as before. 3) newfd >= 0 && force; Same behavior as before (dup2). 4) newfd >= 0 && !force; Find an available descriptor >= newfd (see fcntl-DUPFD) _sysio_set_fd usage has changed. It takes a new `force' flag. See discussion above (2, 3, and 4) for description. Fixed a bug in fcntl. The error return logic was wrong. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- file.h 28 Apr 2004 12:23:19 -0000 1.9 +++ file.h 27 Jul 2004 14:20:43 -0000 1.10 @@ -102,8 +102,8 @@ extern void _sysio_fgone(struct file *fi extern void _sysio_fcompletio(struct ioctx *ioctx, struct file *fil); extern int _sysio_fd_close(int fd); extern struct file *_sysio_fd_find(int fd); -extern int _sysio_fd_set(struct file *fil, int fd); -extern int _sysio_fd_dup2(int oldfd, int newfd); +extern int _sysio_fd_set(struct file *fil, int fd, int force); +extern int _sysio_fd_dup(int oldfd, int newfd, int force); extern int _sysio_fd_close_all(void); #if ZERO_SUM_MEMORY extern void _sysio_fd_shutdown(void); |
From: Lee W. <lw...@us...> - 2004-07-27 14:11:28
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2046 Modified Files: sockets.c Log Message: Oops. The symbol is WITH_LUSTRE_HACK and not LUSTRE_HACK. Fixed. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- sockets.c 27 Jul 2004 14:05:20 -0000 1.7 +++ sockets.c 27 Jul 2004 14:11:14 -0000 1.8 @@ -394,7 +394,7 @@ socket(int domain, int type, int protoco goto error; } -#if defined(LUSTRE_HACK) && LUSTRE_HACK +#ifdef WITH_LUSTRE_HACK err = _sysio_fd_set(fil, ski->ski_fd, 1); #else err = _sysio_fd_set(fil, -1, 0); @@ -462,7 +462,7 @@ accept(int s, struct sockaddr *addr, soc goto error; } -#if defined(LUSTRE_HACK) && LUSTRE_HACK +#ifdef WITH_LUSTRE_HACK err = _sysio_fd_set(nfil, ski->ski_fd); #else err = _sysio_fd_set(nfil, -1, 0); |
From: Lee W. <lw...@us...> - 2004-07-27 14:05:46
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv577 Modified Files: sockets.c Log Message: Reflect changes in _sysio_dup (was _sysio_fd_dup2) usage. Also, ifdef'd selection of the file descriptor when compiled --with lustre_hack because taking the system supplied descriptor closes already open files. Obviously, it's still broken when --with lustre_hack is used but nobody seems to care. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- sockets.c 26 Jul 2004 17:11:13 -0000 1.6 +++ sockets.c 27 Jul 2004 14:05:20 -0000 1.7 @@ -236,7 +236,7 @@ sockets_inop_write(struct inode *ino, } static _SYSIO_OFF_T -sockets_inop_pos(struct inode *ino, _SYSIO_OFF_T off) +sockets_inop_pos(struct inode *ino __IS_UNUSED, _SYSIO_OFF_T off __IS_UNUSED) { return -EINVAL; } @@ -394,7 +394,11 @@ socket(int domain, int type, int protoco goto error; } - err = _sysio_fd_set(fil, ski->ski_fd); +#if defined(LUSTRE_HACK) && LUSTRE_HACK + err = _sysio_fd_set(fil, ski->ski_fd, 1); +#else + err = _sysio_fd_set(fil, -1, 0); +#endif if (err < 0) goto error; @@ -458,7 +462,11 @@ accept(int s, struct sockaddr *addr, soc goto error; } +#if defined(LUSTRE_HACK) && LUSTRE_HACK err = _sysio_fd_set(nfil, ski->ski_fd); +#else + err = _sysio_fd_set(nfil, -1, 0); +#endif if (err < 0) goto error; |
From: Lee W. <lw...@us...> - 2004-07-26 18:53:43
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5761 Modified Files: file.c Log Message: From Ruth; In _sysio_fd_dup2, if old -- new then zero is returned. Fixed. It returns the fildes now. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- file.c 3 Jul 2004 05:47:13 -0000 1.12 +++ file.c 26 Jul 2004 18:53:31 -0000 1.13 @@ -267,7 +267,7 @@ _sysio_fd_dup2(int oldfd, int newfd) int fd; if (oldfd == newfd) - return 0; + return newfd; fil = _sysio_fd_find(oldfd); if (!fil) |
From: Lee W. <lw...@us...> - 2004-07-26 17:11:22
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17455 Modified Files: sockets.c Log Message: Adheres to new rules/returns for fcntl now. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- sockets.c 26 Jul 2004 16:38:00 -0000 1.5 +++ sockets.c 26 Jul 2004 17:11:13 -0000 1.6 @@ -255,7 +255,7 @@ static int sockets_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, va_list ap __IS_UNUSED, - int *rtn __IS_UNUSED) + int *rtn) { long arg; @@ -265,7 +265,8 @@ sockets_inop_fcntl(struct inode *ino __I case F_GETFD: case F_GETFL: case F_GETOWN: - return syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd); + *rtn = syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd); + break; case F_DUPFD: case F_SETFD: case F_SETFL: @@ -274,12 +275,13 @@ sockets_inop_fcntl(struct inode *ino __I case F_SETLKW: case F_SETOWN: arg = va_arg(ap, long); - return syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd, arg); + *rtn = syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd, arg); + break; default: - printf("uncatched cmd %d\n", cmd); - abort(); + *rtn = -1; + errno = EINVAL; } - return -1; + return *rtn == -1 ? -errno : 0; } static int |
From: Lee W. <lw...@us...> - 2004-07-26 17:10:30
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16922 Modified Files: fs_yod.c Log Message: Bad prototype for driver fcntl fixed. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- fs_yod.c 26 Jul 2004 16:38:00 -0000 1.16 +++ fs_yod.c 26 Jul 2004 17:10:15 -0000 1.17 @@ -177,7 +177,7 @@ static _SYSIO_OFF_T yod_inop_pos (struct static int yod_inop_read(struct inode *ino, struct ioctx *ioctx); static int yod_inop_write(struct inode *ino, struct ioctx *ioctx); static int yod_inop_iodone(struct ioctx *ioctx); -static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap); +static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn); static int yod_inop_sync(struct inode *ino); static int yod_inop_datasync(struct inode *ino); static int yod_inop_ioctl(struct inode *ino, |
From: Lee W. <lw...@us...> - 2004-07-26 17:09:30
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16663 Modified Files: fs_incore.c Log Message: The new *rtn value/result parameter was not being set. This caused fcntl in .../src/fcntl.c to fail indeterminately. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- fs_incore.c 26 Jul 2004 16:37:59 -0000 1.19 +++ fs_incore.c 26 Jul 2004 17:09:21 -0000 1.20 @@ -1576,12 +1576,13 @@ static int _sysio_incore_filop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, va_list ap __IS_UNUSED, - int *rtn __IS_UNUSED) + int *rtn) { /* * No fcntl's supported. */ + *rtn = -1; return -ENOTTY; } |
From: Lee W. <lw...@us...> - 2004-07-26 17:07:58
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16218 Modified Files: fcntl.c Log Message: Inconsistencies for WITH_LUSTRE_HACK. Implemented the way the drivers are expected to do it now. Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- fcntl.c 26 Jul 2004 16:37:18 -0000 1.17 +++ fcntl.c 26 Jul 2004 17:07:49 -0000 1.18 @@ -58,16 +58,16 @@ #include <syscall.h> static int -_sysio_fcntl(int fd, int cmd, va_list ap) +_sysio_fcntl(int fd, int cmd, va_list ap, int *rtn) { - int err; long arg; switch (cmd) { case F_GETFD: case F_GETFL: case F_GETOWN: - return syscall(SYS_fcntl, fd, cmd); + *rtn = syscall(SYS_fcntl, fd, cmd); + break; case F_DUPFD: case F_SETFD: case F_SETFL: @@ -76,11 +76,14 @@ _sysio_fcntl(int fd, int cmd, va_list ap case F_SETLKW: case F_SETOWN: arg = va_arg(ap, long); - return syscall(SYS_fcntl, fd, cmd, arg); + *rtn = syscall(SYS_fcntl, fd, cmd, arg); + break; + default: + *rtn = -1; + errno = EINVAL; } - errno = ENOSYS; - return -1; + return *rtn == -1 ? -errno : 0; } #endif @@ -99,12 +102,12 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int if (!fil) { #ifdef HAVE_LUSTRE_HACK va_start(ap, cmd); - err = _sysio_fcntl(fd, cmd, ap); + err = _sysio_fcntl(fd, cmd, ap, &rtn); va_end(ap); - if (err == -1) - err = -errno; goto out; #else + + rtn = -1; err = -EBADF; goto out; #endif @@ -120,10 +123,12 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int newfd = va_arg(ap, long); va_end(ap); if (newfd != (int )newfd || newfd < 0) { + rtn = -1; err = -EBADF; goto out; } err = _sysio_fd_dup2(fd, (int )newfd); + rtn = !err ? (int )newfd : -1; } break; default: |
From: Ruth K. <rk...@us...> - 2004-07-26 16:38:11
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10551/include Modified Files: dev.h inode.h Log Message: fcntl fixes: fcntl may return a positive or negative value. Driver function interfaces have been changed to accomodate a returned system call value in the arguments. The return value of the driver functions is 0 for success and -errno for failure. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- dev.h 21 Jul 2004 21:22:24 -0000 1.8 +++ dev.h 26 Jul 2004 16:38:01 -0000 1.9 @@ -122,7 +122,8 @@ extern const struct inode_ops _sysio_nod #define _sysio_nodev_inop_fcntl \ (int (*)(struct inode *, \ int, \ - va_list))_sysio_do_ebadf + va_list, \ + int *))_sysio_do_ebadf #define _sysio_nodev_inop_sync \ (int (*)(struct inode *))_sysio_do_ebadf #define _sysio_nodev_inop_datasync \ Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- inode.h 21 Jul 2004 21:22:24 -0000 1.19 +++ inode.h 26 Jul 2004 16:38:01 -0000 1.20 @@ -103,7 +103,7 @@ struct inode_ops { int (*inop_write)(struct inode *ino, struct ioctx *ioctx); _SYSIO_OFF_T (*inop_pos)(struct inode *ino, _SYSIO_OFF_T off); int (*inop_iodone)(struct ioctx *iocp); - int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap); + int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap, int *rtn); int (*inop_sync)(struct inode *ino); int (*inop_datasync)(struct inode *ino); int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap); |
From: Ruth K. <rk...@us...> - 2004-07-26 16:38:09
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10551/drivers/incore Modified Files: fs_incore.c Log Message: fcntl fixes: fcntl may return a positive or negative value. Driver function interfaces have been changed to accomodate a returned system call value in the arguments. The return value of the driver functions is 0 for success and -errno for failure. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- fs_incore.c 3 Jul 2004 05:47:12 -0000 1.18 +++ fs_incore.c 26 Jul 2004 16:37:59 -0000 1.19 @@ -148,7 +148,8 @@ static int _sysio_incore_filop_write(str static _SYSIO_OFF_T _sysio_incore_filop_pos(struct inode *ino, _SYSIO_OFF_T off); static int _sysio_incore_filop_iodone(struct ioctx *ioctx); -static int _sysio_incore_filop_fcntl(struct inode *ino, int cmd, va_list ap); +static int _sysio_incore_filop_fcntl(struct inode *ino, + int cmd, va_list ap, int *rtn); static int _sysio_incore_inop_sync(struct inode *ino); static int _sysio_incore_filop_ioctl(struct inode *ino, unsigned long int request, @@ -177,7 +178,7 @@ static void _sysio_incore_inop_gone(stru #define _sysio_incore_dirop_iodone \ (int (*)(struct ioctx *))_sysio_do_illop #define _sysio_incore_dirop_fcntl \ - (int (*)(struct inode *, int, va_list))_sysio_do_eisdir + (int (*)(struct inode *, int, va_list, int *))_sysio_do_eisdir #define _sysio_incore_dirop_ioctl \ (int (*)(struct inode *, \ unsigned long int, \ @@ -1574,7 +1575,8 @@ _sysio_incore_filop_iodone(struct ioctx static int _sysio_incore_filop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, - va_list ap __IS_UNUSED) + va_list ap __IS_UNUSED, + int *rtn __IS_UNUSED) { /* |
From: Ruth K. <rk...@us...> - 2004-07-26 16:38:09
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10551/drivers/yod Modified Files: fs_yod.c Log Message: fcntl fixes: fcntl may return a positive or negative value. Driver function interfaces have been changed to accomodate a returned system call value in the arguments. The return value of the driver functions is 0 for success and -errno for failure. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- fs_yod.c 3 Jul 2004 05:47:12 -0000 1.15 +++ fs_yod.c 26 Jul 2004 16:38:00 -0000 1.16 @@ -1101,18 +1101,45 @@ yod_inop_iodone(struct ioctx *ioctxp __I } static int -yod_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd, va_list ap __IS_UNUSED) +yod_inop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn) { - switch (cmd) - { - case F_DUPFD: /* do something to the ino */ + struct yod_inode *nino = I2NI(ino); + long arg; + int err; + + if (nino->ni_fd < 0) + abort(); + + err = 0; + switch (cmd) { + case F_GETFD: + case F_GETFL: +#ifdef F_GETOWN + case F_GETOWN: +#endif + *rtn = syscall(SYS_fcntl, nino->ni_fd, cmd); + if (*rtn == -1) + err = -errno; + break; + case F_DUPFD: + case F_SETFD: + case F_SETFL: + case F_GETLK: + case F_SETLK: + case F_SETLKW: +#ifdef F_SETOWN + case F_SETOWN: +#endif + arg = va_arg(ap, long); + *rtn = syscall(SYS_fcntl, nino->ni_fd, cmd, arg); + if (*rtn == -1) + err = -errno; break; default: - errno = EINVAL; - return -1; + *rtn = -1; + err = -EINVAL; } - return 0; - + return err; } static int |
From: Ruth K. <rk...@us...> - 2004-07-26 16:38:09
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10551/drivers/sockets Modified Files: sockets.c Log Message: fcntl fixes: fcntl may return a positive or negative value. Driver function interfaces have been changed to accomodate a returned system call value in the arguments. The return value of the driver functions is 0 for success and -errno for failure. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- sockets.c 3 Jul 2004 05:47:12 -0000 1.4 +++ sockets.c 26 Jul 2004 16:38:00 -0000 1.5 @@ -100,7 +100,7 @@ static _SYSIO_OFF_T sockets_inop_pos(str static int sockets_inop_iodone(struct ioctx *ioctx); static int sockets_inop_sync(struct inode *ino); static int sockets_inop_datasync(struct inode *ino); -static int sockets_inop_fcntl(struct inode *ino, int cmd, va_list ap); +static int sockets_inop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn); static int sockets_inop_ioctl(struct inode *ino, unsigned long int request, va_list ap); @@ -254,7 +254,8 @@ sockets_inop_iodone(struct ioctx *ioctxp static int sockets_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, - va_list ap __IS_UNUSED) + va_list ap __IS_UNUSED, + int *rtn __IS_UNUSED) { long arg; |
From: Ruth K. <rk...@us...> - 2004-07-26 16:38:09
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10551/drivers/native Modified Files: fs_native.c Log Message: fcntl fixes: fcntl may return a positive or negative value. Driver function interfaces have been changed to accomodate a returned system call value in the arguments. The return value of the driver functions is 0 for success and -errno for failure. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -w -b -B -p -r1.42 -r1.43 --- fs_native.c 23 Jul 2004 15:11:57 -0000 1.42 +++ fs_native.c 26 Jul 2004 16:37:59 -0000 1.43 @@ -249,7 +249,7 @@ static int native_inop_read(struct inode static int native_inop_write(struct inode *ino, struct ioctx *ioctx); static _SYSIO_OFF_T native_inop_pos(struct inode *ino, _SYSIO_OFF_T off); static int native_inop_iodone(struct ioctx *ioctx); -static int native_inop_fcntl(struct inode *ino, int cmd, va_list ap); +static int native_inop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn); static int native_inop_sync(struct inode *ino); static int native_inop_datasync(struct inode *ino); static int native_inop_ioctl(struct inode *ino, @@ -1614,7 +1614,8 @@ native_inop_iodone(struct ioctx *ioctxp static int native_inop_fcntl(struct inode *ino, int cmd, - va_list ap) + va_list ap, + int *rtn) { struct native_inode *nino = I2NI(ino); long arg; @@ -1623,12 +1624,15 @@ native_inop_fcntl(struct inode *ino, if (nino->ni_fd < 0) abort(); + err = 0; switch (cmd) { case F_GETFD: case F_GETFL: +#ifdef F_GETOWN case F_GETOWN: - err = syscall(SYS_fcntl, nino->ni_fd, cmd); - if (err < 0) +#endif + *rtn = syscall(SYS_fcntl, nino->ni_fd, cmd); + if (*rtn == -1) err = -errno; break; case F_DUPFD: @@ -1637,13 +1641,16 @@ native_inop_fcntl(struct inode *ino, case F_GETLK: case F_SETLK: case F_SETLKW: +#ifdef F_SETOWN case F_SETOWN: +#endif arg = va_arg(ap, long); - err = syscall(SYS_fcntl, nino->ni_fd, cmd, arg); - if (err) + *rtn = syscall(SYS_fcntl, nino->ni_fd, cmd, arg); + if (*rtn == -1) err = -errno; break; default: + *rtn = -1; err = -EINVAL; } return err; |
From: Ruth K. <rk...@us...> - 2004-07-26 16:37:42
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9662 Modified Files: fcntl.c Log Message: fcntl fixes: fcntl may return a positive or negative value. Driver function interfaces have been changed to accomodate a returned system call value in the arguments. The return value of the driver functions is 0 for success and -errno for failure. Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- fcntl.c 21 Jul 2004 00:45:44 -0000 1.16 +++ fcntl.c 26 Jul 2004 16:37:18 -0000 1.17 @@ -88,6 +88,7 @@ int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...) { int err; + int rtn; struct file *fil; va_list ap; SYSIO_INTERFACE_DISPLAY_BLOCK; @@ -127,13 +128,13 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int break; default: va_start(ap, cmd); - err = fil->f_ino->i_ops.inop_fcntl(fil->f_ino, cmd, ap); + err = fil->f_ino->i_ops.inop_fcntl(fil->f_ino, cmd, ap, &rtn); va_end(ap); break; } out: - SYSIO_INTERFACE_RETURN((err < 0) ? -1 : err, (err < 0) ? err : 0); + SYSIO_INTERFACE_RETURN(rtn, err); } #ifdef __GLIBC__ |