Source-Changes-HG archive

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

[src/netbsd-9]: src/lib/libpthread Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/8a71a53deedd
branches:  netbsd-9
changeset: 988243:8a71a53deedd
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 05 11:02:18 2021 +0000

description:
Pull up following revision(s) (requested by christos in ticket #1355):

        lib/libpthread/pthread_cancelstub.c: revision 1.39
        lib/libc/sys/Makefile.inc: revision 1.247
        lib/libpthread/pthread_cancelstub.c: revision 1.40

PR/56424: Clay Mayers: recvfrom() is not a cancelation point as documented
in pthread_setcanceltype.3

remove parameter names from decls.

diffstat:

 lib/libc/sys/Makefile.inc           |   21 ++--
 lib/libpthread/pthread_cancelstub.c |  145 +++++++++++++++++++++++++++++++++++-
 2 files changed, 155 insertions(+), 11 deletions(-)

diffs (287 lines):

diff -r 54bdeb8f77f7 -r 8a71a53deedd lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Mon Oct 04 15:43:41 2021 +0000
+++ b/lib/libc/sys/Makefile.inc Tue Oct 05 11:02:18 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.240 2018/07/31 13:04:10 rjs Exp $
+#      $NetBSD: Makefile.inc,v 1.240.2.1 2021/10/05 11:02:18 martin Exp $
 #      @(#)Makefile.inc        8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -91,7 +91,7 @@
 # modules with default implementations on all architectures:
 ASM=   access.S acct.S \
        bind.S \
-       chdir.S chflags.S chmod.S chown.S chroot.S clock_nanosleep.S \
+       chdir.S chflags.S chmod.S chown.S chroot.S \
                clock_getcpuclockid2.S \
                __clock_getres50.S __clock_gettime50.S \
        dup.S dup2.S dup3.S \
@@ -129,15 +129,14 @@
                mprotect.S __msgctl50.S msgget.S munlock.S munlockall.S \
                munmap.S \
        nfssvc.S __ntp_gettime50.S \
-       openat.S \
        pathconf.S pipe2.S \
                __posix_chown.S __posix_fchown.S __posix_lchown.S \
                __posix_rename.S profil.S \
        __quotactl.S \
-       rasctl.S readlinkat.S reboot.S recvfrom.S recvmmsg.S recvmsg.S \
+       rasctl.S readlinkat.S reboot.S \
                rename.S renameat.S revoke.S rmdir.S \
        semconfig.S semget.S semop.S \
-               sendmmsg.S sendmsg.S sendto.S setegid.S seteuid.S \
+               setegid.S seteuid.S \
                setgid.S setgroups.S __setitimer50.S __setlogin.S setpgid.S \
                setpriority.S \
                setregid.S setreuid.S setrlimit.S setsid.S setsockopt.S \
@@ -166,15 +165,19 @@
 . endif
 .endfor
 
-WEAKASM= accept.S __aio_suspend50.S close.S connect.S execve.S \
+WEAKASM= accept.S __aio_suspend50.S clock_nanosleep.S close.S connect.S \
+       execve.S \
        fcntl.S fdatasync.S fsync.S \
        fsync_range.S __kevent50.S \
        kill.S mq_receive.S mq_send.S __mq_timedreceive50.S __mq_timedsend50.S \
-       msgrcv.S msgsnd.S __msync13.S  __nanosleep50.S open.S paccept.S poll.S \
+       msgrcv.S msgsnd.S __msync13.S  __nanosleep50.S open.S openat.S \
+       paccept.S poll.S \
        __pollts50.S __pselect50.S read.S readlink.S \
-       readv.S _sched_setparam.S _sched_getparam.S _sched_setaffinity.S \
+       readv.S recvfrom.S recvmmsg.S recvmsg.S \
+       _sched_setparam.S _sched_getparam.S _sched_setaffinity.S \
        _sched_getaffinity.S sched_yield.S _sched_protect.S \
-       __select50.S setcontext.S __sigprocmask14.S __sigsuspend14.S sysarch.S \
+       __select50.S sendmmsg.S sendmsg.S sendto.S \
+       setcontext.S __sigprocmask14.S __sigsuspend14.S sysarch.S \
        __wait450.S wait6.S write.S writev.S
 
 NOERR= getegid.S geteuid.S getgid.S getpid.S getppid.S getuid.S \
diff -r 54bdeb8f77f7 -r 8a71a53deedd lib/libpthread/pthread_cancelstub.c
--- a/lib/libpthread/pthread_cancelstub.c       Mon Oct 04 15:43:41 2021 +0000
+++ b/lib/libpthread/pthread_cancelstub.c       Tue Oct 05 11:02:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_cancelstub.c,v 1.38 2013/03/21 16:49:12 christos Exp $ */
+/*     $NetBSD: pthread_cancelstub.c,v 1.38.32.1 2021/10/05 11:02:18 martin Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #undef _FORTIFY_SOURCE
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_cancelstub.c,v 1.38 2013/03/21 16:49:12 christos Exp $");
+__RCSID("$NetBSD: pthread_cancelstub.c,v 1.38.32.1 2021/10/05 11:02:18 martin Exp $");
 
 #ifndef lint
 
@@ -90,6 +90,8 @@
            const struct timespec *);
 int    __aio_suspend50(const struct aiocb * const [], int,
            const struct timespec *);
+int    _sys_clock_nanosleep(clockid_t clock_id, int flags,
+                  const struct timespec *rqtp, struct timespec *rmtp);
 int    _sys_close(int);
 int    _sys_connect(int, const struct sockaddr *, socklen_t);
 int    _sys_fcntl(int, int, ...);
@@ -110,6 +112,7 @@
 int    _sys___nanosleep50(const struct timespec *, struct timespec *);
 int    __nanosleep50(const struct timespec *, struct timespec *);
 int    _sys_open(const char *, int, ...);
+int    _sys_openat(int, const char *, int, ...);
 int    _sys_poll(struct pollfd *, nfds_t, int);
 int    _sys___pollts50(struct pollfd *, nfds_t, const struct timespec *,
            const sigset_t *);
@@ -119,6 +122,15 @@
 ssize_t        _sys_pwrite(int, const void *, size_t, off_t);
 ssize_t        _sys_read(int, void *, size_t);
 ssize_t        _sys_readv(int, const struct iovec *, int);
+ssize_t        _sys_recvfrom(int, void * restrict, size_t, int,
+    struct sockaddr * restrict, socklen_t * restrict);
+ssize_t _sys_recvmsg(int, struct msghdr *, int);
+int _sys_recvmmsg(int, struct mmsghdr *, unsigned int, unsigned int,
+    struct timespec *);
+ssize_t _sys_sendto(int, const void *, size_t, int, const struct sockaddr *,
+    socklen_t);
+ssize_t _sys_sendmsg(int, const struct msghdr *, int);
+int _sys_sendmmsg(int, struct mmsghdr *, unsigned int, unsigned int);
 int    _sys___select50(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 int    _sys___wait450(pid_t, int *, int, struct rusage *);
 ssize_t        _sys_write(int, const void *, size_t);
@@ -180,6 +192,21 @@
 }
 
 int
+clock_nanosleep(clockid_t clock_id, int flags,
+    const struct timespec *rqtp, struct timespec *rmtp)
+{
+       int retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_clock_nanosleep(clock_id, flags, rqtp, rmtp);
+       TESTCANCEL(self);
+       
+       return retval;
+}
+
+int
 close(int d)
 {
        int retval;
@@ -384,6 +411,23 @@
 }
 
 int
+openat(int fd, const char *path, int flags, ...)
+{
+       int retval;
+       pthread_t self;
+       va_list ap;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       va_start(ap, flags);
+       retval = _sys_openat(fd, path, flags, va_arg(ap, mode_t));
+       va_end(ap);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
+int
 __nanosleep50(const struct timespec *rqtp, struct timespec *rmtp)
 {
        int retval;
@@ -502,6 +546,50 @@
        return retval;
 }
 
+ssize_t
+recvfrom(int s, void * restrict buf, size_t len, int flags,
+    struct sockaddr * restrict from, socklen_t * restrict fromlen)
+{
+       ssize_t retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_recvfrom(s, buf, len, flags, from, fromlen);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
+ssize_t
+recvmsg(int s, struct msghdr *msg, int flags)
+{
+       ssize_t retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_recvmsg(s, msg, flags);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
+int
+recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen,
+    unsigned int flags, struct timespec *timeout)
+{
+       ssize_t retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_recvmmsg(s, mmsg, vlen, flags, timeout);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
 int
 __select50(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, 
     struct timeval *timeout)
@@ -517,6 +605,51 @@
        return retval;
 }
 
+ssize_t
+sendto(int s, const void *msg, size_t len, int flags,
+    const struct sockaddr *to, socklen_t tolen)
+{
+       int retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_sendto(s, msg, len, flags, to, tolen);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
+ssize_t
+sendmsg(int s, const struct msghdr *msg, int flags)
+{
+       int retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_sendmsg(s, msg, flags);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
+int
+sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen,
+    unsigned int flags)
+{
+       int retval;
+       pthread_t self;
+
+       self = pthread__self();
+       TESTCANCEL(self);
+       retval = _sys_sendmmsg(s, mmsg, vlen, flags);
+       TESTCANCEL(self);
+
+       return retval;
+}
+
+
 pid_t
 __wait450(pid_t wpid, int *status, int options, struct rusage *rusage)
 {
@@ -618,6 +751,7 @@
 }
 
 __strong_alias(_close, close)
+__strong_alias(_clock_nanosleep, clock_nanosleep)
 __strong_alias(_fcntl, fcntl)
 __strong_alias(_fdatasync, fdatasync)
 __strong_alias(_fsync, fsync)
@@ -629,11 +763,18 @@
 __strong_alias(___msync13, __msync13)
 __strong_alias(___nanosleep50, __nanosleep50)
 __strong_alias(_open, open)
+__strong_alias(_openat, openat)
 __strong_alias(_poll, poll)
 __strong_alias(_pread, pread)
 __strong_alias(_pwrite, pwrite)
 __strong_alias(_read, read)
 __strong_alias(_readv, readv)
+__strong_alias(_recvfrom, recvfrom)
+__strong_alias(_recvmsg, recvmsg)
+__strong_alias(_recvmmsg, recvmmsg)
+__strong_alias(_sendmsg, sendmsg)
+__strong_alias(_sendmmsg, sendmmsg)
+__strong_alias(_sendto, sendto)
 __strong_alias(_sigwait, sigwait)
 __strong_alias(_write, write)
 __strong_alias(_writev, writev)



Home | Main Index | Thread Index | Old Index