currently occured below error:
In file included from /Users/zchee/go/src/golang.org/x/sys/unix/types_darwin.go:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:63:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/signal.h:146:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h:36:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h:35:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:482:2: error: unknown type name 'uint32_t'
uint32_t fpsr;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:483:2: error: unknown type name 'uint32_t'
uint32_t fpcr;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:489:2: error: unknown type name 'uint32_t'
uint32_t fpsr;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:490:2: error: unknown type name 'uint32_t'
uint32_t fpcr;
^
4 errors generated.
Change-Id: Iba2520fbf600914d3e8ed54b073039a6470846f7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/357070
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
In darwin/arm64, has the libc_fstat{fs} trampoline, not libc_fstat{fs}64.
But types_darwin.go defined same C types.
Change-Id: Ia33c60029eb59360e421f42ef79efe890eba3e3e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/357071
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Change-Id: Id53e2b0d0dc3b83762bb4ccc001d4e40f738de73
Reviewed-on: https://go-review.googlesource.com/c/sys/+/352209
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
On Linux, we can extract a list of all the processes on the system by
calling readdir() against /proc. On BSD-like systems, this information
needs to be extracted from sysctl in the form of kinfo_proc structures.
This change adds bindings for this structure and adds a method for
reading an array of these structures from sysctl.
Change-Id: Iaaed27cdbbf13d7c2cc6a6787667ac04d65bf41c
GitHub-Last-Rev: 34926f8474
GitHub-Pull-Request: golang/sys#111
Reviewed-on: https://go-review.googlesource.com/c/sys/+/328169
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild
Change-Id: I01667f826428426a39c84717d02efa25fa44553c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Russ Cox <rsc@golang.org>
See https://developer.apple.com/documentation/kernel/sockaddr_ctl for
details.
AF_SYSTEM is darwin-specific, so the BSD-specific anyToSockaddr func
needs to call GOOS-specific funcs which return nil, EAFNOSUPPORT on all
BSD platforms but darwin.
For golang/go#41868
Change-Id: Id7794aba5988dd9511053b76be5efeb66c104a26
Reviewed-on: https://go-review.googlesource.com/c/sys/+/264638
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Directly wrap the getcwd implementation provided by libSystem.dylib on
darwin and use it to implement Getwd like on the BSDs. This allows to
drop the custom implementation using getAttrList and to merge the
implementation of Getwd for darwin and the BSDs in syscall_bsd.go.
Change-Id: I62d38a239a7279fb95c912344bda2830856d4da4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/257497
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Add type Clockinfo and the SysctlClockinfo function to query clock rate
information from the kernel.
Change-Id: Ic29edcacee3b3f6125bb218b82c2a2496c39213a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/170297
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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>
Darwin doesn't have a uname syscall but the same information can be
retrieved using sysctls. Use the raw sysctl numbers instead of doing the
roundtrip via SysctlString in order to void the additional sysctl calls
in nametomib and SysctlRaw.
This implementation follows the one in
https://opensource.apple.com/source/Libc/Libc-1244.1.7/gen/uname.c
Change-Id: I19541e2a6700f84ced0549a8fb86faa8cb5e6fbe
Reviewed-on: https://go-review.googlesource.com/77270
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>
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, Fchownat, Linkat, Mkdirat, Openat, Readlinkat,
Renameat, Symlinkat and Unlinkat functions (to conform to POSIX.1-2008)
and make Fchmodat available on all architectures, not just amd64. Also
add the missing AT_* constants.
Generated on Mac OS 10.11 (Darwin 15.6.0) for darwin/amd64 and
darwin/386 only.
Fixesgolang/go#14458
Change-Id: I6d9258864383ea77f9cad058ee8ba2c728213b40
Reviewed-on: https://go-review.googlesource.com/50450
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Right now the process for adding in new constants, errors, or syscalls
for Linux is a pain and unreliable. The scripts are designed to be run
on the target architecture and use the header files installed on the
user's system. This makes it hard to generate files for all the
architectures or to have consistency between users. See golang/go#15282.
This CL fixes this issue by making all of the files for the 11 supported
architectures directly from source checkouts of Linux, glibc, and bluez.
This is done using Docker, the gcc cross-compilers, and qemu emulation.
Previously discussed here:
https://go-review.googlesource.com/c/37589/
A README.md file is also added to explain how all the parts of the build
system work.
In order to get the build working for all the architectures, I made
some changes to the other scripts called from mkall_linux.go:
- Files only used for generating linux code, moved to linux/
- linux/mksysnum.pl supports a specified CC compiler.
- The generated C code in mkerrors.sh changed to avoid a warning
- mkerrors.sh headers changed to fix powerpc64 bug in sys/ioctl.h
- linux/types.go no longer needs to export Ptrace structs in lowercase
Build instructions:
- Host system needs to be x86-64 Linux
- Install Docker (https://docs.docker.com/engine/installation/)
- ./mkall.sh (That's it!!!)
Change-Id: I87067c14442ba12f8d51991349a43a9d73f38ae0
Reviewed-on: https://go-review.googlesource.com/37943
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
These are already exposed on Linux. I believe they were left out of
darwin because fchmodat didn't exist on older versions of XNU.
Change-Id: I166f2b23270937c1b6cc3bd73e7f7b72d2d488e9
Reviewed-on: https://go-review.googlesource.com/14092
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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
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