1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:21:22 -06:00
Commit Graph

12 Commits

Author SHA1 Message Date
Mikio Hara
a7858a40a5 syscall: add SendmsgN for BSD variants, Linux and Solaris
SendmsgN is an alternate version Sendmsg that also returns
the number of bytes transferred, instead of just the error.

Update #7645

LGTM=aram, iant
R=iant, aram, bradfitz
CC=golang-codereviews
https://golang.org/cl/81210043
2014-03-29 09:28:40 +09:00
Brad Fitzpatrick
ba8c92c166 syscall: use unsafe.Pointer in BSD kevent
Doesn't really matter for the most part, since the runtime-integrated
network poller uses its own kevent implementation, but for people using
the syscall directly, we should use an unsafe.Pointer for the precise GC
to retain the pointer arguments.

Also push down unsafe.Pointer a bit further in exec_linux.go, not
that there are any GC preemption points in the middle and sys
is still live anyway.

R=golang-codereviews, dvyukov
CC=golang-codereviews, iant
https://golang.org/cl/55520043
2014-01-22 10:35:41 -08:00
Brad Fitzpatrick
f00af3da1c syscall: use unsafe.Pointer instead of uintptr in net syscalls
In particular: setsockopt, getsockopt, bind, connect.

There are probably more.

All platforms cross-compile with make.bash, and all.bash still
pases on linux/amd64.

Update #7169

R=rsc
CC=golang-codereviews
https://golang.org/cl/55410043
2014-01-21 18:54:49 -08:00
Shenghou Ma
6de184b385 syscall: fix prototype of Fchflags (API change)
API change, but the old API is obviously wrong.

R=golang-dev, iant, r, rsc
CC=golang-dev
https://golang.org/cl/9157044
2013-05-07 05:20:00 +08:00
Dmitriy Vyukov
cffbfaeb18 race: syscall changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
The purpose of this patch is to provide coarse-grained synchronization
between all Read() and Write() calls.

R=rsc, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/6610064
2012-10-09 20:51:58 +04:00
Russ Cox
3d5ddffa30 syscall: prepare for 64-bit ints
This CL fixes code that incorrectly assumes that int is 32 bits wide.
Specifically, the socketpair system call expects a pointer to a pair
of int32s, not a pair of ints. Fix this inside the wrappers without
changing the APIs.

Update #2188.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6552063
2012-09-24 00:06:22 -04:00
Alexey Borzenkov
a108369c83 syscall: return EINVAL when string arguments have NUL characters
Since NUL usually terminates strings in underlying syscalls, allowing
it when converting string arguments is a security risk, especially
when dealing with filenames. For example, a program might reason that
filename like "/root/..\x00/" is a subdirectory or "/root/" and allow
access to it, while underlying syscall will treat "\x00" as an end of
that string and the actual filename will be "/root/..", which might
be unexpected. Returning EINVAL when string arguments have NUL in
them makes sure this attack vector is unusable.

R=golang-dev, r, bradfitz, fullung, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6458050
2012-08-05 17:24:32 -04:00
Benny Siegert
677cdb800d syscall: use pipe instead of pipe2 on NetBSD
pipe2 is equivalent to pipe with flags set to 0.
However, pipe2 was only added recently. Using pipe
instead improves compatibility with NetBSD 5.

R=jsing
CC=golang-dev
https://golang.org/cl/6268045
2012-06-05 01:29:34 +10:00
Benny Siegert
559c191b89 syscall: manually fix z* for NetBSD/amd64
Building go currently fails on NetBSD, thus the regeneration
scripts do not run correctly. With these changes, at least
the go_bootstrap tool builds correctly.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5695064
2012-04-06 07:57:05 -07:00
Joel Sing
f1ebbf80bd syscall: make pipe work on netbsd
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5504070
2011-12-23 02:47:48 +11:00
Joel Sing
43bc8a9b53 syscall: make getdirentries work on netbsd
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5504068
2011-12-22 23:42:43 +11:00
Christopher Nielsen
5425db8f99 syscall: Changes to the syscall package to support NetBSD.
Not all syscalls are implemented, but many are. On the suggestion
of Joel Sing <jsing@google.com>, the generated files were added
with hg add instead of hg cp, since they are generated on an OS
dependant basis.

R=golang-dev, jsing, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5491050
2011-12-20 03:57:58 +11:00