[Libsysio-commit] b_lustre: libsysio/src bypass.c fcntl.c
Brought to you by:
lward
|
From: Mei <me...@us...> - 2003-11-01 03:38:31
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31910/src
Modified Files:
Tag: b_lustre
bypass.c fcntl.c
Log Message:
use the common code of fcntl(), need some cleanup later.
Index: bypass.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/Attic/bypass.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -w -b -B -p -r1.1.2.3 -r1.1.2.4
--- bypass.c 8 Sep 2003 03:58:17 -0000 1.1.2.3
+++ bypass.c 1 Nov 2003 03:38:27 -0000 1.1.2.4
@@ -96,31 +96,5 @@ ioid_t __bypass_pwritev(int fd, const st
int __bypass_fcntl(int fd, int cmd, va_list ap)
{
- int err;
- long arg;
-
- DEBUG("fcntl on unknown fd %d, cmd %d\n", fd, cmd);
- switch (cmd) {
- case F_GETFD:
- case F_GETFL:
- case F_GETOWN:
-// case F_GETSIG:
-// case F_GETLEASE:
- return syscall(SYS_fcntl, fd, cmd);
- case F_DUPFD:
- case F_SETFD:
- case F_SETFL:
- case F_GETLK:
- case F_SETLK:
- case F_SETLKW:
- case F_SETOWN:
-// case F_SETSIG:
-// case F_SETLEASE:
-// case F_NOTIFY:
- arg = va_arg(ap, long);
- return syscall(SYS_fcntl, fd, cmd, arg);
- default:
- ERROR("uncatched cmd %d\n", cmd);
- }
- return -1;
+ return _sysio_fcntl_common(fd, cmd, ap);
}
Index: fcntl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v
retrieving revision 1.3.2.7
retrieving revision 1.3.2.8
diff -u -w -b -B -p -r1.3.2.7 -r1.3.2.8
--- fcntl.c 1 Nov 2003 03:08:22 -0000 1.3.2.7
+++ fcntl.c 1 Nov 2003 03:38:28 -0000 1.3.2.8
@@ -58,6 +58,36 @@
#include "sysio-symbols.h"
+int _sysio_fcntl_common(int fd, int cmd, va_list ap)
+{
+ int err;
+ long arg;
+
+ switch (cmd) {
+ case F_GETFD:
+ case F_GETFL:
+ case F_GETOWN:
+// case F_GETSIG:
+// case F_GETLEASE:
+ return syscall(SYS_fcntl, fd, cmd);
+ case F_DUPFD:
+ case F_SETFD:
+ case F_SETFL:
+ case F_GETLK:
+ case F_SETLK:
+ case F_SETLKW:
+ case F_SETOWN:
+// case F_SETSIG:
+// case F_SETLEASE:
+// case F_NOTIFY:
+ arg = va_arg(ap, long);
+ return syscall(SYS_fcntl, fd, cmd, arg);
+ }
+
+ printf("sysio: unrecongnized fcntl cmd %d on fd %d\n", cmd, fd);
+ return -ENOSYS;
+}
+
int
fcntl(int fd, int cmd, ...)
{
|