-47f256e1ed527b2eb4041acf90d33e6abc5e1685
+10c1d6756ed1dcc814c49921c2a5e27f4677e0e6
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
endif
if LIBGO_IS_LINUX
-go_net_cloexec_file = go/net/sock_cloexec.go
+go_net_cloexec_file = go/net/sock_cloexec.go go/net/hook_cloexec.go
+else
+if LIBGO_IS_FREEBSD
+go_net_cloexec_file = go/net/sock_cloexec.go go/net/hook_cloexec.go
else
go_net_cloexec_file = go/net/sys_cloexec.go
endif
+endif
if LIBGO_IS_OPENBSD
go_net_tcpsockopt_file = go/net/tcpsockopt_openbsd.go
go/net/file.go \
go/net/file_unix.go \
go/net/hook.go \
- go/net/hook_cloexec.go \
go/net/hook_unix.go \
go/net/hosts.go \
go/net/interface.go \
syscall_exec_test_file =
endif
+if LIBGO_IS_LINUX
+syscall_os_file =
+else
+syscall_os_file = go/syscall/libcall_bsd.go
+endif
+
go_base_syscall_files = \
go/syscall/env_unix.go \
go/syscall/syscall_errno.go \
$(syscall_sleep_file) \
$(syscall_errstr_file) \
$(syscall_size_file) \
+ $(syscall_os_file) \
$(syscall_socket_file) \
$(syscall_socket_os_file) \
$(syscall_socket_type_file) \
@LIBGO_IS_DRAGONFLY_TRUE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@go_net_interface_file = go/net/interface_dragonfly.go
@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@go_net_interface_file = go/net/interface_netbsd.go
@LIBGO_IS_LINUX_TRUE@go_net_interface_file = go/net/interface_linux.go
-@LIBGO_IS_LINUX_FALSE@go_net_cloexec_file = go/net/sys_cloexec.go
-@LIBGO_IS_LINUX_TRUE@go_net_cloexec_file = go/net/sock_cloexec.go
+@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_LINUX_FALSE@go_net_cloexec_file = go/net/sys_cloexec.go
+@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_LINUX_FALSE@go_net_cloexec_file = go/net/sock_cloexec.go go/net/hook_cloexec.go
+@LIBGO_IS_LINUX_TRUE@go_net_cloexec_file = go/net/sock_cloexec.go go/net/hook_cloexec.go
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_DRAGONFLY_FALSE@@LIBGO_IS_OPENBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@go_net_tcpsockopt_file = go/net/tcpsockopt_unix.go
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_DRAGONFLY_TRUE@@LIBGO_IS_OPENBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@go_net_tcpsockopt_file = go/net/tcpsockopt_dragonfly.go
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_OPENBSD_FALSE@@LIBGO_IS_SOLARIS_TRUE@go_net_tcpsockopt_file = go/net/tcpsockopt_solaris.go
go/net/file.go \
go/net/file_unix.go \
go/net/hook.go \
- go/net/hook_cloexec.go \
go/net/hook_unix.go \
go/net/hosts.go \
go/net/interface.go \
@LIBGO_IS_LINUX_TRUE@syscall_creds_test_file = go/syscall/creds_test.go
@LIBGO_IS_LINUX_FALSE@syscall_exec_test_file =
@LIBGO_IS_LINUX_TRUE@syscall_exec_test_file = go/syscall/exec_linux_test.go go/syscall/syscall_linux_test.go
+@LIBGO_IS_LINUX_FALSE@syscall_os_file = go/syscall/libcall_bsd.go
+@LIBGO_IS_LINUX_TRUE@syscall_os_file =
go_base_syscall_files = \
go/syscall/env_unix.go \
go/syscall/syscall_errno.go \
$(syscall_sleep_file) \
$(syscall_errstr_file) \
$(syscall_size_file) \
+ $(syscall_os_file) \
$(syscall_socket_file) \
$(syscall_socket_os_file) \
$(syscall_socket_type_file) \
-// Copyright 2015 The Go Authors. All rights reserved.
+// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// TCP socket options for solaris
+
package net
import (
"time"
)
+// Set keep alive period.
func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
if err := fd.incref(); err != nil {
return err
}
defer fd.decref()
- // The kernel expects milliseconds so round to next highest
- // millisecond.
- d += (time.Millisecond - time.Nanosecond)
- msecs := int(d / time.Millisecond)
- // Normally we'd do
- // syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, secs)
- // here, but we can't because Solaris does not have TCP_KEEPINTVL.
- // Solaris has TCP_KEEPALIVE_ABORT_THRESHOLD, but it's not the same
- // thing, it refers to the total time until aborting (not between
- // probes), and it uses an exponential backoff algorithm instead of
- // waiting the same time between probes. We can't hope for the best
- // and do it anyway, like on Darwin, because Solaris might eventually
- // allocate a constant with a different meaning for the value of
- // TCP_KEEPINTVL on illumos.
+ // The kernel expects seconds so round to next highest second.
+ d += (time.Second - time.Nanosecond)
+ secs := int(d.Seconds())
- return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE_THRESHOLD, msecs))
+ return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.SO_KEEPALIVE, secs))
}
}
if sys.Foreground {
- pgrp := sys.Pgid
+ pgrp := Pid_t(sys.Pgid)
if pgrp == 0 {
- r1 = raw_getpid()
-
- pgrp = int(r1)
+ pgrp = raw_getpid()
}
// Place process group in foreground.
}
if sys.Foreground {
- pgrp := int32(sys.Pgid)
+ pgrp := Pid_t(sys.Pgid)
if pgrp == 0 {
- r1 = uintptr(raw_getpid())
- if err1 != 0 {
- goto childerror
- }
-
- pgrp = int32(r1)
+ pgrp = raw_getpid()
}
// Place process group in foreground.
// using SIGKILL.
r1 := raw_getppid()
if r1 != ppid {
- pid = raw_getpid()
+ pid := raw_getpid()
err1 = raw_kill(pid, sys.Pdeathsig)
if err1 != 0 {
goto childerror
//sysnb raw_fork() (pid Pid_t, err Errno)
//fork() Pid_t
-//sysnb raw_getpid() (pid int)
+//sysnb raw_getpid() (pid Pid_t)
//getpid() Pid_t
-//sysnb raw_getppid() (pid int)
+//sysnb raw_getppid() (pid Pid_t)
//getppid() Pid_t
//sysnb raw_setsid() (err Errno)
//sysnb raw_dup2(oldfd int, newfd int) (err Errno)
//dup2(oldfd _C_int, newfd _C_int) _C_int
-//sysnb raw_kill(pid int, sig Signal) (err Errno)
+//sysnb raw_kill(pid Pid_t, sig Signal) (err Errno)
//kill(pid Pid_t, sig _C_int) _C_int
//sysnb raw_setgroups(size int, list unsafe.Pointer) (err Errno)
t.Skipf("Can't test Foreground. Couldn't open /dev/tty: %s", err)
}
- fpgrp := 0
+ fpgrp := syscall.Pid_t(0)
errno := syscall.Ioctl(tty.Fd(), syscall.TIOCGPGRP, uintptr(unsafe.Pointer(&fpgrp)))
if errno != 0 {
--- /dev/null
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// BSD library calls.
+
+package syscall
+
+import "unsafe"
+
+//sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error)
+//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+ if raceenabled {
+ raceReleaseMerge(unsafe.Pointer(&ioSync))
+ }
+ var soff Offset_t
+ var psoff *Offset_t
+ if offset != nil {
+ psoff = &soff
+ }
+ written, err = sendfile(outfd, infd, psoff, count)
+ if offset != nil {
+ *offset = int64(soff)
+ }
+ return
+}
#include <errno.h>
#include <stdint.h>
+#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>