2016-03-01 15:57:46 -07:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
2014-09-06 11:35:46 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package runtime
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
var (
|
|
|
|
libc_chdir,
|
|
|
|
libc_chroot,
|
|
|
|
libc_execve,
|
|
|
|
libc_fcntl,
|
|
|
|
libc_forkx,
|
|
|
|
libc_gethostname,
|
2015-02-17 20:23:16 -07:00
|
|
|
libc_getpid,
|
2014-09-06 11:35:46 -06:00
|
|
|
libc_ioctl,
|
|
|
|
libc_pipe,
|
|
|
|
libc_setgid,
|
|
|
|
libc_setgroups,
|
|
|
|
libc_setsid,
|
|
|
|
libc_setuid,
|
|
|
|
libc_setpgid,
|
|
|
|
libc_syscall,
|
|
|
|
libc_wait4,
|
|
|
|
pipe1 libcFunc
|
|
|
|
)
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_sysvicall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
|
|
|
|
call := libcall{
|
2014-09-14 20:20:01 -06:00
|
|
|
fn: fn,
|
2014-09-06 11:35:46 -06:00
|
|
|
n: nargs,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&a1)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
entersyscallblock(0)
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
exitsyscall(0)
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.r2, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_rawsysvicall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
|
|
|
|
call := libcall{
|
2014-09-14 20:20:01 -06:00
|
|
|
fn: fn,
|
2014-09-06 11:35:46 -06:00
|
|
|
n: nargs,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&a1)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.r2, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(aram): Once we remove all instances of C calling sysvicallN, make
|
|
|
|
// sysvicallN return errors and replace the body of the following functions
|
|
|
|
// with calls to sysvicallN.
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_chdir(path uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_chdir)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 1,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&path)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_chroot(path uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_chroot)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 1,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&path)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
// like close, but must not split stack, for forkx.
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_close(fd int32) int32 {
|
2015-03-30 05:52:07 -06:00
|
|
|
return int32(sysvicall1(&libc_close, uintptr(fd)))
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_execve(path, argv, envp uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_execve)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 3,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&path)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
// like exit, but must not split stack, for forkx.
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_exit(code uintptr) {
|
2015-03-30 05:52:07 -06:00
|
|
|
sysvicall1(&libc_exit, code)
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_fcntl(fd, cmd, arg uintptr) (val, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_fcntl)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 3,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&fd)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_forkx(flags uintptr) (pid uintptr, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_forkx)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 1,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&flags)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func syscall_gethostname() (name string, err uintptr) {
|
|
|
|
cname := new([_MAXHOSTNAMELEN]byte)
|
|
|
|
var args = [2]uintptr{uintptr(unsafe.Pointer(&cname[0])), _MAXHOSTNAMELEN}
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_gethostname)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 2,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&args[0])),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
entersyscallblock(0)
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
exitsyscall(0)
|
2014-09-06 11:35:46 -06:00
|
|
|
if call.r1 != 0 {
|
|
|
|
return "", call.err
|
|
|
|
}
|
|
|
|
cname[_MAXHOSTNAMELEN-1] = 0
|
|
|
|
return gostringnocopy(&cname[0]), 0
|
|
|
|
}
|
|
|
|
|
2015-02-17 20:23:16 -07:00
|
|
|
//go:nosplit
|
|
|
|
func syscall_getpid() (pid, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_getpid)),
|
2015-02-17 20:23:16 -07:00
|
|
|
n: 0,
|
2015-03-30 05:52:07 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&libc_getpid)), // it's unused but must be non-nil, otherwise crashes
|
2015-02-17 20:23:16 -07:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2015-02-17 20:23:16 -07:00
|
|
|
return call.r1, call.err
|
|
|
|
}
|
|
|
|
|
2014-09-06 11:35:46 -06:00
|
|
|
//go:nosplit
|
|
|
|
func syscall_ioctl(fd, req, arg uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_ioctl)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 3,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&fd)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func syscall_pipe() (r, w, err uintptr) {
|
|
|
|
call := libcall{
|
2014-09-14 20:20:01 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&pipe1)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 0,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&pipe1)), // it's unused but must be non-nil, otherwise crashes
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
entersyscallblock(0)
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
exitsyscall(0)
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.r2, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is syscall.RawSyscall, it exists to satisfy some build dependency,
|
|
|
|
// but it doesn't work correctly.
|
|
|
|
//
|
|
|
|
// DO NOT USE!
|
|
|
|
//
|
|
|
|
// TODO(aram): make this panic once we stop calling fcntl(2) in net using it.
|
|
|
|
func syscall_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_syscall)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 4,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&trap)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.r2, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_setgid(gid uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_setgid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 1,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&gid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_setgroups(ngid, gid uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_setgroups)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 2,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&ngid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_setsid() (pid, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_setsid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 0,
|
2015-03-30 05:52:07 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&libc_setsid)), // it's unused but must be non-nil, otherwise crashes
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_setuid(uid uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_setuid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 1,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&uid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_setpgid(pid, pgid uintptr) (err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_setpgid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 2,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&pid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is syscall.Syscall, it exists to satisfy some build dependency,
|
|
|
|
// but it doesn't work correctly.
|
|
|
|
//
|
|
|
|
// DO NOT USE!
|
|
|
|
//
|
|
|
|
// TODO(aram): make this panic once we stop calling fcntl(2) in net using it.
|
|
|
|
func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_syscall)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 4,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&trap)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
entersyscallblock(0)
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
exitsyscall(0)
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.r2, call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func syscall_wait4(pid uintptr, wstatus *uint32, options uintptr, rusage unsafe.Pointer) (wpid int, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_wait4)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 4,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&pid)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
entersyscallblock(0)
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
[dev.cc] runtime: convert Solaris port to Go
Memory management was consolitated with the BSD ports, since
it was almost identical.
Assembly thunks are gone, being replaced by the new //go:linkname
feature.
This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.
This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:
ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
Killed
This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.
Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043
2014-11-13 08:07:10 -07:00
|
|
|
exitsyscall(0)
|
2014-09-06 11:35:46 -06:00
|
|
|
return int(call.r1), call.err
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:nosplit
|
|
|
|
func syscall_write(fd, buf, nbyte uintptr) (n, err uintptr) {
|
|
|
|
call := libcall{
|
2015-03-30 05:52:07 -06:00
|
|
|
fn: uintptr(unsafe.Pointer(&libc_write)),
|
2014-09-06 11:35:46 -06:00
|
|
|
n: 3,
|
2014-09-14 20:20:01 -06:00
|
|
|
args: uintptr(unsafe.Pointer(&fd)),
|
2014-09-06 11:35:46 -06:00
|
|
|
}
|
2015-04-27 01:32:23 -06:00
|
|
|
asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(&call))
|
2014-09-06 11:35:46 -06:00
|
|
|
return call.r1, call.err
|
|
|
|
}
|