[Libsysio-commit] namespace_assembly: libsysio/drivers/native fs_native.c
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:08
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/drivers/native Modified Files: Tag: namespace_assembly fs_native.c Log Message: Bring in changes from the HEAD. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- fs_native.c 22 Oct 2003 15:57:23 -0000 1.25 +++ fs_native.c 28 Jan 2004 13:16:56 -0000 1.25.2.1 @@ -76,7 +76,6 @@ #ifdef REDSTORM #include <sys/uio.h> -#include <catamount/syscall.h> /* ! in sys include? */ #endif #ifdef REDSTORM @@ -137,11 +136,6 @@ do { (dest)->st_gen = (src)->st_gen; \ } while (0); -/* SYS_lseek has a different interface on alpha - */ -#define CALL_LSEEK(fd, off, rc, wh) \ - (rc = syscall(SYS_lseek, fd, off, wh)) - #else #define __native_stat intnl_stat @@ -1342,15 +1336,33 @@ native_inop_iodone(struct ioctx *ioctxp } static int -native_inop_fcntl(struct inode *ino __IS_UNUSED, - int cmd __IS_UNUSED, - va_list ap __IS_UNUSED) +native_inop_fcntl(struct inode *ino, + int cmd, + va_list ap) { + struct native_inode *nino = I2NI(ino); + long arg; - /* - * I'm lazy. Maybe implemented later. - */ - errno = ENOTTY; + if (nino->ni_fd < 0) + abort(); + + switch (cmd) { + case F_GETFD: + case F_GETFL: + case F_GETOWN: + return syscall(SYS_fcntl, nino->ni_fd, cmd); + 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); + return syscall(SYS_fcntl, nino->ni_fd, cmd, arg); + default: + abort(); + } return -1; } |