import "syscall"
-func Hostname() (name string, err error) {
+func hostname() (name string, err error) {
var u syscall.Utsname
if errno := syscall.Uname(&u); errno != nil {
return "", NewSyscallError("uname", errno)
package syscall
import (
- "runtime"
"unsafe"
)
// Enable tracing if requested.
if sys.Ptrace {
- err1 = raw_trace(_PTRACE_TRACEME, 0, nil, nil)
+ err1 = raw_ptrace(_PTRACE_TRACEME, 0, nil, nil)
if err1 != 0 {
goto childerror
}
err1 = err2.(Errno)
goto childerror
}
- raw_fcntl(nextfd, F_SETFD, F_CLOEXEC)
+ raw_fcntl(nextfd, F_SETFD, FD_CLOEXEC)
fd[i] = nextfd
nextfd++
if nextfd == pipe { // don't stomp on pipe
// Detach fd 0 from tty
if sys.Noctty {
- _, err1 = raw_ioctl(0, IOTCNOTTY, 0)
+ _, err1 = raw_ioctl(0, TIOCNOTTY, 0)
if err1 != 0 {
goto childerror
}
// Make fd 0 the tty
if sys.Setctty {
- _, err1 = raw_ioctl(TIOCSCTTY, 0)
+ _, err1 = raw_ioctl(0, TIOCSCTTY, 0)
if err1 != 0 {
goto childerror
}
sed -e 's/^\(const \)_\(SHUT[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
# The net package requires some const definitions.
-for m in IPV6_V6ONLY IPPROTO_IPV6 IPV6_JOIN_GROUP IPV6_LEAVE_GROUP IPV6_TCLASS; do
+for m in IP_PKTINFO IPV6_V6ONLY IPPROTO_IPV6 IPV6_JOIN_GROUP IPV6_LEAVE_GROUP IPV6_TCLASS; do
if ! grep "^const $m " ${OUT} >/dev/null 2>&1; then
echo "const $m = 0" >> ${OUT}
fi