os, syscall: use wait6 to avoid wait/kill race on netbsd

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>
This commit is contained in:
Tobias Klauser 2021-05-02 13:22:48 +02:00 committed by Tobias Klauser
parent 138d2c9b88
commit 45600bcd61
10 changed files with 12 additions and 4 deletions

View 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

View 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

View file

@ -1427,6 +1427,7 @@ const (
WALTSIG = 0x4
WCLONE = 0x4
WCOREFLAG = 0x80
WEXITED = 0x20
WNOHANG = 0x1
WNOWAIT = 0x10000
WNOZOMBIE = 0x20000

View file

@ -1417,6 +1417,7 @@ const (
WALTSIG = 0x4
WCLONE = 0x4
WCOREFLAG = 0x80
WEXITED = 0x20
WNOHANG = 0x1
WNOWAIT = 0x10000
WNOZOMBIE = 0x20000

View file

@ -1403,6 +1403,7 @@ const (
WALTSIG = 0x4
WCLONE = 0x4
WCOREFLAG = 0x80
WEXITED = 0x20
WNOHANG = 0x1
WNOWAIT = 0x10000
WNOZOMBIE = 0x20000

View file

@ -1417,6 +1417,7 @@ const (
WALTSIG = 0x4
WCLONE = 0x4
WCOREFLAG = 0x80
WEXITED = 0x20
WNOHANG = 0x1
WNOWAIT = 0x10000
WNOZOMBIE = 0x20000

View 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); }
)

View 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); }
)

View 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); }
)

View 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); }
)