Commit Graph

99 Commits

Author SHA1 Message Date
erifan01
ac6580df44 unix: move functions Ptrace{Get|Set}RegSetArm64 to a separate file
CL 204418 adds functions PtraceGetRegSetArm64 and PtraceSetRegSetArm64 to file
zptrace_armnn_linux.go, both of which depend on type Iovec. The definitions of type
Iovec on linux arm and arm64 are different, but file zptrace_armnn_linux.go is
shared by them. So these two functions cause compilation errors on linux arm. This
patch fixes this error by moving these two functions into a separate file.

Fixes golang/go#36032

Change-Id: Ia380bd863895900599c09d4631ed26f204955112
Reviewed-on: https://go-review.googlesource.com/c/sys/+/210322
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-10 02:34:23 +00:00
erifan01
bc7efcf3b8 unix: add functions PtraceGetRegSetArm64 and PtraceSetRegSetArm64
Since arm64 GNU/Linux version 2.6.34, PTRACE_GETREGS was replaced by PTRACE_GETREGSET,
in order to get or set the general purpose and floating-point register values,
PTRACE_GETREGSET/PTRACE_SETREGSET request type and a proper "NT_XXX" constant values
should be used. For the sake of not breaking the existing API, we added two functions
PtraceGetRegSetArm64 and PtraceSetRegSetArm64, they take an additional argument "addr",
and use PTRACE_GETREGSET and PTRACE_SETREGSET request types respectively.

Change-Id: I14c55733e15cea4b7d775187b1018fcb2880d6a9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/204418
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-06 21:42:22 +00:00
Eric Biggers
63cb32ae39 unix: add new fscrypt declarations from Linux v5.4
Create Go bindings for the updated fscrypt UAPI from Linux v5.4:

- Various new ioctls.  We use the regex FS_IOC_.*ENCRYPTION to match
  both the new and existing fscrypt ioctls.

- Various new structures for passing to the ioctls

- Various new constants named like FSCRYPT_*

- FscryptPolicy was renamed to FscryptPolicyV1.  (But the old name is
  still available for source compatibility.)

- The existing fscrypt-related constants named like FS_* (besides the
  ioctls) were renamed to FSCRYPT_*.  (But the old names are still
  available for source compatibility.)

For reference, see fscrypt.h:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fscrypt.h?h=v5.4

Fixes golang/go#35856

Change-Id: I48ddd37cfa7c1e0e7eb227baa6f220c848ddc880
Reviewed-on: https://go-review.googlesource.com/c/sys/+/208898
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-27 02:17:46 +00:00
Matt Layher
8a8471f7e5 unix/linux: bump Linux and Go versions to latest stable releases
Attempting to upgrade to the Ubuntu 19.10 Docker image results in
failures due to Ubuntu/Debian removing the mips{,64}{,le} cross
compilers, so we stick with 19.04 for now.

Change-Id: Ie75057447889ea1648d638a410e1c35c047b579a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/208737
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-11-26 13:16:56 +00:00
Tobias Klauser
52ab431487 unix: fix EpollEvent padding on mips64{,le}
Like on other 64-bit GOARCHes, EpollEvent needs padding before Fd for
mips64 and mips64le.

Change-Id: I934368ba22ef7bf3a25949649613c2a03928bf83
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207278
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-15 15:19:21 +00:00
Matt Layher
195ce5e7f9 unix: add devlink Linux generic netlink API constants
For more information on devlink, see: https://lwn.net/Articles/674867/.

Change-Id: I68815c94160864f4a3d2bb78b2e5d06949d27acf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/203878
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-28 16:43:58 +00:00
Lehner Florian
06d7bd2c5f unix: update rtnetlink constants
Change-Id: I21551672b5d8dd3e56c49da69f66dc19b07a5299
Reviewed-on: https://go-review.googlesource.com/c/sys/+/199757
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-10-09 17:02:03 +00:00
Srinidhi Kaushik
aed5e4c7ec unix: add Klogset and related SYSLOG_ACTION_ constants
Adds a new function: Klogset which wraps sys_syslog for
cases where the `bufp` argument is not required and the
argument that follows needs to be passed to the function.

Fixes golang/go#34672

Change-Id: Idf026791ea9265aaca33e78a34fcd490edb8d326
Reviewed-on: https://go-review.googlesource.com/c/sys/+/199278
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-05 20:08:04 +00:00
Tobias Klauser
1a3b71a79e unix: update Dockerfile to Linux 5.3 and use ubuntu 19.04 base image
rsync needs to be explicitly installed for 'make headers_install' to
work.

Change-Id: Icd3d6b3f004a7684b5ae32b4b7cab8d50631900d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195258
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-09-16 14:18:54 +00:00
Tobias Klauser
c3b328c6e5 unix: add IfaCacheinfo on linux
Change-Id: Ifda2eed10f75eeddff7720676fd0a5feee78a7a5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195257
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-13 12:16:21 +00:00
Tobias Klauser
bc967efca4 unix: sort Linux-specific includes in linux/types.go and mkerrors.sh
Keep the list of includes sorted, so that it's clear where to add new
entries and to avoid duplicates being added.

Change-Id: I67bd8b5a4e4b40affcad636dccfceef2460158b1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195017
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-09-12 14:19:32 +00:00
Matt Layher
43c01164e9 unix: implement AF_TIPC sockets on Linux
Adds initial constants and types to use with SockaddrTIPC. For more
information on TIPC, see: http://tipc.sourceforge.net/.

Because the C struct sockaddr_tipc makes use of a union for its addr
field, I have created a wrapping layer in SockaddrTIPC that uses
an interface to determine which variant is in use.

Tests accompany this change due to the complexity of this code. There
is currently little test coverage in the Sockaddr-related code, but
perhaps this is something that could be picked up as a relatively
straightforward task for a new contributor.

Change-Id: I5033a0685cb7128d4b1a23d18aca71c202d0c0aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/187960
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-09-04 00:50:37 +00:00
Matt Layher
1f305c863d unix/linux: upgrade Docker build container to Go 1.13
Change-Id: I1f47efb573ff3fa77afd9d1433726a908008c27d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/193119
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-03 21:38:30 +00:00
Tobias Klauser
fde4db37ae unix/linux: update Dockerfile to glibc 2.30
Change-Id: I4fd358388c46b4c2e8a4081640315db2313e585f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/189438
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-08-13 06:44:41 +00:00
Tonis Tiigi
9eafafc0a8 unix: fix epoll_event padding on riscv64
Change-Id: I88bccf0e671d350f8f57ac4d277adf4081054729
GitHub-Last-Rev: 3302142611
GitHub-Pull-Request: golang/sys#40
Reviewed-on: https://go-review.googlesource.com/c/sys/+/189877
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-12 07:30:06 +00:00
Tobias Klauser
fae7ac547c unix: add constants and types to work with Linux loop devices
Change-Id: I0996df39a561b50822a6e42e770d96421d6b4965
Reviewed-on: https://go-review.googlesource.com/c/sys/+/185498
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-07-12 06:29:09 +00:00
Tobias Klauser
6ec70d6a55 unix: update Dockerfile to Linux 5.2 and Go 1.13beta1
Change-Id: I1a63f6ae5fe6b8b6fb4f493837b12dbe3c2860d4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/185497
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-07-10 14:34:15 +00:00
Tobias Klauser
943d5127bd unix: add support to get/set Linux capabilities
Add wrappers for Getcap/Setcap on Linux as well as some related types
and consts.

Change-Id: I07764c2e64717214850ea3cbdc238e313d1e38c4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/183218
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-21 15:33:39 +00:00
Yuval Pavel Zholkover
adf421d2ca unix: fix Signalfd function signature on linux
The kernel raw syscall takes an additional parameter specifying
the size of the Sigset_t parameter, returns a file descriptor and sets errno.

Add a uintptr maxSize parameter, adjust the return to be (newfd int, err error).
Add the _NSIG #define and a wrapper to call with maxSize set to _C__NSIG/8 as done
in glibc/musl.

Change-Id: I277db0aab5c12364533c26ea800b7f394ec83ae4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/178858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-28 01:25:30 +00:00
Lehner Florian
12bbe5a7a5 unix: add BPF constants on Linux
Change-Id: Ie43daa8ba56ad1e57ddbb8ddd47f83b363fe75b4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/174978
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-05-08 10:04:23 +00:00
Tobias Klauser
2953c62de4 unix: update Dockerfile to Linux 5.1
Also add KexecFileLoad on linux/arm now that is has SYS_KEXEC_FILE_LOAD.

Change-Id: I519bc2f611b511af994e1c7bbaa07f68cd615ef4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/175158
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-07 05:39:17 +00:00
Gernot Vormayr
a43fa875dd unix: add missing tpacket block (sub)header
This adds the missing tpacket_hdr_v1 struct, which is needed to read
tpacket_block_desc (hdr member, which is a union and therfore defined as
[40]byte). This doesn't modify block_desc so existing implementations
keep working.
Caveat: Although TpacketBDTS has a usec member, this will contain nsec
in case of tpacket v2 or v3.

Change-Id: I772939fe56cf56fc09cf4acf4013b23beb6e03c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/174861
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-02 17:53:42 +00:00
Matt Layher
18eb32c0e2 unix: add Linux crypto configuration API constants and types
Change-Id: I447150cb60b5580cee77d23c0dae2244803e92ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/173660
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-24 17:57:32 +00:00
Matt Layher
b44545bcd3 unix: add missing rtnetlink IFLA_* constants on Linux
A number of IFLA_* constants have been added since the last time this
list was generated. In addition, IFLA_INFO_* is a different enum, so
we'll add the missing values for there as well.

Change-Id: Ie20b1f49a95cbc10daf0be2e5b5d719782eda68f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/171698
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-11 18:56:58 +00:00
Jeroen Simonetti
0ad05ae300 unix: add missing rtnetlink neighbor constants on Linux
Change-Id: Ie261a6f149b7bc531f80726c016bf8f63c9210a7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/171537
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-10 23:58:45 +00:00
Matt Layher
cc4d4f5062 unix: add missing rtnetlink IFA_* constants on Linux
A few additional constants are now available since the last time
this list was updated.

Change-Id: I81cd07f8c6e7acb03ef67764ab783cea89ba3868
Reviewed-on: https://go-review.googlesource.com/c/sys/+/171318
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-04-10 17:00:21 +00:00
Andrei Tudor Călin
980fc434d2 unix, unix/linux: add additional Linux perf API bits
Add sample_max_stack field to struct perf_event_attr.

Add the missing PERF_FLAG_FD_CLOEXEC flag, the missing
PERF_COUNT_SW_BPF_OUTPUT constant, missing PERF_RECORD_*
constants, and missing PERF_SAMPLE_BRANCH_* constants.

Change-Id: I44c5e37ff36420b35e56c97e7fc190cd0af95e21
Reviewed-on: https://go-review.googlesource.com/c/sys/+/166457
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-03-09 12:25:39 +00:00
Tobias Klauser
3e9a981b8d unix: add functions to get/set tpacket socket options
Add GetsockoptTpacketStats and GetsockoptTpacketStatsV3 to get tpacket
statistics (for TPACKET_V2 and TPACKET_V3).

Add SetsockoptTpacketReq and SetsockoptTpacketReq3 to set up tpacket
v2/v3 ring buffers.

Change-Id: Ic2870be22be7d74141f682e515a682df28e1c814
Reviewed-on: https://go-review.googlesource.com/c/sys/+/165558
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-06 15:53:19 +00:00
Tobias Klauser
e844e0132e unix: update Dockerfile to Go 1.12 and Linux 5.0
Also enable KexecFileLoad on linux/{arm64,riscv64} now that they have
SYS_KEXEC_FILE_LOAD.

Change-Id: I1c52d09a1a617794f2df697e4966c4c24a166611
Reviewed-on: https://go-review.googlesource.com/c/sys/+/164997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-04 15:46:30 +00:00
Dominik Honnef
c2f5717e61 unix: add fanotify API on Linux
This teaches unix/mksyscall.go about mapping uint64 to syscall
arguments, similar to existing handling of int64.

Change-Id: I536b4b09bbf6a8e3016565a4a04d2b9d32cbc624
Reviewed-on: https://go-review.googlesource.com/c/164664
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-03-03 19:25:50 +00:00
Tobias Klauser
cd391775e7 unix: add type NdUseroptmsg on Linux
Change-Id: I06997987f2d54a1fbca098878a3bac473ec1bfc0
Reviewed-on: https://go-review.googlesource.com/c/163379
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-02-22 17:13:17 +00:00
Tobias Klauser
a9d3bda3a2 unix: add SetsockoptCanRawFilter for linux
Add the SetsockoptCanRawFilter func and CanFilter type to allow kernel
message filtering on AF_CAN sockets.

Fixes golang/go#29638

Change-Id: I4042825527ba2bc9aeb8dbe70d1960a06b15c29e
Reviewed-on: https://go-review.googlesource.com/c/163318
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-22 07:27:16 +00:00
Tobias Klauser
41f3e65849 unix/linux: update Dockerfile to glibc 2.29 and Go 1.12beta2
Drop the manually defined *_XDP constants which were added to glibc.
Install python3 instead of python because glibc's confugure script now
requires at least 3.4.

Change-Id: Ic19ff4d8aa4dbadeb5438e331ccafeafc2cc9925
Reviewed-on: https://go-review.googlesource.com/c/160957
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-04 20:37:06 +00:00
Tobias Klauser
afcc84fd75 unix: add RND* ioctl consts on Linux
Change-Id: I79c721d0f4fe097daf096dc7404675aa3048bf6a
Reviewed-on: https://go-review.googlesource.com/c/160757
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-01 15:26:29 +00:00
Tobias Klauser
b90733256f unix: use glibc release branch in Dockerfile
It shouldn't make a difference for generating types and consts, but
let's use the glibc release branch anyway.

Fixes golang/go#29873

Change-Id: I15a3df250f5ae6181b2d036a10e0523ebe44ac3f
Reviewed-on: https://go-review.googlesource.com/c/158997
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-24 10:00:55 +00:00
Tobias Klauser
054c452bb7 unix: add socket error queue constants and types from linux/errqueue.h
Also add additional packet timestamping constants and types defined
in the same header.

Change-Id: I4280f925b46e229f4c3a83a7fee4612592314016
Reviewed-on: https://go-review.googlesource.com/c/158761
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-22 07:17:31 +00:00
Tobias Klauser
11f53e0313 unix: use int8 for RawSockaddrUnix.Path on linux/riscv64
On linux/riscv64, char defaults to unsigned, so explicitly make
RawSockaddrUnix.Path signed.

Patch by Ryan O'Leary.

Updates golang/go#27532

Change-Id: If99a3953462ad98f61d8fafcda3ebb71b44e6018
Reviewed-on: https://go-review.googlesource.com/c/157900
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-16 16:14:47 +00:00
Tobias Klauser
a457fd0364 unix: add Signalfd on linux
Also add the SFD_* constants and SignalfdSiginfo type.

Change-Id: I3415c212b85c9d5a940ba2bf70f43739a2630d78
Reviewed-on: https://go-review.googlesource.com/c/157897
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-15 15:29:22 +00:00
Tobias Klauser
82a175fd15 unix/linux: update Dockerfile to Linux Kernel 4.20
Change-Id: Iadc92b5afd18a5c1df0bc42b0d6f52f0b768b47a
Reviewed-on: https://go-review.googlesource.com/c/155979
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-02 15:56:01 +00:00
Tobias Klauser
b4a75ba826 unix: generate linux/sparc64 go files using Docker
With cgo supporting sparc64 as of CL 102555 and CL 132155, the Docker
based build system can be used to generate file for linux/sparc64 as
well.

Updates golang/go#15282

Change-Id: I109e55f39d3229b24b0029c42074e439c6c54dc8
Reviewed-on: https://go-review.googlesource.com/c/102655
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-12-21 14:31:28 +00:00
Alberto Donizetti
b00e65af1d unix/linux: set 100644 mode on mksysnum.go
Change mode of mksysnum.go to 644.

I also checked all the other files with 755 mode, to verify that no
other Go file has this issue. After this change, only .sh and .pl
files are executable:

  $ git ls-files -s * | grep 100755
  100755 9f73c60660 0	plan9/mkall.sh
  100755 85309c4a5b 0	plan9/mkerrors.sh
  100755 252e89e14d 0	plan9/mksyscall.pl
  100755 3c3ab05810 0	plan9/mksysnum_plan9.sh
  100755 f8dab7511d 0	unix/mkall.sh
  100755 955dd50f9a 0	unix/mkerrors.sh
  100755 c44de8d310 0	unix/mksyscall_aix_ppc.pl
  100755 53df26bb93 0	unix/mksyscall_aix_ppc64.pl
  100755 a354df5a6b 0	unix/mksyscall_solaris.pl
  100755 20632e1460 0	unix/mksysctl_openbsd.pl
  100755 5453c53b19 0	unix/mksysnum_darwin.pl
  100755 6804f41216 0	unix/mksysnum_dragonfly.pl
  100755 198993d095 0	unix/mksysnum_freebsd.pl
  100755 85988b140b 0	unix/mksysnum_netbsd.pl
  100755 84edf60ca1 0	unix/mksysnum_openbsd.pl

Fixes golang/go#29369

Change-Id: I66eae4cec07806ea6289e229819aef8dbbad9335
Reviewed-on: https://go-review.googlesource.com/c/155417
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-12-20 20:41:20 +00:00
Tobias Klauser
97b4c2a929 unix: update Dockerfile to Go 1.12beta1
The removed paddings are expected behavior resulting from CL 150602.

Change-Id: I2c80405e20f92cca4890230c6f0644b724a8076e
Reviewed-on: https://go-review.googlesource.com/c/155257
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-12-20 15:53:39 +00:00
Visweswara R
a5c9d58dba unix/linux: replace "mksysnum.pl" script with a Go program
Port mksysnum.pl Perl script to mksysnum.go.
mkall scripts are modified to run mksysnum.go.
Running ./mkall.sh does not generate any git diff besides
the command name in comments of generated files.

Updates golang/go#27779

Change-Id: Id62df9d819f00729ab19b6bc4d32dddcf8d9832b
Reviewed-on: https://go-review.googlesource.com/c/151377
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-12-05 08:54:12 +00:00
Visweswara R
4ed8d59d0b unix: replace "mksyscall.pl" script with a Go program
Port mksyscall.pl Perl script to mksyscall.go.
mkall scripts are modified to run mksyscall.go.
Running ./mkall.sh does not generate any git diff besides
the command name in comments of generated files.

Updates golang/go#27779

Change-Id: I8c6eb852e6821f4a91dc03cc042d8d343f1bcf66
Reviewed-on: https://go-review.googlesource.com/c/150217
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-11-28 09:27:32 +00:00
David Anderson
93218def8b unix: add sockaddr and defines for PPPoE sockets.
`sockaddr_pppox` is a packed struct, which godefs doesn't understand.
So, I had to do the byte packing by hand instead.

Change-Id: Ib92cf43f8ae0729a0af043c4241063911c95e6bf
GitHub-Last-Rev: 8982dec099
GitHub-Pull-Request: golang/sys#23
Reviewed-on: https://go-review.googlesource.com/c/149757
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-11-16 16:16:06 +00:00
Tobias Klauser
8a28ead16f unix: update Dockerfile to Linux 4.19
Change-Id: I58c2cfb11ddd5ce731a880c0c63790092052f130
Reviewed-on: https://go-review.googlesource.com/c/143697
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-22 13:44:30 +00:00
Tobias Klauser
8e24a49d80 unix: add SOF_TIMESTAMPING_* flags on Linux
Add the SOF_TIMESTAMPING_* flags used to request different types of
timestamping operations. In

  err := unix.SetsockoptInt(fd, unix.SOL_SOCKET, unix.SO_TIMESTAMPING, val)

val is a mask of SOF_TIMESTAMPING_* values.

See https://www.kernel.org/doc/Documentation/networking/timestamping.txt
for more information.

Fixes golang/go#28173

Change-Id: I26e964d607606f2b3cb24f66f071d11765b9696e
Reviewed-on: https://go-review.googlesource.com/c/143337
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-10-19 16:01:39 +00:00
Tobias Klauser
8469e31483 unix: export sizeof consts
Export the sizeof(Ptr|Short|Int|Long|LongLong) consts. This allows users
to get this information (e.g. for alignment purposes) without using cgo
or generating these constants themselves.

Change-Id: I8640482bf67b89c2f2b6e9a116ba7bc268f8135a
Reviewed-on: https://go-review.googlesource.com/c/139617
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-04 14:53:25 +00:00
Matt Layher
e4b3c5e906 unix: add NCSI generic netlink constants
Change-Id: I458f69e01fb64ff66f0b518c547d9eca3e8625cb
Reviewed-on: https://go-review.googlesource.com/138375
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-09-28 13:38:29 +00:00
Matt Layher
d47a0f3392 unix: implement Linux AF_XDP sockets
Provides access to the Linux AF_XDP socket family.  For more
information on AF_XDP, see:
https://www.kernel.org/doc/html/latest/networking/af_xdp.html.

Change-Id: I7efb82c4a67da3e15932e3c0d882f0bad7ba16ef
Reviewed-on: https://go-review.googlesource.com/136695
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-21 16:39:48 +00:00