Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys Build syscalls stubs for pselect and pollts. U...



details:   https://anonhg.NetBSD.org/src/rev/70f471ba3a0e
branches:  trunk
changeset: 574316:70f471ba3a0e
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Feb 26 18:04:19 2005 +0000

description:
Build syscalls stubs for pselect and pollts.  Update man pages.

diffstat:

 lib/libc/sys/Makefile.inc |   7 +++++--
 lib/libc/sys/poll.2       |  33 +++++++++++++++++++++++++++++++--
 lib/libc/sys/select.2     |  29 ++++++++++++++++++++++++-----
 3 files changed, 60 insertions(+), 9 deletions(-)

diffs (160 lines):

diff -r ffe9d19dbe24 -r 70f471ba3a0e lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Sat Feb 26 18:03:37 2005 +0000
+++ b/lib/libc/sys/Makefile.inc Sat Feb 26 18:04:19 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.155 2005/02/25 21:51:10 matt Exp $
+#      $NetBSD: Makefile.inc,v 1.156 2005/02/26 18:04:19 matt Exp $
 #      @(#)Makefile.inc        8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -73,8 +73,9 @@
                mlock.S mlockall.S mount.S mprotect.S __msgctl13.S msgget.S \
                munlock.S munlockall.S munmap.S \
        nfssvc.S ntp_gettime.S \
-       pathconf.S pmc_get_info.S pmc_control.S __posix_chown.S \
+       pathconf.S pmc_get_info.S pmc_control.S pollts.S __posix_chown.S \
                __posix_fchown.S __posix_lchown.S __posix_rename.S profil.S \
+               pselect.S \
        quotactl.S \
        rasctl.S readlink.S reboot.S recvfrom.S recvmsg.S rename.S revoke.S \
                rmdir.S \
@@ -223,8 +224,10 @@
 MLINKS+=ntp_adjtime.2 ntp_gettime.2
 MLINKS+=pathconf.2 fpathconf.2
 MLINKS+=pmc_control.2 pmc_get_info.2
+MLINKS+=poll.2 pollts.2
 MLINKS+=read.2 readv.2 read.2 pread.2 read.2 preadv.2
 MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2
+MLINKS+=select.2 pselect.2
 MLINKS+=send.2 sendmsg.2 send.2 sendto.2
 MLINKS+=setpgid.2 setpgrp.2
 MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2
diff -r ffe9d19dbe24 -r 70f471ba3a0e lib/libc/sys/poll.2
--- a/lib/libc/sys/poll.2       Sat Feb 26 18:03:37 2005 +0000
+++ b/lib/libc/sys/poll.2       Sat Feb 26 18:04:19 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: poll.2,v 1.18 2004/05/13 10:20:58 wiz Exp $
+.\"    $NetBSD: poll.2,v 1.19 2005/02/26 18:04:19 matt Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -47,9 +47,13 @@
 .In poll.h
 .Ft int
 .Fn poll "struct pollfd *fds" "nfds_t nfds" "int timeout"
+.Ft int
+.Fn pollts "struct pollfd *fds" "nfds_t nfds" "const struct timespec *ts" "const sigset_t *sigmask"
 .Sh DESCRIPTION
 .Fn poll
-examines a set of file descriptors to see if some of them are ready for
+and
+.Fn pollts
+examine a set of file descriptors to see if some of them are ready for
 I/O.
 The
 .Fa fds
@@ -151,6 +155,31 @@
 is zero, then
 .Fn poll
 will return without blocking.
+.Pp
+If
+.Fa ts
+is a non-nil pointer, it references a timespec structure which specifies a
+maximum interval to wait for any file descriptor to become ready.
+If
+.Fa ts
+is a nil pointer,
+.Fn pollts
+blocks indefinitely.
+If
+.Fa ts
+is a non-nil pointer, referencing a zero-valued timespec structure, then
+.Fn pollts
+will return without blocking.
+.Pp
+If
+.Fa sigmask
+is a non-nil pointer, then the
+.Fn pollts
+function shall replace the signal mask of the caller by the set of
+signals pointed to by
+.Fa sigmask
+before examining the descriptors, and shall restore the signal mask
+of the caller before returning.
 .Sh RETURN VALUES
 .Fn poll
 returns the number of descriptors that are ready for I/O, or \-1 if an
diff -r ffe9d19dbe24 -r 70f471ba3a0e lib/libc/sys/select.2
--- a/lib/libc/sys/select.2     Sat Feb 26 18:03:37 2005 +0000
+++ b/lib/libc/sys/select.2     Sat Feb 26 18:04:19 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: select.2,v 1.23 2004/05/13 10:20:58 wiz Exp $
+.\"    $NetBSD: select.2,v 1.24 2005/02/26 18:04:19 matt Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -43,13 +43,17 @@
 .In unistd.h
 .Ft int
 .Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "struct timeval *timeout"
+.Ft int
+.Fn pselect "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "const struct timespec *timeout" "const sigset_t *sigmask"
 .Fn FD_SET fd \*[Am]fdset
 .Fn FD_CLR fd \*[Am]fdset
 .Fn FD_ISSET fd \*[Am]fdset
 .Fn FD_ZERO \*[Am]fdset
 .Sh DESCRIPTION
 .Fn select
-examines the I/O descriptor sets whose addresses are passed in
+and
+.Fn pselect
+examine the I/O descriptor sets whose addresses are passed in
 .Fa readfds ,
 .Fa writefds ,
 and
@@ -65,11 +69,15 @@
 in the descriptor sets are examined.
 On return,
 .Fn select
-replaces the given descriptor sets
+and
+.Fn pselect
+replace the given descriptor sets
 with subsets consisting of those descriptors that are ready
 for the requested operation.
 .Fn select
-returns the total number of ready descriptors in all the sets.
+and
+.Fn pselect
+return the total number of ready descriptors in all the sets.
 .Pp
 The descriptor sets are stored as bit fields in arrays of integers.
 The following macros are provided for manipulating such descriptor sets:
@@ -108,7 +116,8 @@
 is a nil pointer, the select blocks indefinitely.
 To affect a poll, the
 .Fa timeout
-argument should be non-nil, pointing to a zero-valued timeval structure.
+argument should be non-nil, pointing to a zero-valued timeval or timespec
+structure, as appropriate.
 .Fa timeout
 is not changed by
 .Fn select ,
@@ -116,6 +125,16 @@
 re-initialize it before each invocation of
 .Fn select .
 .Pp
+If
+.Fa sigmask
+is a non-nil pointer, then the
+.Fn pselect
+function shall replace the signal mask of the caller by the set of
+signals pointed to by
+.Fa sigmask
+before examining the descriptors, and shall restore the signal mask
+of the calling thread before returning.
+.Pp
 Any of
 .Fa readfds ,
 .Fa writefds ,



Home | Main Index | Thread Index | Old Index