7 Commits

Author SHA1 Message Date
Tobias Klauser
c75c47738b unix, windows: copy arrays by assignment instead of looping
Follow CL 360602 which did the same in package syscall.

Change-Id: Ibf6d86dea1cb118e869618c66da72da281adb2d7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/361574
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-11-05 18:34:46 +00:00
Lorenz Bauer
711f33c999 unix: add ParseOrigDstAddr
Add a function which turns a SocketControlMessage into a Sockaddr.
This can be used with IP(V6)_RECVORIGDSTADDR to retrieve the original
destination address of a packet.

Change-Id: Ib2d80cd01be6642e8b918cbc1584d4a49c3c6f1e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/355609
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-25 11:29:17 +00:00
Lorenz Bauer
8e5104632a unix: add functions to encode Inet4Pktinfo and Inet6Pktinfo
It's possible to control the source address of a UDP packet by
passing a socket control message of type IP_PKTINFO or IPV6_PKTINFO.
This is a somewhat esoteric feature of the network stack, but it's
extremely useful feature when you really need it.

Change-Id: I8300575f975679f6689d6f1282af253ba62e8f9d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/355610
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2021-10-22 21:59:31 +00:00
Tobias Klauser
727590c500 unix: avoid "just past the end" pointers in UnixRights
Same as CL 201617 did for package syscall.

Caught with -d=checkptr

Updates golang/go#22218

Change-Id: I8208f8e6d9bd62376bf9e0458dc18956daabd785
Reviewed-on: https://go-review.googlesource.com/c/sys/+/201937
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
2019-10-18 09:52:05 +00:00
Tobias Klauser
9e4fff1f4d all: single space after period
Follow CL 20022 and consistently use single space after a period in
documentation.

Generated with:

$ perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')

Change-Id: Ia29ad823668f060e81293e848a79fc4b4857d94b
Reviewed-on: https://go-review.googlesource.com/73530
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-25 20:39:07 +00:00
Rob Pike
8442dd2c63 go.sys: update package names
Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
2014-08-11 15:58:26 -07:00
Rob Pike
20acc5cf31 go.sys: copy files from syscall package to go.sys/{plan9,windows,unix}
This CL copies to each package of go.sys the files from syscall it will need.
Different directories have different files, but these:
        mkall.sh
        str.go
        syscall.go
        mksyscall.pl
        race.go
        race0.go
        syscall_test.go
are copied to all three.
No changes yet, these are just copies. They are not ready to use yet:
package names are wrong, for starters. But this clean copy will make
it easier to follow the changes as the packages are enabled.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126960043
2014-08-11 14:48:46 -07:00