Index: linux/libc/ChangeLog diff -c linux/libc/ChangeLog:1.176 linux/libc/ChangeLog:1.177 *** linux/libc/ChangeLog:1.176 Sat May 3 16:01:15 1997 --- linux/libc/ChangeLog Sat May 10 14:44:33 1997 *************** *** 1,3 **** --- 1,41 ---- + Sat May 10 14:39:26 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * version 5.4.28 is released. + + * <_G_config.h>: change version to 5.4.28. + + * elf/libc/jump.params: set version to 5.4.28. + + * release.libc: update. + + Fri May 8 08:13:09 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * (poll): added the system call number. + + * : new file from glibc 2. + + * sysdeps/linux/Makefile (SRC1S): add poll.c. + (SRC2S): add __syscall_poll.S. + + * sysdeps/linux/__flock.c: save errno. + + * sysdeps/linux/poll.c: new from glibc 2. + + * sysdeps/linux/__syscall_poll.S: new. + + Mon May 5 08:23:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * nys/nsw/src/nis/nis_group.c (parse_result): call + xstrdup () for add_member (). Reported by Jason Mcmullan + . + + Sun May 4 08:50:33 1997 Thorsten Kukuk + + * nys/nsw/src/nis/nis_hosts.c : + * nys/nsw/src/nis/nis_publickey.c: fixes some wrong return + codes in error cases and checks for NULL pointer + dereferencing. + Sat May 3 16:00:00 1997 H.J. Lu (hjl@gnu.ai.mit.edu) * version 5.4.27 is released. Index: linux/libc/release.libc diff -c linux/libc/release.libc:1.44 linux/libc/release.libc:1.45 *** linux/libc/release.libc:1.44 Sat May 3 16:08:44 1997 --- linux/libc/release.libc Sat May 10 14:44:33 1997 *************** *** 1,14 **** Hi, Gals and Guys, ! I would like to release libc 5.4.27 to public in a day or 2. But I was told libc 5.4.26 doesn't work with shadow-970211. I couldn't ! reproduce the problem. I'd like to hear the results of libc 5.4.27 ! and shadow-970211 before I release 5.4.27 to public. Thanks. glibc's putenv () was used in libc 5.4.23 which breaks many TeX binaries. You have to re-compile them with -DSMART_PUTENV. Otherwise they won't work. Please see kpathsea/xputenv.c in those packages for ! details. I backed this change out in libc 5.4.27. I have modified the NIS support in libc, which is not compatible with the previous version, but is compatible with SunOS, Solaris, ... --- 1,19 ---- Hi, Gals and Guys, ! I would like to release libc 5.4.28 to public in a day or 2. But I was told libc 5.4.26 doesn't work with shadow-970211. I couldn't ! reproduce the problem. I'd like to hear the results of libc 5.4.28 ! and shadow-970211 before I release 5.4.28 to public. Thanks. ! ! The NYS bug is suppposed to be fixed. If a service is not available, ! the some NIS/NIS+ routines will give back a NULL pointer, but the ! other functions expect a struct with the error code. Please check ! it out. glibc's putenv () was used in libc 5.4.23 which breaks many TeX binaries. You have to re-compile them with -DSMART_PUTENV. Otherwise they won't work. Please see kpathsea/xputenv.c in those packages for ! details. I backed this change out in libc 5.4.28. I have modified the NIS support in libc, which is not compatible with the previous version, but is compatible with SunOS, Solaris, ... *************** *** 19,29 **** you may need a patch. Please send me a note and I will fix it for you as soon as possible. - There is a NYS bug. If a service is not available, the some NIS/NIS+ - routines will give back a NULL pointer, but the other functions expect a - struct with the error code. The easiest way to fix it is to remove the - services (nis, yp, ...) which are not available on your machine. - Binaries of locale and localedef are included in the binary release. I added the support for larger PATH_MAX in linux 2.1.x. The old binaries --- 24,29 ---- *************** *** 34,53 **** so that the old XFree86 binaries will run fine with the new XFree86 shared librraries compiled with libc 6.x/glibc 2.x. ! If you use linux 2.1.x, you need libc 5.4.27 or above to compile libc yourself. The pre-compiled libc should run fine under linux 2.1.x. Also this library is compiled with -D_REENTRANT so that errno is MT safe. The shared libraries are now compiled with -g1 which can provide minimum information when core dump happens. You can strip ! libc.so.5.4.27 if you want. ! Due to the new, improved locale, the Linux C library 5.4.27 is binary compatible with libc 5.3.12 but not vice versa. The binaries ! compiled/linked with libc.so.5.4.27 may not run with libc.so.5.3.12. You may need to regenerate locale files for the new locale in libc ! 5.4.27 if you use locales other tha C/POSIX which are the defaults. The locale sources are at --- 34,53 ---- so that the old XFree86 binaries will run fine with the new XFree86 shared librraries compiled with libc 6.x/glibc 2.x. ! If you use linux 2.1.x, you need libc 5.4.28 or above to compile libc yourself. The pre-compiled libc should run fine under linux 2.1.x. Also this library is compiled with -D_REENTRANT so that errno is MT safe. The shared libraries are now compiled with -g1 which can provide minimum information when core dump happens. You can strip ! libc.so.5.4.28 if you want. ! Due to the new, improved locale, the Linux C library 5.4.28 is binary compatible with libc 5.3.12 but not vice versa. The binaries ! compiled/linked with libc.so.5.4.28 may not run with libc.so.5.3.12. You may need to regenerate locale files for the new locale in libc ! 5.4.28 if you use locales other tha C/POSIX which are the defaults. The locale sources are at *************** *** 56,62 **** There are many security bug fixes. Please consult ChangeLog for details. Please let me know if there are more security bugs remains. ! This is the beta release of the Linux C library 5.4.27. Please read the ChangeLog for details regarding changes/bug fixes. DISTRIBUTION SITES: --- 56,62 ---- There are many security bug fixes. Please consult ChangeLog for details. Please let me know if there are more security bugs remains. ! This is the beta release of the Linux C library 5.4.28. Please read the ChangeLog for details regarding changes/bug fixes. DISTRIBUTION SITES: *************** *** 77,87 **** DISTRIBUTION FILES: ! 1. libc-5.4.27.bin.tar.gz REQUIRED. This package contains the header files for libc, shared and static ELF libraries libc and libm, and the static ELF library libbsd.a. ! The header files in libc-5.4.27.bin.tar.gz are not complete. You need to install the kernel source tree for the system-dependent header files. The header files are in lib-x.y.z.bin.tar.gz and libc-x.y.z.tar.gz. You --- 77,87 ---- DISTRIBUTION FILES: ! 1. libc-5.4.28.bin.tar.gz REQUIRED. This package contains the header files for libc, shared and static ELF libraries libc and libm, and the static ELF library libbsd.a. ! The header files in libc-5.4.28.bin.tar.gz are not complete. You need to install the kernel source tree for the system-dependent header files. The header files are in lib-x.y.z.bin.tar.gz and libc-x.y.z.tar.gz. You *************** *** 92,102 **** to extract the header files without the binaries files. A separate tar file for the header files may cause unnecessary confusion. ! 2. libc-5.4.27.tar.gz Source tree for libc and header files. ! 3. libc-5.4.26-5.4.27.diff.gz Context diffs against the source tree from the previous libc release. Please make sure the empty libc/regex/rx.h is deleted. --- 92,102 ---- to extract the header files without the binaries files. A separate tar file for the header files may cause unnecessary confusion. ! 2. libc-5.4.28.tar.gz Source tree for libc and header files. ! 3. libc-5.4.27-5.4.28.diff.gz Context diffs against the source tree from the previous libc release. Please make sure the empty libc/regex/rx.h is deleted. *************** *** 167,173 **** rm -f /usr/include/wcstr.h /usr/include/mbstr.h rm -f /usr/include/ld_so_config.h /usr/include/localeinfo.h rm -rf /usr/include/netinet /usr/include/net /usr/include/pthread ! gzip -dc libc-5.4.27.bin.tar.gz | tar xvf - SOURCE INSTALLATION: --- 167,173 ---- rm -f /usr/include/wcstr.h /usr/include/mbstr.h rm -f /usr/include/ld_so_config.h /usr/include/localeinfo.h rm -rf /usr/include/netinet /usr/include/net /usr/include/pthread ! gzip -dc libc-5.4.28.bin.tar.gz | tar xvf - SOURCE INSTALLATION: *************** *** 233,236 **** H.J. hjl@gnu.ai.mit.edu ! 05/03/97 --- 233,236 ---- H.J. hjl@gnu.ai.mit.edu ! 05/10/97 Index: linux/libc/elf/libc/jump.params diff -c linux/libc/elf/libc/jump.params:1.80 linux/libc/elf/libc/jump.params:1.81 *** linux/libc/elf/libc/jump.params:1.80 Sat May 3 16:01:17 1997 --- linux/libc/elf/libc/jump.params Sat May 10 14:44:34 1997 *************** *** 1 **** ! Version=5.4.27 --- 1 ---- ! Version=5.4.28 Index: linux/libc/nys/nsw/src/nis/nis_group.c diff -c linux/libc/nys/nsw/src/nis/nis_group.c:1.1 linux/libc/nys/nsw/src/nis/nis_group.c:1.2 *** linux/libc/nys/nsw/src/nis/nis_group.c:1.1 Wed Mar 15 19:04:25 1995 --- linux/libc/nys/nsw/src/nis/nis_group.c Sat May 10 14:44:36 1997 *************** *** 83,90 **** static struct group *parse_result(nis_result *res) { static struct group grp; ! static char *sp = NULL; ! char *cp; if (res == NULL) --- 83,89 ---- static struct group *parse_result(nis_result *res) { static struct group grp; ! char *cp, *sp; if (res == NULL) *************** *** 127,146 **** grp.gr_passwd = xstrdup(NISENTRYCOL(0, 1, res)); grp.gr_gid = atoi(NISENTRYCOL(0, 2, res)); ! if (sp) ! free(sp); ! ! sp = xstrdup(NISENTRYCOL(0, 3, res)); while ((cp = strchr(sp, ',')) != NULL) { *cp++ = '\0'; ! if (add_member(&grp, sp) < 0) return NULL; sp = cp; } ! if (add_member(&grp, sp) < 0) return NULL; return &grp; --- 126,142 ---- grp.gr_passwd = xstrdup(NISENTRYCOL(0, 1, res)); grp.gr_gid = atoi(NISENTRYCOL(0, 2, res)); ! sp = NISENTRYCOL(0, 3, res); while ((cp = strchr(sp, ',')) != NULL) { *cp++ = '\0'; ! if (add_member(&grp, xstrdup (sp)) < 0) return NULL; sp = cp; } ! if (add_member(&grp, xstrdup (sp)) < 0) return NULL; return &grp; Index: linux/libc/nys/nsw/src/nis/nis_hosts.c diff -c linux/libc/nys/nsw/src/nis/nis_hosts.c:1.4 linux/libc/nys/nsw/src/nis/nis_hosts.c:1.5 *** linux/libc/nys/nsw/src/nis/nis_hosts.c:1.4 Sun Nov 3 02:51:31 1996 --- linux/libc/nys/nsw/src/nis/nis_hosts.c Sat May 10 14:44:36 1997 *************** *** 140,158 **** { nis_result *res; char buf[81]; ! if (name == NULL || strlen(name) > 8) return NULL; ! /* ** Search at first in the alias list, and use the correct name ** for the next search */ sprintf(buf, "[name=%s],hosts.org_dir", name); res = nis_list(buf, EXPAND_NAME, NULL, NULL); ! /* ! ** If we do not find it, try it as original name. But if the ** database is correct, we should find it in the first case, too */ if ((res->status != NIS_SUCCESS && --- 140,160 ---- { nis_result *res; char buf[81]; ! if (name == NULL || strlen(name) > 8) return NULL; ! /* ** Search at first in the alias list, and use the correct name ** for the next search */ sprintf(buf, "[name=%s],hosts.org_dir", name); res = nis_list(buf, EXPAND_NAME, NULL, NULL); ! if (res == NULL) ! return NULL; ! /* ! ** If we do not find it, try it as original name. But if the ** database is correct, we should find it in the first case, too */ if ((res->status != NIS_SUCCESS && *************** *** 164,172 **** sprintf(buf, "[cname=%s],hosts.org_dir", name); else sprintf(buf, "[cname=%s],hosts.org_dir", NISENTRYCOL(0, 0, res)); ! res = nis_list(buf, EXPAND_NAME, NULL, NULL); ! return parse_result(res); } --- 166,174 ---- sprintf(buf, "[cname=%s],hosts.org_dir", name); else sprintf(buf, "[cname=%s],hosts.org_dir", NISENTRYCOL(0, 0, res)); ! res = nis_list(buf, EXPAND_NAME, NULL, NULL); ! return parse_result(res); } *************** *** 176,185 **** { nis_result *res; char buf[81]; ! sprintf(buf, "[addr=%s],hosts.org_dir", addr); ! res = nis_list(buf, EXPAND_NAME, NULL, NULL); return parse_result(res); } --- 178,188 ---- { nis_result *res; char buf[81]; ! sprintf(buf, "[addr=%s],hosts.org_dir", addr); ! res = nis_list(buf, EXPAND_NAME, NULL, NULL); + return parse_result(res); } Index: linux/libc/nys/nsw/src/nis/nis_publickey.c diff -c linux/libc/nys/nsw/src/nis/nis_publickey.c:1.2 linux/libc/nys/nsw/src/nis/nis_publickey.c:1.3 *** linux/libc/nys/nsw/src/nis/nis_publickey.c:1.2 Sun Nov 3 02:51:31 1996 --- linux/libc/nys/nsw/src/nis/nis_publickey.c Sat May 10 14:44:37 1997 *************** *** 43,48 **** --- 43,50 ---- char buf[NIS_MAXNAMELEN+1]; char *p; + publickey[0] = '\0'; + domain = strchr(netname, '@'); if (!domain) return (0); *************** *** 58,63 **** --- 60,68 ---- res = nis_list(buf, EXPAND_NAME, NULL, NULL); + if (res == NULL) + return 0; + switch (res->status) { case NIS_SUCCESS: case NIS_S_SUCCESS: *************** *** 94,99 **** --- 99,106 ---- int len; char buf[NIS_MAXNAMELEN+1]; + secretkey[0] = '\0'; + domain = strchr(netname, '@'); if (!domain) return (0); *************** *** 109,114 **** --- 116,123 ---- res = nis_list(buf, USE_DGRAM+NO_AUTHINFO+FOLLOW_LINKS+FOLLOW_PATH, NULL, NULL); + if (res == NULL) + return 0; switch (res->status) { case NIS_SUCCESS: case NIS_S_SUCCESS: Index: linux/libc/sysdeps/linux/Makefile diff -c linux/libc/sysdeps/linux/Makefile:1.22 linux/libc/sysdeps/linux/Makefile:1.23 *** linux/libc/sysdeps/linux/Makefile:1.22 Sun Jan 26 22:33:22 1997 --- linux/libc/sysdeps/linux/Makefile Sat May 10 14:44:38 1997 *************** *** 43,49 **** opendir.c rewinddir.c seekdir.c telldir.c morecore.c \ __getdirentries.c ttyname.c ttyname_r.c getcwd.c \ ftw.c glob.c sendmsg.c recvmsg.c readv.c writev.c scandir.c \ ! sysctl.c kernel_version.c SRC2S= __access.S __chdir.S __chmod.S __chown.S __close.S __dup.S \ __dup2.S __execve.S __fchmod.S __fchdir.S __fchown.S __fcntl.S \ __fork.S __fstatfs.S __getegid.S __geteuid.S \ --- 43,49 ---- opendir.c rewinddir.c seekdir.c telldir.c morecore.c \ __getdirentries.c ttyname.c ttyname_r.c getcwd.c \ ftw.c glob.c sendmsg.c recvmsg.c readv.c writev.c scandir.c \ ! sysctl.c kernel_version.c poll.c SRC2S= __access.S __chdir.S __chmod.S __chown.S __close.S __dup.S \ __dup2.S __execve.S __fchmod.S __fchdir.S __fchown.S __fcntl.S \ __fork.S __fstatfs.S __getegid.S __geteuid.S \ *************** *** 70,76 **** sched_setparam.S sched_getparam.S sched_setscheduler.S \ sched_getscheduler.S sched_yield.S sched_get_priority_max.S \ sched_get_priority_min.S sched_rr_get_interval.S fdatasync.S \ ! nanosleep.S SRC3S= fstatfs.c statfs.c uname.c __vfork.c vfork.c SRCS=$(SRC1S) $(SRC2S) $(SRC3S) --- 70,76 ---- sched_setparam.S sched_getparam.S sched_setscheduler.S \ sched_getscheduler.S sched_yield.S sched_get_priority_max.S \ sched_get_priority_min.S sched_rr_get_interval.S fdatasync.S \ ! nanosleep.S __syscall_poll.S SRC3S= fstatfs.c statfs.c uname.c __vfork.c vfork.c SRCS=$(SRC1S) $(SRC2S) $(SRC3S) Index: linux/libc/sysdeps/linux/__flock.c diff -c linux/libc/sysdeps/linux/__flock.c:1.4 linux/libc/sysdeps/linux/__flock.c:1.5 *** linux/libc/sysdeps/linux/__flock.c:1.4 Fri Oct 4 15:53:26 1996 --- linux/libc/sysdeps/linux/__flock.c Sat May 10 14:44:38 1997 *************** *** 32,44 **** int cmd; #ifdef __linux__ /* We try the system call first. */ cmd = __syscall_flock (fd, operation); if (cmd == 0 || (cmd < 0 && errno != ENOSYS)) { return cmd; } ! errno = 0; #endif switch (operation & ~LOCK_NB) { --- 32,45 ---- int cmd; #ifdef __linux__ + int errno_saved = errno; /* We try the system call first. */ cmd = __syscall_flock (fd, operation); if (cmd == 0 || (cmd < 0 && errno != ENOSYS)) { return cmd; } ! errno = errno_saved; #endif switch (operation & ~LOCK_NB) { Index: linux/libc/sysdeps/linux/__syscall_poll.S diff -c /dev/null linux/libc/sysdeps/linux/__syscall_poll.S:1.1 *** /dev/null Sat May 10 14:56:57 1997 --- linux/libc/sysdeps/linux/__syscall_poll.S Sat May 10 14:44:38 1997 *************** *** 0 **** --- 1,22 ---- + /* Copyright (C) 1991, 1992 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., 675 Mass Ave, + Cambridge, MA 02139, USA. */ + + #include + + SYSCALL__ (syscall_poll, 3) + ret Index: linux/libc/sysdeps/linux/poll.c diff -c /dev/null linux/libc/sysdeps/linux/poll.c:1.1 *** /dev/null Sat May 10 14:57:00 1997 --- linux/libc/sysdeps/linux/poll.c Sat May 10 14:44:39 1997 *************** *** 0 **** --- 1,98 ---- + /* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include + #include + #include + #include + #include + + extern int __syscall_poll __P ((struct pollfd *fds, unsigned int nfds, + int timeout)); + + /* Poll the file descriptors described by the NFDS structures starting at + FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for + an event to occur; if TIMEOUT is -1, block until an event occurs. + Returns the number of file descriptors with events, zero if timed out, + or -1 for errors. */ + + int + poll (fds, nfds, timeout) + struct pollfd *fds; + unsigned long int nfds; + int timeout; + { + struct timeval tv; + fd_set rset, wset, xset; + struct pollfd *f; + int ready; + int maxfd = 0; + static int must_emulate = 0; + + if (!must_emulate) + { + int errno_saved = errno; + + ready = __syscall_poll (fds, nfds, timeout); + + if (ready >= 0 || errno != ENOSYS) + return ready; + + must_emulate = 1; + errno = errno_saved; + } + + FD_ZERO (&rset); + FD_ZERO (&wset); + FD_ZERO (&xset); + + for (f = fds; f < &fds[nfds]; ++f) + if (f->fd >= 0) + { + if (f->events & POLLIN) + FD_SET (f->fd, &rset); + if (f->events & POLLOUT) + FD_SET (f->fd, &wset); + if (f->events & POLLPRI) + FD_SET (f->fd, &xset); + if (f->fd > maxfd && (f->events & (POLLIN|POLLOUT|POLLPRI))) + maxfd = f->fd; + } + + tv.tv_sec = timeout / 1000; + tv.tv_usec = (timeout % 1000) * 1000; + + ready = __select (maxfd + 1, &rset, &wset, &xset, + timeout == -1 ? NULL : &tv); + if (ready > 0) + for (f = fds; f < &fds[nfds]; ++f) + { + f->revents = 0; + if (f->fd >= 0) + { + if (FD_ISSET (f->fd, &rset)) + f->revents |= POLLIN; + if (FD_ISSET (f->fd, &wset)) + f->revents |= POLLOUT; + if (FD_ISSET (f->fd, &xset)) + f->revents |= POLLPRI; + } + } + + return ready; + } Index: linux/include/_G_config.h diff -c linux/include/_G_config.h:1.86 linux/include/_G_config.h:1.87 *** linux/include/_G_config.h:1.86 Sat May 3 16:02:52 1997 --- linux/include/_G_config.h Sat May 10 14:40:31 1997 *************** *** 2,11 **** #ifndef _G_config_h #define _G_config_h ! #define _LINUX_C_LIB_VERSION "5.4.27" #define _LINUX_C_LIB_VERSION_MAJOR 5 #define _LINUX_C_LIB_VERSION_MINOR 4 ! #define _LINUX_C_LIB_VERSION_SUBMINOR 27 #define _G_LIB_VERSION "2.7.2" --- 2,11 ---- #ifndef _G_config_h #define _G_config_h ! #define _LINUX_C_LIB_VERSION "5.4.28" #define _LINUX_C_LIB_VERSION_MAJOR 5 #define _LINUX_C_LIB_VERSION_MINOR 4 ! #define _LINUX_C_LIB_VERSION_SUBMINOR 28 #define _G_LIB_VERSION "2.7.2" Index: linux/include/sys/poll.h diff -c /dev/null linux/include/sys/poll.h:1.1 *** /dev/null Sat May 10 14:57:24 1997 --- linux/include/sys/poll.h Sat May 10 14:40:32 1997 *************** *** 0 **** --- 1,67 ---- + /* Compatibility definitions for System V `poll' interface. + Copyright (C) 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #ifndef _SYS_POLL_H + + #define _SYS_POLL_H 1 + #include + + __BEGIN_DECLS + + /* Data structure describing a polling request. */ + struct pollfd + { + int fd; /* File descriptor to poll. */ + short int events; /* Types of events poller cares about. */ + short int revents; /* Types of events that actually occurred. */ + }; + + /* Event types that can be polled for. These bits may be set in `events' + to indicate the interesting event types; they will appear in `revents' + to indicate the status of the file descriptor. */ + #define POLLIN 01 /* There is data to read. */ + #define POLLPRI 02 /* There is urgent data to read. */ + #define POLLOUT 04 /* Writing now will not block. */ + + /* Some aliases. */ + #define POLLWRNORM POLLOUT + + /* Event types always implicitly polled for. These bits need not be set in + `events', but they will appear in `revents' to indicate the status of + the file descriptor. */ + #define POLLERR 010 /* Error condition. */ + #define POLLHUP 020 /* Hung up. */ + #define POLLNVAL 040 /* Invalid polling request. */ + + /* Canonical number of polling requests to read in at a time in poll. */ + #define NPOLLFILE 30 + + + /* Poll the file descriptors described by the NFDS structures starting at + FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for + an event to occur; if TIMEOUT is -1, block until an event occurs. + Returns the number of file descriptors with events, zero if timed out, + or -1 for errors. */ + + extern int poll __P ((struct pollfd *__fds, unsigned long int __nfds, + int __timeout)); + + __END_DECLS + + #endif /* _SYS_POLL_H */ Index: linux/include/sys/syscall.h diff -c linux/include/sys/syscall.h:1.10 linux/include/sys/syscall.h:1.11 *** linux/include/sys/syscall.h:1.10 Sun Jan 26 22:29:08 1997 --- linux/include/sys/syscall.h Sat May 10 14:40:32 1997 *************** *** 145,156 **** #define SYS_getdents 141 #define SYS__newselect 142 #define SYS_flock 143 ! #define SYS_syscall_flock 143 #define SYS_msync 144 #define SYS_readv 145 ! #define SYS_syscall_readv 145 #define SYS_writev 146 ! #define SYS_syscall_writev 146 #define SYS_getsid 147 #define SYS_fdatasync 148 #define SYS__sysctl 149 --- 145,156 ---- #define SYS_getdents 141 #define SYS__newselect 142 #define SYS_flock 143 ! #define SYS_syscall_flock SYS_flock #define SYS_msync 144 #define SYS_readv 145 ! #define SYS_syscall_readv SYS_readv #define SYS_writev 146 ! #define SYS_syscall_writev SYS_writev #define SYS_getsid 147 #define SYS_fdatasync 148 #define SYS__sysctl 149 *************** *** 172,176 **** --- 172,178 ---- #define SYS_getresuid 165 #define SYS_vm86 166 #define SYS_query_module 167 + #define SYS_poll 168 + #define SYS_syscall_poll SYS_poll #endif /* */