summaryrefslogtreecommitdiff
path: root/src/syscall/syscall_netbsd.go
Commit message (Collapse)AuthorAgeFilesLines
* syscall: implement syscalls on Darwin using libSystemKeith Randall2018-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | There are still some references to the bare Syscall functions in the stdlib. I will root those out in a following CL. (This CL is big enough as it is.) Most are in vendor directories: cmd/vendor/golang.org/x/sys/unix/ vendor/golang_org/x/net/route/syscall.go syscall/bpf_bsd.go syscall/exec_unix.go syscall/flock.go Update #17490 Change-Id: I69ab707811530c26b652b291cadee92f5bf5c1a4 Reviewed-on: https://go-review.googlesource.com/c/141639 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: remove/update outdated TODO commentsTobias Klauser2018-02-261-1/+1
| | | | | | | | | | | | | | | | Error returns for linux/arm syscalls are handled since a long time. Remove another list of unimplemented syscalls, following CL 96315. The root-only check in TestSyscallNoError was shown to be sufficient as part of CL 84485 already. NetBSD and OpenBSD do not implement the sendfile syscall (yet), so add a link to golang.org/issue/5847 Change-Id: I07efc3c3203537a4142707385f31b59dc0ecca42 Reviewed-on: https://go-review.googlesource.com/97115 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: remove list of unimplemented syscallsTobias Klauser2018-02-221-269/+0
| | | | | | | | | The syscall package is frozen and we don't want to encourage anyone to implement these syscalls. Change-Id: I6b6e33e32a4b097da6012226aa15300735e50e9f Reviewed-on: https://go-review.googlesource.com/96315 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* net, internal/poll, net/internal/socktest: set SOCK_{CLOEXEC,NONBLOCK} ↵Tobias Klauser2018-02-151-0/+19
| | | | | | | | | | | | | | | | | atomically on NetBSD NetBSD supports the SOCK_CLOEXEC and SOCK_NONBLOCK flags to the socket syscall since version 6.0. The same version also introduced the paccept syscall which can be used to implement syscall.Accept4. Follows CL 40895 Change-Id: I9e4e1829b0382744c7799f4e58929a53b4e193f7 Reviewed-on: https://go-review.googlesource.com/94295 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall, os: use pipe2 syscall on NetBSD instead of pipeTobias Klauser2018-02-141-3/+10
| | | | | | | | | | | | | | The pipe2 syscall is part of NetBSD since version 6.0 and thus exists in all officially supported versions (6.0 through 6.1 and 7.0+). Follows CL 38426 Change-Id: I7b62b507300c3dfbcc6ae56408a7d7088ddccc77 Reviewed-on: https://go-review.googlesource.com/94035 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* syscall: support Getwd on all BSDsTobias Klauser2018-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | | All supported BSDs provide the SYS___GETCWD syscall which can be used to implement syscall.Getwd. With this change os.Getwd can use a single syscall instead of falling back to the current kludge solution on the BSDs. This doesn't add any new exported functions to the frozen syscall package, only ImplementsGetwd changes to true for dragonfly, freebsd, netbsd and openbsd. As suggested by Ian, this follows CL 83755 which did the same for golang.org/x/sys/unix. Also, an entry for netbsd/arm is added to mkall.sh which was used to generate the syscall wrappers there. Change-Id: I84da1ec61a6b8625443699a63cde556b6442ad41 Reviewed-on: https://go-review.googlesource.com/84484 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* Revert "go/printer: forbid empty line before first comment in block"Joe Tsai2017-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 08f19bbde1b01227fdc2fa2d326e4029bb74dd96. Reason for revert: The changed transformation takes effect on a larger set of code snippets than expected. For example, this: func foo() { // Comment bar() } becomes: func foo() { // Comment bar() } This is an unintended consequence. Change-Id: Ifca88d6267dab8a8170791f7205124712bf8ace8 Reviewed-on: https://go-review.googlesource.com/81335 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <joetsai@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/printer: forbid empty line before first comment in blockJoe Tsai2017-11-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To improve readability when exported fields are removed, forbid the printer from emitting an empty line before the first comment in a const, var, or type block. Also, when printing the "Has filtered or unexported fields." message, add an empty line before it to separate the message from the struct or interfact contents. Before the change: <<< type NamedArg struct { // Name is the name of the parameter placeholder. // // If empty, the ordinal position in the argument list will be // used. // // Name must omit any symbol prefix. Name string // Value is the value of the parameter. // It may be assigned the same value types as the query // arguments. Value interface{} // contains filtered or unexported fields } >>> After the change: <<< type NamedArg struct { // Name is the name of the parameter placeholder. // // If empty, the ordinal position in the argument list will be // used. // // Name must omit any symbol prefix. Name string // Value is the value of the parameter. // It may be assigned the same value types as the query // arguments. Value interface{} // contains filtered or unexported fields } >>> Fixes #18264 Change-Id: I9fe17ca39cf92fcdfea55064bd2eaa784ce48c88 Reviewed-on: https://go-review.googlesource.com/71990 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* syscall: use setattrlist for UtimesNano on Darwin for ns resolutionEvan Jones2017-11-011-0/+5
| | | | | | | | | | | | | | | | | | | Mac OS X 10.13 introduced APFS which stores nanosecond resolution timestamps. The implementation of os.Stat already returns full resolution timestamps, but os.Chtimes only sets timestamps with microsecond resolution. Fix this by using setattrlist on Darwin, which takes a struct timeval with nanosecond resolution. This is what Mac OS X 10.13 appears uses to implement utimensat, according to dtruss. Fixes #22528 Change-Id: I397dabef6b2b73a081382999aa4c4405ab8c6015 Reviewed-on: https://go-review.googlesource.com/74952 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: make Exit call runtime.exitAlex Brainman2017-09-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syscall.Exit and runtime.exit do the same thing. Why duplicate code? CL 45115 fixed bug where windows runtime.exit was correct, but syscall.Exit was broken. So CL 45115 fixed windows syscall.Exit by calling runtime.exit. Austin suggested that all OSes should do the same, and this CL implements his idea. While making changes, I discovered that nacl syscall.Exit returned error func Exit(code int) (err error) and I changed it into func Exit(code int) like all other OSes. I assumed it was a mistake and it is OK to do because cmd/api does not complain about it. Also I changed plan9 runtime.exit to accept int32 just like all other OSes do. Change-Id: I12f6022ad81406566cf9befcc6edc382eebd413b Reviewed-on: https://go-review.googlesource.com/66170 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: David du Colombier <0intro@gmail.com>
* syscall: add missing int flag argument to utimensatYuval Pavel Zholkover2017-08-151-1/+1
| | | | | | | | | | Fixes #21437 Change-Id: I55fbf5114ae1bb7f4aa1a20450e8d5309756cd5b Reviewed-on: https://go-review.googlesource.com/55430 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: add utimensat and use it for UtimesNano on BSD and SolarisTobias Klauser2017-08-141-0/+1
| | | | | | | | | | | | | | | | | | All the BSDs and Solaris support the utimensat syscall, but Darwin doesn't. Account for that by adding the //sys lines not to syscall_bsd.go but the individual OS's syscall_*.go files and implement utimensat on Darwin as just returning ENOSYS, such that UtimesNano will fall back to use utimes as it currently does unconditionally. This also adds the previously missing utimensat syscall number for FreeBSD and Dragonfly. Fixes #16480 Change-Id: I367454c6168eb1f7150b988fa16cf02abff42f34 Reviewed-on: https://go-review.googlesource.com/55130 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
* syscall: validate ParseDirent inputsDamien Neil2016-09-201-26/+10
| | | | | | | | | | | | | | | | Don't panic, crash, or return references to uninitialized memory when ParseDirent is passed invalid input. Move common dirent parsing to syscall.go with minimal platform-specific functions in syscall_$GOOS.go. Fixes #15653 Change-Id: I5602475e02321fe381064488401c14b33bec6886 Reviewed-on: https://go-review.googlesource.com/23780 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: fix assembly vet issuesJosh Bleecher Snyder2016-08-251-1/+1
| | | | | | | | | | | | | | | | | | | Add missing function prototypes. Fix function prototypes. Use FP references instead of SP references. Fix variable names. Update comments. Clean up whitespace. (Not for vet.) All fairly minor fixes to make vet happy. Updates #11041 Change-Id: Ifab2cdf235ff61cdc226ab1d84b8467b5ac9446c Reviewed-on: https://go-review.googlesource.com/27713 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: change Dup,Dup2,Dup3 to use Syscall, not RawSyscallIan Lance Taylor2015-03-261-2/+2
| | | | | | | | | | | | | | | | | This avoids hanging when a Go program uses a FUSE filesystem and the dup system call has to close a file descriptor. When dup uses RawSyscall then the goroutine calling dup will occupy a scheduler slot (a p structure) during the call, and may block waiting for some other goroutine to respond to the close call on the FUSE filesystem. Changing to Syscall avoids the problem. This makes Dup a tiny bit slower but is quite unlikely to make a difference for any real programs. Fixes #10202. Change-Id: If6490a8f9b3c9cfed6acbfb4bfd1eaeac62ced17 Reviewed-on: https://go-review.googlesource.com/8095 Reviewed-by: Rob Pike <r@golang.org>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+489
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.