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>
Tested with TestPoll extracted from syscall_linux_test.go. Once Poll is
supported on all OSes this test can be moved to syscall_unix_test.go.
Change-Id: I03f4396be2e190770abb219c1c5324ca55bcfa27
Reviewed-on: https://go-review.googlesource.com/73430
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Tested with TestPoll extracted from syscall_linux_test.go. Once Poll is
supported on all OSes this test can be moved to syscall_unix_test.go.
Change-Id: I56ee0124a04c64e3ea51a1653901f2f4277983e6
Reviewed-on: https://go-review.googlesource.com/73370
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Tested with TestPoll extracted from syscall_linux_test.go. Once Poll is
supported on all OSes this test can be moved to syscall_unix_test.go.
Change-Id: Ia57e3a92e6a50cb22edde8a31e1c4e70d894dc4c
Reviewed-on: https://go-review.googlesource.com/73310
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
All the implementations of NsecToTimespec and NsecToTimeval were the
same other than types. Write a single version that uses
GOARCH/GOOS-specific setTimespec and setTimeval functions to handle the
types.
The logic in NsecToTimespec and NsecToTimeval caused times before 1970
to have a negative usec/nsec. The Linux kernel requires that usec
contain a positive number; for consistency, we do this for both
NsecToTimespec and NsecToTimeval.
Follow CL 30826 which did the same for syscall.
Change-Id: Id6c6f4fef8450251447d1a5b01f35c2a36b5aeb1
Reviewed-on: https://go-review.googlesource.com/73170
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
All implementations of these functions are identical.
Follow CL 30819 which did the same for syscall.
Change-Id: I3c78f05ea12251306f3e100a006d266154a5238e
Reviewed-on: https://go-review.googlesource.com/72378
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The current GetProcAddress implementation only resolves functions in
DLLs by name. Add GetProcAddressByOrdinal that allows resolving
functions by ordinal number, using the same GetProcAddress call from
kernel32.dll in the background.
This is particularly useful for some functions (e.g. IsOS from
shlwapi.dll in some older versions of Windows) that cannot be found by
name.
Fixesgolang/go#16507
Change-Id: Ib5fba7568c365a0aa2491c1261876b3a3929ec3d
Reviewed-on: https://go-review.googlesource.com/70690
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Follow CL 70590 which did the same for syscall.
unix.Select uses SYS_PSELECT6 on arm64 and mipx64x, however this
syscall expects its 5th argument to be of type Timespec (with seconds
and nanoseconds) instead of type Timeval (with seconds and microseconds)
This leads to the timeout being too short by a factor of 1000.
This CL fixes this by adjusting the timeout argument accordingly,
similarly to how glibc does it for architectures where neither
SYS_SELECT nor SYS__NEWSELECT are available. It also makes Pselect
generaly available on linux.
Updates golang/go#22246
Change-Id: I69f8821a40c59ee469b8a986d784a4db8727ee9a
Reviewed-on: https://go-review.googlesource.com/70610
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Since CL 10087 build tags for GOOS and GOARCH are emitted by
mksysctl_openbsd.go but the generated file is always written to
zsysctl_openbsd.go.
Adjust mkall.sh to write to GOOS/GOARCH specific files and create a
zsysctl_openbsd_${GOARCH}.go file for each GOARCH supported on openbsd.
Change-Id: Id2a7b2815081f024de0ca87ba870a672bab32d24
Reviewed-on: https://go-review.googlesource.com/68870
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Move the README to README.md so Gerrit can render it; currently
Gerrit only renders files named exactly "README.md" (for example at
https://go.googlesource.com/go).
Add more links to the README explaining how to file issues,
how to submit code changes, where to download the code to and
how to get it. Hopefully this should help people who go to
https://go.googlesource.com/sys or https://github.com/golang/sys
figure out how to get started with development.
Change-Id: I2b3b9cb1021292c3cb4b5eb3a84b5c17eb8429da
Reviewed-on: https://go-review.googlesource.com/49911
Reviewed-by: Kevin Burke <kev@inburke.com>
Analog to the runtime package, Select should be using newselect
instead of select. This change addresses this problem and regenerates
zsyscall_linux_* for ppc64 and ppc64le.
Updates golang/go#21946
Change-Id: I7ed5c2490ba2ce556f143f8e8377572ab345f7b8
Reviewed-on: https://go-review.googlesource.com/65091
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
When adding Mprotect to TestMmap in CL 56172, PROT_WRITE was implicitly
assumed to also include PROT_READ. This is not necessarily true on all
OSes and makes TestMmap crash on openbsd/386.
As suggested my Mikio Hara fix it by also setting PROT_READ on the
memory mapping.
Fixesgolang/go#21962
Change-Id: Ia789ab8b31f8dec0c3db23cc950ccdd4aab3db05
Reviewed-on: https://go-review.googlesource.com/65230
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
CL 62111 removed the _SC_PAGESIZE definition from the types_*.go files
but did not re-generate ztypes_solaris_amd64.go. Do so now to get rid of
_SC_PAGESIZE there as well.
Change-Id: Icde4366f4b7a92e8a89170ad00ff2b807e7655e1
Reviewed-on: https://go-review.googlesource.com/64350
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Add Major, Minor and Mkdev functions for converting device numbers to
their major/minor components and vice versa.
Use the respective functions provided by the Solaris libc instead of
reimplementing them.
Test the conversion function with some well-known static device numbers
for devices which should be present on any Solaris system.
Re-generated files on OpenIndiana Hipster 2017.04 (SunOS 5.11) which
also added some previously missing error constants.
Change-Id: Ief9ea973d91c24956571eb8fafc8a4525b0f5b90
Reviewed-on: https://go-review.googlesource.com/64390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
It has been suggested to migrate from syscall to golang.org/x/sys
The NewCallback function works in syscall. But the golang.org/x/sys/windows NewCallback function did not work.
Since golang.org/x/sys/windows already imports syscall, the NewCallback function now calls syscall.NewCallback.
Fixesgolang/go#21831
Change-Id: I5cabd8540777b398a288308a66ae20896ed4a1db
Reviewed-on: https://go-review.googlesource.com/63250
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.
The functions follow the behavior of the macros defined in OpenBSD's
sys/types.h header. However, the parameter and return types are changed
to match the existing implementations of these functions.
Test the conversion macros with some well-known device numbers.
Updates golang/go#8106
Change-Id: Ia50b7ccab18ff7c7e9dd77ddc7e4aa6cf5c79963
Reviewed-on: https://go-review.googlesource.com/63070
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Follow CL 63090 and change the Makedev function on Darwin and *BSD to
convert to uint64 before shifting/masking. This avoids a potential
overflow.
Change-Id: I5b566329695cc5edcf82f0ff2366033011b0625b
Reviewed-on: https://go-review.googlesource.com/63112
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Daniel Swarbrick reports the following go vet warning after CL 50550:
.../dev_linux.go:38: (major & 0xfffff000) (32 bits) too small for shift of 32
Fix it by converting major and minor to uint64 before the bitwise-and.
Change-Id: If37540be81f2c78a58fd5e5dcce7b770ce7b8afe
Reviewed-on: https://go-review.googlesource.com/63090
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.
The functions follow the behavior of the macros defined in FreeBSD's
sys/types.h header. However, the parameter and return types are changed
to match the existing implementations of these functions.
Because FreeBSD dynamically allocates major/minor device numbers through
devfs at runtime, testing the conversion macros against well-known
device numbers is not possible.
Updates golang/go#8106
Change-Id: I9874e63f388cfc5c0d5cc47d4d0f6ccc489b28f2
Reviewed-on: https://go-review.googlesource.com/61631
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.
The functions follow the behavior of the macros defined in DragonFlyBSD's
sys/types.h header. However, the parameter and return types are changed
to match the existing implementations of these functions.
Test the conversion macros with some well-known device numbers.
Updates golang/go#8106
Change-Id: I84c128dff3108821caaa75dcec620cf5bdb1f32d
Reviewed-on: https://go-review.googlesource.com/61630
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This change updates the Linux symbols to correspond to v4.13 of the
kernel and v2.26 of glibc. To get everything building correctly, newer
versions of the build tools are required. Instead of trying to get an
Ubuntu 17.10 docker image working, we just add Artful sources to
/etc/apt/sources.list to get a similar effect.
Now that the kernel UAPI is updated, FS_MAX_KEY_SIZE and fscrypt_key no
longer need to be manually declared, as they are now in the proper
kernel headers.
Change-Id: I5f14c99fd70b43dbb8b44e05f53e4e9f09c9a345
Reviewed-on: https://go-review.googlesource.com/61771
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Change https://go-review.googlesource.com/c/sys/+/56172 did not run
./mkall.sh after modifying syscall_linux.go. This change simply runs
./mkall.sh to correctly generate the modified files.
Note that the previous change simply reordered a few functions, so the
functions are simply reordered in the generated files.
Change-Id: I2d819f9ca4ae0e59e67e42d04bb6e6513b3c6c45
Reviewed-on: https://go-review.googlesource.com/61750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.
The functions follow the behavior of the macros defined in NetBSD's
sys/types.h header. However, the parameter and return types are changed
to match the existing implementations of these functions.
Test the conversion macros with some well-known device numbers.
Updates golang/go#8106
Change-Id: I536d6d2622f6fe9be3c1ed3beb266745fe4bfb6e
Reviewed-on: https://go-review.googlesource.com/60970
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.
The functions follow the behavior of the macros defined in Darwin's
sys/types.h header. However, the parameter and return types are changed
to match the respective Linux implementation of these functions.
Test the conversion macros with some well-known static device numbers
for devices which should be present on any Darwin system.
Updates golang/go#8106
Change-Id: I1862be64684cc1b5a53e15a883819571e368cb2b
Reviewed-on: https://go-review.googlesource.com/60610
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit relaxes SendmsgN behavior of introducing a dummy 1-byte
payload when sending ancillary-only messages.
The fake payload is not needed for SOCK_DGRAM type sockets, and actually
breaks interoperability with other fd-passing software (journald is one
known example). This introduces an additional check to avoid injecting
dummy payload in such case.
Backport of https://go.googlesource.com/go/+/93da0b6e66f24c4c307e0df37ceb102a33306174
Full reference at https:/golang.org/issue/6476#issue-51285243
Change-Id: I7cf00a1c7cde75fe62e00b98ccba6ac8469b0493
Reviewed-on: https://go-review.googlesource.com/60190
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
I falsely assumed that enum values would be generated automatically,
but now realize that the previous values I added were actually generated
from preprocessor define statements.
This change adds some missing values I intended to add in CL 59050.
Fixesgolang/go#21623.
Change-Id: I3c40c8454ee1d323e1e4e014febe0874e859a378
Reviewed-on: https://go-review.googlesource.com/59090
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Add CreateEventEx, OpenEvent, ResetEvent and PulseEvent.
Also change eventAttrs to use the local definition of the
SecurityAttributes type, not the one from syscall.
GetConsoleScreenBufferInfo is also changed by re-running 'go generate'
to pass a pointer to ConsoleScreenBufferInfo (instead of a pointer to
pointer).
Change-Id: I08dff4360186b04c55fd0362e31920f38206157b
Reviewed-on: https://go-review.googlesource.com/56110
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Make Madvice, Mlock, Mlockall, Mprotect, Msync, Munlock and Munlockall
available equally on all BSD flavors. NetBSD was previously lacking
SYS_MSYNC, so add it.
Reorder the //sys function prototype alphabetically and clean up already
implemented syscalls everywhere.
Also add tests for Mprotect, Msync and Madvice - now that they're
available on all unix platforms.
Fixesgolang/go#18513
Change-Id: I0eb502d72c7e991f191fb96225ef04e8297d8b8d
Reviewed-on: https://go-review.googlesource.com/56172
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Follow CL golang.org/cl/55690 (which did the same for syscall) and fix
the definition of AT_FDCWD on dragonfly/amd64.
Change-Id: I2c44a0f84308697d3dbac9b78c4a3dce973f88ba
Reviewed-on: https://go-review.googlesource.com/55691
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Follow golang.org/cl/55130 and add the utimensat syscall on *BSD. Use it
in UtimesNano and UtimesNanoAt (which is added on *BSD, akin to the
already existing implementation on Linux and Solaris).
Also add AT_FDCWD and AT_SYMLINK_NOFOLLOW where they are missing. These
might be used with UtimesNanoAt.
In order to be able to generate the syscalls, also add two missing
$GOOS_$GOARCH patterns to mkall.sh. As a side effect, some additional
syscalls are added for openbsd/arm.
Change-Id: I85351098002209f8454ec328cef0cfe9d12c5214
Reviewed-on: https://go-review.googlesource.com/55071
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Follow golang.org/cl/50450 and add the Faccessat, Fchmodat, Fchownat,
Linkat, Mkdirat, Openat, Readlinkat, Renameat, Symlinkat and Unlinkat
functions (to conform to POSIX.1-2008) for darwin/arm and darwin/amd64.
Also add the missing AT_* constants.
Generated on Mac OS 10.11 (Darwin 15.6.0). This also regenerates the
syscall numbers for arm and arm64 akin to golang.org/cl/14151
Also fix the mksysnum call in mkall.sh to work for darwin/arm.
Fixesgolang/go#14457
Change-Id: Ia3c36dbca9e6f1e4873afdfafcc4f7d8050644f9
Reviewed-on: https://go-review.googlesource.com/54271
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add the MNT_* constants used for the Mount and Umount functions on
Darwin.
Generated on Mac OS 10.11 (Darwin 15.6.0). This also brings
zerrors_darwin_{arm,arm64} up to date with constants which are already
present for 386 and amd64.
Fixesgolang/go#9891
Change-Id: Id77847a2fb805a759aa0f5b36e8954b764e699a5
Reviewed-on: https://go-review.googlesource.com/54210
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This copies over some files from the main repo to make the
GOOS=openbsd GOARCH=arm go install and go test -c work.
No clue whether it actually works or not, though. We don't have
builders anymore for this port.
But once this compiles, we'll at least be able to use constants from
the x/sys/unix package from x/net without regressing x/net's support
for openbsd/arm. (If anybody uses openbsd/arm)
Fixesgolang/go#10826
Change-Id: Id821e2011bcd2d3720652be44ac09e4ce4d2a3a3
Reviewed-on: https://go-review.googlesource.com/54053
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
Add IoctlGetInt/IoctlSetInt, IoctlGetTermios/IoctlSetTermios and
IoctlGetWinsize/IoctlSetWinsize on FreeBSD. These are similar to the
already existing implementations on Linux, Darwin and Solaris.
Generated on FreeBSD 10.11-RELEASE.
Change-Id: I79b273032cfeb719ec5550ac15635fd9f3231469
Reviewed-on: https://go-review.googlesource.com/52710
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add IoctlGetInt/IoctlSetInt, IoctlGetTermios/IoctlSetTermios and
IoctlGetWinsize/IoctlSetWinsize on Darwin. These are similar to the
already existing implementations on Linux and Solaris.
Generated on Mac OS 10.11 (Darwin 15.6.0).
Change-Id: I2d4cc957c840836fcc2ccb71c67631420f4a2eb1
Reviewed-on: https://go-review.googlesource.com/52410
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add the Faccessat, Fchmodat, Fchownat, Linkat, Mkdirat, Readlinkat,
Renameat, Symlinkat and Unlinkat functions (to conform to POSIX.1-2008)
and also add the missing AT_* constants.
Generated on FreeBSD 10.11-RELEASE for freebsd/amd64 and freebsd/386.
Change-Id: I1aea155d5375cfd6b38662018ccb5b834151b982
Reviewed-on: https://go-review.googlesource.com/52070
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>