Thread: [Libsysio-commit] HEAD: libsysio/drivers/sockets sockets.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-05-20 19:31:57
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19480/drivers/sockets Modified Files: sockets.c Log Message: Integrated CFS changes from Eric's patch dated 5-19-2004. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- sockets.c 21 Jan 2004 14:44:53 -0000 1.2 +++ sockets.c 20 May 2004 19:31:48 -0000 1.3 @@ -89,10 +89,12 @@ struct socket_info { }; static int sockets_inop_close(struct inode *ino); -static int sockets_inop_ipreadv(struct inode *ino, +static int sockets_inop_read(struct inode *ino, struct ioctx *ioctx); -static int sockets_inop_ipwritev(struct inode *ino, +static int sockets_inop_write(struct inode *ino, struct ioctx *ioctxp); +static _SYSIO_OFF_T sockets_inop_pos(struct inode *ino, + _SYSIO_OFF_T off); static int sockets_inop_iodone(struct ioctx *ioctx); static int sockets_inop_sync(struct inode *ino); static int sockets_inop_datasync(struct inode *ino); @@ -125,8 +127,9 @@ _sysio_sockets_init() sockets_i_ops = _sysio_nodev_ops; sockets_i_ops.inop_close = sockets_inop_close; - sockets_i_ops.inop_ipreadv = sockets_inop_ipreadv; - sockets_i_ops.inop_ipwritev = sockets_inop_ipwritev; + sockets_i_ops.inop_read = sockets_inop_read; + sockets_i_ops.inop_write = sockets_inop_write; + sockets_i_ops.inop_pos = sockets_inop_pos; sockets_i_ops.inop_iodone = sockets_inop_iodone; sockets_i_ops.inop_fcntl = sockets_inop_fcntl; sockets_i_ops.inop_sync = sockets_inop_sync; @@ -172,6 +175,12 @@ doio(ssize_t (*f)(int, const struct iove assert(ski->ski_fd >= 0); + /* XXX there's no way to check the position + * here we only could ingore the extends + */ + if (ioctx->ioctx_xtvlen != 1) + return -EINVAL; + if (ioctx->ioctx_iovlen && (int) ioctx->ioctx_iovlen < 0) return -EINVAL; @@ -180,7 +189,7 @@ doio(ssize_t (*f)(int, const struct iove * transfer the data now. */ ioctx->ioctx_cc = - (*f)(ski->ski_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); + (*f)(ski->ski_fd, ioctx->ioctx_iov, ioctx->ioctx_iovlen); if (ioctx->ioctx_cc < 0) ioctx->ioctx_errno = errno; @@ -199,7 +208,7 @@ _readv(int fd, const struct iovec *vecto } static int -sockets_inop_ipreadv(struct inode *ino, +sockets_inop_read(struct inode *ino, struct ioctx *ioctx) { @@ -217,13 +226,19 @@ _writev(int fd, const struct iovec *vect } static int -sockets_inop_ipwritev(struct inode *ino, +sockets_inop_write(struct inode *ino, struct ioctx *ioctx) { return doio(_writev, ino, ioctx); } +static _SYSIO_OFF_T +sockets_inop_pos(struct inode *ino, _SYSIO_OFF_T off) +{ + return -EINVAL; +} + static int sockets_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { @@ -454,8 +469,6 @@ error: return -1; } -#if 0 - int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) { @@ -471,12 +484,12 @@ bind(int sockfd, const struct sockaddr * goto out; } - avec[0] = I2SKI(fil->f_ino)->ski_fd; - avec[1] = (unsigned long )my_addr; - avec[2] = addrlen; #ifndef SYS_socketcall if (syscall(SYS_bind, I2SKI(fil->f_ino)->ski_fd, my_addr, addrlen)) { #else + avec[0] = I2SKI(fil->f_ino)->ski_fd; + avec[1] = (unsigned long )my_addr; + avec[2] = addrlen; if (syscall(SYS_socketcall, SYS_BIND, avec) != 0) { #endif err = -errno; @@ -504,11 +517,11 @@ listen(int s, int backlog) goto out; } - avec[0] = I2SKI(fil->f_ino)->ski_fd; - avec[1] = backlog; #ifndef SYS_socketcall if (syscall(SYS_listen, I2SKI(fil->f_ino)->ski_fd, backlog) != 0) { #else + avec[0] = I2SKI(fil->f_ino)->ski_fd; + avec[1] = backlog; if (syscall(SYS_socketcall, SYS_LISTEN, avec) != 0) { #endif err = -errno; @@ -536,12 +549,13 @@ connect(int sockfd, const struct sockadd goto out; } +#ifndef SYS_socketcall + if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, + serv_addr, addrlen) != 0) { +#else avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )serv_addr; avec[2] = addrlen; -#ifndef SYS_socketcall - if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, serv_addr, addrlen) != 0) { -#else if (syscall(SYS_socketcall, SYS_CONNECT, avec) != 0) { #endif err = -errno; @@ -553,4 +567,3 @@ out: errno = -err; return -1; } -#endif |
From: Lee W. <lw...@us...> - 2004-07-03 05:47:21
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11075/drivers/sockets Modified Files: sockets.c Log Message: A new, major change, to .../include/xtio.h. This is intended to be the include file for applications. It prototype all of the extended API available as well as the necessary structures. Other shanges to support this. We now need it most everywhere to build the library as well. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- sockets.c 20 May 2004 19:31:48 -0000 1.3 +++ sockets.c 3 Jul 2004 05:47:12 -0000 1.4 @@ -57,11 +57,13 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> -#include <sys/queue.h> #include <sys/syscall.h> #include <sys/socket.h> #include <linux/net.h> +#include <sys/uio.h> +#include <sys/queue.h> +#include "xtio.h" #include "sysio.h" #include "fs.h" #include "inode.h" |
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: 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-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-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: 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: 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-09-21 16:18:53
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25715/drivers/sockets Modified Files: sockets.c Log Message: From Henry Pierce at Cray; A chdir() to a directory without `x' permission should not succeed but does. This required that inodes now carry the full attributes -- Not just the mode bits. That's a bug change. Driver writers; 1) _sysio_i_new is altered. It needs the full intnl_stat structure now. 2) Your lookup function should refresh the inode attributes. 3) We don't keep an inode dirty bit. Hopefully, you've been pushing changes at the time of the operation instead of waiting until the inode was flushed or somesuch. Maybe you keep an internal dirty bit? Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- sockets.c 5 Aug 2004 18:29:57 -0000 1.10 +++ sockets.c 21 Sep 2004 16:18:14 -0000 1.11 @@ -358,6 +358,7 @@ _sysio_sockets_inew() static ino_t inum = 1; struct socket_info *ski; struct inode *ino; + static struct intnl_stat zero_stat; ski = malloc(sizeof(struct socket_info)); if (!ski) @@ -370,8 +371,7 @@ _sysio_sockets_inew() ino = _sysio_i_new(sockets_fs, &ski->ski_fileid, - 0, - 0, + &zero_stat, 0, &sockets_i_ops, ski); |
From: Lee W. <lw...@us...> - 2004-10-14 14:59:45
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8149/drivers/sockets Modified Files: sockets.c Log Message: Merging in the defer-cwd branch. These changes include: + Carry full stat info in the inode now + Use that stat info (careful with intents!) instead of calling getattr + Cached attributes for the native driver + Abstracted and localized system call defs (see .../include/native.h) + The ability to defer path traversal to the "current working directory" unless and until a relative pathname is specified. This alters _sysio_boot to take an extra parameter (the init cwd) and must be configured with "--with-defer-init-cwd". Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- sockets.c 21 Sep 2004 16:18:14 -0000 1.11 +++ sockets.c 14 Oct 2004 14:59:28 -0000 1.12 @@ -59,12 +59,15 @@ #include <sys/fcntl.h> #include <sys/syscall.h> #include <sys/socket.h> +#ifdef __linux__ #include <linux/net.h> +#endif #include <sys/uio.h> #include <sys/queue.h> #include "xtio.h" #include "sysio.h" +#include "native.h" #include "fs.h" #include "inode.h" #include "file.h" @@ -116,7 +119,7 @@ struct filesys_ops sockets_filesys_ops = (void (*)(struct filesys *))sockets_illop }; -static struct filesys *sockets_fs; +static struct filesys *sockets_fs = NULL; static struct inode_ops sockets_i_ops; @@ -127,6 +130,8 @@ int _sysio_sockets_init() { + assert(!sockets_fs); + sockets_i_ops = _sysio_nodev_ops; sockets_i_ops.inop_close = sockets_inop_close; sockets_i_ops.inop_read = sockets_inop_read; @@ -155,7 +160,7 @@ sockets_inop_close(struct inode *ino) if (ski->ski_fd < 0) return -EBADF; - err = syscall(SYS_close, ski->ski_fd); + err = syscall(SYSIO_SYS_close, ski->ski_fd); if (err) return -errno; ski->ski_fd = -1; @@ -206,7 +211,7 @@ static ssize_t _readv(int fd, const struct iovec *vector, int count) { - return syscall(SYS_readv, fd, vector, count); + return syscall(SYSIO_SYS_readv, fd, vector, count); } static int @@ -224,7 +229,7 @@ static ssize_t _writev(int fd, const struct iovec *vector, int count) { - return syscall(SYS_writev, fd, vector, count); + return syscall(SYSIO_SYS_writev, fd, vector, count); } static int @@ -265,7 +270,7 @@ sockets_inop_fcntl(struct inode *ino __I case F_GETFD: case F_GETFL: case F_GETOWN: - *rtn = syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd); + *rtn = syscall(SYSIO_SYS_fcntl, I2SKI(ino)->ski_fd, cmd); break; case F_DUPFD: case F_SETFD: @@ -275,7 +280,7 @@ sockets_inop_fcntl(struct inode *ino __I case F_SETLKW: case F_SETOWN: arg = va_arg(ap, long); - *rtn = syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd, arg); + *rtn = syscall(SYSIO_SYS_fcntl, I2SKI(ino)->ski_fd, cmd, arg); break; default: *rtn = -1; @@ -290,7 +295,7 @@ sockets_inop_sync(struct inode *ino) assert(I2SKI(ino)->ski_fd >= 0); - return syscall(SYS_fsync, I2SKI(ino)->ski_fd); + return syscall(SYSIO_SYS_fsync, I2SKI(ino)->ski_fd); } static int @@ -299,7 +304,7 @@ sockets_inop_datasync(struct inode *ino) assert(I2SKI(ino)->ski_fd >= 0); - return syscall(SYS_fdatasync, I2SKI(ino)->ski_fd); + return syscall(SYSIO_SYS_fdatasync, I2SKI(ino)->ski_fd); } #ifdef HAVE_LUSTRE_HACK @@ -321,7 +326,7 @@ sockets_inop_ioctl(struct inode *ino, arg3 = va_arg(ap, long); arg4 = va_arg(ap, long); - return syscall(SYS_ioctl, I2SKI(ino)->ski_fd, request, + return syscall(SYSIO_SYS_ioctl, I2SKI(ino)->ski_fd, request, arg1, arg2, arg3, arg4); } #else @@ -399,12 +404,13 @@ socket(int domain, int type, int protoco } ski = I2SKI(ino); -#ifndef SYS_socketcall - ski->ski_fd = syscall(SYS_socket, domain, type, protocol); +#ifndef SYSIO_SYS_socketcall + ski->ski_fd = syscall(SYSIO_SYS_socket, domain, type, protocol); #else { unsigned long avec[3] = {domain, type, protocol}; - ski->ski_fd = syscall(SYS_socketcall, SYS_SOCKET, avec); + ski->ski_fd = + syscall(SYSIO_SYS_socketcall, SYS_SOCKET, avec); } #endif if (ski->ski_fd < 0) { @@ -469,16 +475,20 @@ accept(int s, struct sockaddr *addr, soc } ski = I2SKI(ino); -#ifndef SYS_socketcall - ski->ski_fd = syscall(SYS_accept, I2SKI(ofil->f_ino)->ski_fd, - addr, addrlen); +#ifndef SYSIO_SYS_socketcall + ski->ski_fd = + syscall(SYSIO_SYS_accept, + I2SKI(ofil->f_ino)->ski_fd, + addr, + addrlen); #else { unsigned long avec[3] = { (unsigned long) I2SKI(ofil->f_ino)->ski_fd, (unsigned long) addr, (unsigned long) addrlen}; - ski->ski_fd = syscall(SYS_socketcall, SYS_ACCEPT, avec); + ski->ski_fd = + syscall(SYSIO_SYS_socketcall, SYS_ACCEPT, avec); } #endif if (ski->ski_fd < 0) { @@ -521,13 +531,16 @@ bind(int sockfd, const struct sockaddr * goto out; } -#ifndef SYS_socketcall - if (syscall(SYS_bind, I2SKI(fil->f_ino)->ski_fd, my_addr, addrlen)) { +#ifndef SYSIO_SYS_socketcall + if (syscall(SYSIO_SYS_bind, + I2SKI(fil->f_ino)->ski_fd, + my_addr, + addrlen)) { #else avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )my_addr; avec[2] = addrlen; - if (syscall(SYS_socketcall, SYS_BIND, avec) != 0) { + if (syscall(SYSIO_SYS_socketcall, SYS_BIND, avec) != 0) { #endif err = -errno; goto out; @@ -554,12 +567,14 @@ listen(int s, int backlog) goto out; } -#ifndef SYS_socketcall - if (syscall(SYS_listen, I2SKI(fil->f_ino)->ski_fd, backlog) != 0) { +#ifndef SYSIO_SYS_socketcall + if (syscall(SYSIO_SYS_listen, + I2SKI(fil->f_ino)->ski_fd, + backlog) != 0) { #else avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = backlog; - if (syscall(SYS_socketcall, SYS_LISTEN, avec) != 0) { + if (syscall(SYSIO_SYS_socketcall, SYS_LISTEN, avec) != 0) { #endif err = -errno; goto out; @@ -586,14 +601,16 @@ connect(int sockfd, const struct sockadd goto out; } -#ifndef SYS_socketcall - if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, - serv_addr, addrlen) != 0) { +#ifndef SYSIO_SYS_socketcall + if (syscall(SYSIO_SYS_connect, + I2SKI(fil->f_ino)->ski_fd, + serv_addr, + addrlen) != 0) { #else avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )serv_addr; avec[2] = addrlen; - if (syscall(SYS_socketcall, SYS_CONNECT, avec) != 0) { + if (syscall(SYSIO_SYS_socketcall, SYS_CONNECT, avec) != 0) { #endif err = -errno; goto out; |
From: Lee W. <lw...@us...> - 2005-01-25 00:38:02
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22054/drivers/sockets Modified Files: sockets.c Log Message: Finish support for compile-time selection of external names. There were many alias directives that had not been modified to use SYSIO_INTERFACE_NAME. There were some calls that needed that macro applied. The include files needed some massaging. Particularly xtio.h. One big gotcha; In libsysio, xtio.h must now be included *after* sysio.h or it will redefine SYSIO_INTERFACE_NAME. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- sockets.c 14 Oct 2004 14:59:28 -0000 1.12 +++ sockets.c 25 Jan 2005 00:36:53 -0000 1.13 @@ -65,8 +65,8 @@ #include <sys/uio.h> #include <sys/queue.h> -#include "xtio.h" #include "sysio.h" +#include "xtio.h" #include "native.h" #include "fs.h" #include "inode.h" |
From: Lee W. <lw...@us...> - 2005-01-25 18:16:23
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23722 Modified Files: sockets.c Log Message: The previous check-in missed wrapping SYSIO_INTERFACE_NAME around the sockets calls. Got 'em now; socket, connect, bind, at al. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- sockets.c 25 Jan 2005 00:36:53 -0000 1.13 +++ sockets.c 25 Jan 2005 18:16:01 -0000 1.14 @@ -387,7 +387,7 @@ _sysio_sockets_inew() } int -socket(int domain, int type, int protocol) +SYSIO_INTERFACE_NAME(socket)(int domain, int type, int protocol) { int err; struct inode *ino; @@ -445,7 +445,7 @@ error: } int -accept(int s, struct sockaddr *addr, socklen_t *addrlen) +SYSIO_INTERFACE_NAME(accept)(int s, struct sockaddr *addr, socklen_t *addrlen) { int err; struct inode *ino; @@ -517,7 +517,9 @@ error: } int -bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) +SYSIO_INTERFACE_NAME(bind)(int sockfd, + const struct sockaddr *my_addr, + socklen_t addrlen) { int err; struct file *fil; @@ -553,7 +555,7 @@ out: } int -listen(int s, int backlog) +SYSIO_INTERFACE_NAME(listen)(int s, int backlog) { int err; struct file *fil; @@ -587,7 +589,9 @@ out: } int -connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) +SYSIO_INTERFACE_NAME(connect)(int sockfd, + const struct sockaddr *serv_addr, + socklen_t addrlen) { int err; struct file *fil; |
From: Lee W. <lw...@us...> - 2006-01-03 13:39:08
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12476/drivers/sockets Modified Files: sockets.c Log Message: Unsed variable warnings found by gcc 4.0.2 are fixed. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- sockets.c 25 Jan 2005 18:16:01 -0000 1.14 +++ sockets.c 3 Jan 2006 13:38:59 -0000 1.15 @@ -523,7 +523,9 @@ SYSIO_INTERFACE_NAME(bind)(int sockfd, { int err; struct file *fil; +#ifdef SYSIO_SYS_socketcall unsigned long avec[3]; +#endif err = 0; @@ -559,7 +561,9 @@ SYSIO_INTERFACE_NAME(listen)(int s, int { int err; struct file *fil; +#ifdef SYSIO_SYS_socketcall unsigned long avec[2]; +#endif err = 0; @@ -595,7 +599,9 @@ SYSIO_INTERFACE_NAME(connect)(int sockfd { int err; struct file *fil; +#ifdef SYSIO_SYS_socketcall unsigned long avec[3]; +#endif err = 0; |