]> Cypherpunks repositories - gostls13.git/commitdiff
os, syscall: use wait6 to avoid wait/kill race on netbsd
authorTobias Klauser <tklauser@distanz.ch>
Sun, 2 May 2021 11:22:48 +0000 (13:22 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 4 May 2021 12:44:42 +0000 (12:44 +0000)
Follow CL 23967 and CL 24021 which did the same on linux and freebsd,
respectively.

Updates #13987
Updates #16028

Change-Id: I95b13d8ddde4cea1ef4fb7d655f1ad1a219d13aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/315281
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/wait_unimp.go
src/os/wait_wait6.go
src/syscall/zerrors_netbsd_386.go
src/syscall/zerrors_netbsd_amd64.go
src/syscall/zerrors_netbsd_arm.go
src/syscall/zerrors_netbsd_arm64.go
src/syscall/zsysnum_netbsd_386.go
src/syscall/zsysnum_netbsd_amd64.go
src/syscall/zsysnum_netbsd_arm.go
src/syscall/zsysnum_netbsd_arm64.go

index 07b5b6b66b9c05afb14452168509d209c84f6b25..9bb85da80262b01fef4ce289c3b597caf7e4ba8e 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build aix || darwin || (js && wasm) || netbsd || openbsd || solaris
-// +build aix darwin js,wasm netbsd openbsd solaris
+//go:build aix || darwin || (js && wasm) || openbsd || solaris
+// +build aix darwin js,wasm openbsd solaris
 
 package os
 
index 51193401f938317d008f13d23d4c448f806b5050..45b370a802e8ae1ae14f76d138085e761d35c0b4 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build dragonfly || freebsd
-// +build dragonfly freebsd
+//go:build dragonfly || freebsd || netbsd
+// +build dragonfly freebsd netbsd
 
 package os
 
index 6a58946a4a86ccc814344032d52479812aad3417..934e9ef073abf72f977ee0a0ef50ae7763047208 100644 (file)
@@ -1427,6 +1427,7 @@ const (
        WALTSIG                           = 0x4
        WCLONE                            = 0x4
        WCOREFLAG                         = 0x80
+       WEXITED                           = 0x20
        WNOHANG                           = 0x1
        WNOWAIT                           = 0x10000
        WNOZOMBIE                         = 0x20000
index f5c5c2f49c8832bde4c16365715a6b0fa38a86bd..0f5ad61a9f29a859f6f0b880448b909cb2dd2747 100644 (file)
@@ -1417,6 +1417,7 @@ const (
        WALTSIG                           = 0x4
        WCLONE                            = 0x4
        WCOREFLAG                         = 0x80
+       WEXITED                           = 0x20
        WNOHANG                           = 0x1
        WNOWAIT                           = 0x10000
        WNOZOMBIE                         = 0x20000
index c9d4579b41616f9e71bf3a4b02c0f5bd44683565..9d8678750d4cca58417b93091c49512f02f4ab0f 100644 (file)
@@ -1403,6 +1403,7 @@ const (
        WALTSIG                           = 0x4
        WCLONE                            = 0x4
        WCOREFLAG                         = 0x80
+       WEXITED                           = 0x20
        WNOHANG                           = 0x1
        WNOWAIT                           = 0x10000
        WNOZOMBIE                         = 0x20000
index e35bff7f3eea638a06a95ebeec8bf183aad63a3d..7adb72f7edd622bfe9805359f7cb4edd3d4da43e 100644 (file)
@@ -1417,6 +1417,7 @@ const (
        WALTSIG                           = 0x4
        WCLONE                            = 0x4
        WCOREFLAG                         = 0x80
+       WEXITED                           = 0x20
        WNOHANG                           = 0x1
        WNOWAIT                           = 0x10000
        WNOZOMBIE                         = 0x20000
index 4ff8d803416a6a445706270fda8750bd6ab0c740..fd0c32995142f826538f02638e0ed3cd0e6552d3 100644 (file)
@@ -271,4 +271,5 @@ const (
        SYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }
        SYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }
        SYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }
+       SYS_WAIT6                = 481 // { int|sys||wait6(idtype_t idtype, id_t id, int *status, int options, struct wrusage *wru, siginfo_t *info); }
 )
index 929da0760427679fd390e7811fe6265be6823c59..03f2cd3bd328e7a5fb5fe2a98c193e5a22aad6ea 100644 (file)
@@ -271,4 +271,5 @@ const (
        SYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }
        SYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }
        SYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }
+       SYS_WAIT6                = 481 // { int|sys||wait6(idtype_t idtype, id_t id, int *status, int options, struct wrusage *wru, siginfo_t *info); }
 )
index 998238518bfb653eea8f4e99dba7e1d91e3f9d2f..7b356e7102c06b3af3c72a105ec0f161e49b484d 100644 (file)
@@ -271,4 +271,5 @@ const (
        SYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }
        SYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }
        SYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }
+       SYS_WAIT6                = 481 // { int|sys||wait6(idtype_t idtype, id_t id, int *status, int options, struct wrusage *wru, siginfo_t *info); }
 )
index b3f5034390af7d0d99e3ce6f830224e0c6af034b..3f57ec4d894e09d01956c200369ce6c4f9062aa9 100644 (file)
@@ -271,4 +271,5 @@ const (
        SYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }
        SYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }
        SYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }
+       SYS_WAIT6                = 481 // { int|sys||wait6(idtype_t idtype, id_t id, int *status, int options, struct wrusage *wru, siginfo_t *info); }
 )