-f2b7a2ce94127ad444a772bd1631516c5c67fb73
+77bc32767b61feb6499ca7921e96b356603517dc
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
import (
"sync/atomic"
"syscall"
- "unsafe"
)
//extern getrandom
func libc_getrandom(*byte, uintptr, uint32) uintptr
+var getrandomUnsupported int32 // atomic
+
// GetRandomFlag is a flag supported by the getrandom system call.
type GetRandomFlag uintptr
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build solaris
-// +build cgo
+//go:build solaris && cgo
+// +build solaris,cgo
package user
//extern __posix_getgrgid_r
func libc_getgrgid_r(gid syscall.Gid_t, grp *syscall.Group, buf *byte, buflen syscall.Size_t, result **syscall.Group) int
+
+//extern getgrouplist
+func libc_getgrouplist(user *byte, group syscall.Gid_t, groups *syscall.Gid_t, ngroups *int32) int
// Test that runtime.abort does so.
func TestAbort(t *testing.T) {
+ if runtime.Compiler == "gccgo" && runtime.GOOS == "solaris" {
+ t.Skip("not supported by gofrontend on Solaris")
+ }
+
// Pass GOTRACEBACK to ensure we get runtime frames.
output := runTestProg(t, "testprog", "Abort", "GOTRACEBACK=system")
if want := "runtime.abort"; !strings.Contains(output, want) {
// Test that g0 stack overflows are handled gracefully.
func TestG0StackOverflow(t *testing.T) {
+ if runtime.Compiler == "gccgo" {
+ t.Skip("g0 stack overflow not supported by gofrontend")
+ }
+
testenv.MustHaveExec(t)
switch runtime.GOOS {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build dragonfly || freebsd || hurd || netbsd || (openbsd && mips64)
-// +build dragonfly freebsd hurd netbsd openbsd,mips64
+//go:build aix || darwin || dragonfly || freebsd || hurd || netbsd || openbsd || solaris
+// +build aix darwin dragonfly freebsd hurd netbsd openbsd solaris
package syscall
fpgrp := syscall.Pid_t(0)
- errno := syscall.Ioctl(tty.Fd(), syscall.TIOCGPGRP, uintptr(unsafe.Pointer(&fpgrp)))
+ errno := syscall.Ioctl(tty.Fd(), syscall.TIOCGPGRP, unsafe.Pointer(&fpgrp))
if errno != 0 {
t.Fatalf("TIOCGPGRP failed with error code: %s", errno)
}
// This call fails on darwin/arm64. The failure doesn't matter, though.
// This is just best effort.
- syscall.Ioctl(tty.Fd(), syscall.TIOCSPGRP, uintptr(unsafe.Pointer(&fpgrp)))
+ syscall.Ioctl(tty.Fd(), syscall.TIOCSPGRP, unsafe.Pointer(&fpgrp))
}
func TestForegroundSignal(t *testing.T) {
// equivalent.
fpgrp := int32(0)
- errno := syscall.Ioctl(tty.Fd(), syscall.TIOCGPGRP, uintptr(unsafe.Pointer(&fpgrp)))
+ errno := syscall.Ioctl(tty.Fd(), syscall.TIOCGPGRP, unsafe.Pointer(&fpgrp))
if errno != 0 {
t.Fatalf("TIOCGPGRP failed with error code: %s", errno)
}
defer func() {
signal.Ignore(syscall.SIGTTIN, syscall.SIGTTOU)
- syscall.Ioctl(tty.Fd(), syscall.TIOCSPGRP, uintptr(unsafe.Pointer(&fpgrp)))
+ syscall.Ioctl(tty.Fd(), syscall.TIOCSPGRP, unsafe.Pointer(&fpgrp))
signal.Reset()
}()
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix
// +build aix
package syscall
"unsafe"
)
-func Ioctl(fd, req, arg uintptr) (err Errno) {
- _, err = raw_ioctl_ptr(int(fd), req, unsafe.Pointer(arg))
+func Ioctl(fd, req uintptr, arg unsafe.Pointer) (err Errno) {
+ _, err = raw_ioctl_ptr(int(fd), req, arg)
return err
}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build dragonfly || freebsd || hurd || linux || netbsd || openbsd
-// +build dragonfly freebsd hurd linux netbsd openbsd
+//go:build dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
+// +build dragonfly freebsd hurd linux netbsd openbsd solaris
package syscall
-func Ioctl(fd, req, arg uintptr) (err Errno) {
- _, _, err = Syscall(SYS_IOCTL, fd, req, arg)
+import "unsafe"
+
+func Ioctl(fd, req uintptr, arg unsafe.Pointer) (err Errno) {
+ _, err = raw_ioctl_ptr(int(fd), req, arg)
return err
}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build linux
+// +build linux
+
// GNU/Linux version of UtimesNano.
package syscall
# boundsError has a field name that is a C keyword, and we don't need it.
# mSpanInuse is both a constant and a field name, and we don't need it.
-grep -v "#define _" ${IN} | grep -v "#define [cm][01234] " | grep -v "#define empty " | grep -v "#define \\$" | grep -v "#define mSpanInUse " > runtime.inc.tmp2
+grep -v "#define _" ${IN} | grep -v "#define [cm][012345] " | grep -v "#define empty " | grep -v "#define \\$" | grep -v "#define mSpanInUse " > runtime.inc.tmp2
for pattern in '_[GP][a-z]' _Max _Lock _Sig _Trace _MHeap _Num
do
grep "#define $pattern" ${IN} >> runtime.inc.tmp2