nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
RawSyscall(SYS_CLOSE, uintptr(i), 0, 0)
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
_, _, err1 = RawSyscall(SYS_FCNTL, uintptr(fd[i]), F_SETFD, 0)
nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
RawSyscall(SYS_CLOSE, uintptr(i), 0, 0)
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
_, _, err1 = RawSyscall(SYS_FCNTL, uintptr(fd[i]), F_SETFD, 0)
nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
closeFD(uintptr(i))
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
_, err1 = fcntl1(uintptr(fd[i]), F_SETFD, 0)
nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
rawSyscall(abi.FuncPCABI0(libc_close_trampoline), uintptr(i), 0, 0)
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
_, _, err1 = rawSyscall(abi.FuncPCABI0(libc_fcntl_trampoline), uintptr(fd[i]), F_SETFD, 0)
nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
RawSyscall(SYS_CLOSE, uintptr(i), 0, 0)
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
_, _, err1 = RawSyscall(fcntl64Syscall, uintptr(fd[i]), F_SETFD, 0)
nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
RawSyscall(SYS_CLOSE, uintptr(i), 0, 0)
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
continue
}
r1, _, _ = RawSyscall(SYS_DUP, uintptr(fd[i]), uintptr(i), 0)
msg.Namelen = uint32(SizeofSockaddrAny)
var iov Iovec
if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
+ iov.Base = &p[0]
iov.SetLen(len(p))
}
var dummy byte
iov.Base = &dummy
iov.SetLen(1)
}
- msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
+ msg.Control = &oob[0]
msg.SetControllen(len(oob))
}
msg.Iov = &iov
func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
var msg Msghdr
- msg.Name = (*byte)(unsafe.Pointer(ptr))
+ msg.Name = (*byte)(ptr)
msg.Namelen = uint32(salen)
var iov Iovec
if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
+ iov.Base = &p[0]
iov.SetLen(len(p))
}
var dummy byte
iov.Base = &dummy
iov.SetLen(1)
}
- msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
+ msg.Control = &oob[0]
msg.SetControllen(len(oob))
}
msg.Iov = &iov
msg.Namelen = uint32(SizeofSockaddrAny)
var iov Iovec
if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
+ iov.Base = &p[0]
iov.SetLen(len(p))
}
var dummy byte
iov.Base = &dummy
iov.SetLen(1)
}
- msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
+ msg.Control = &oob[0]
msg.SetControllen(len(oob))
}
msg.Iov = &iov
func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
var msg Msghdr
- msg.Name = (*byte)(unsafe.Pointer(ptr))
+ msg.Name = (*byte)(ptr)
msg.Namelen = uint32(salen)
var iov Iovec
if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
+ iov.Base = &p[0]
iov.SetLen(len(p))
}
var dummy byte
iov.Base = &dummy
iov.SetLen(1)
}
- msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
+ msg.Control = &oob[0]
msg.SetControllen(len(oob))
}
msg.Iov = &iov
func fdopendir(fd int) (dir uintptr, err error) {
r0, _, e1 := syscallPtr(abi.FuncPCABI0(libc_fdopendir_trampoline), uintptr(fd), 0, 0)
- dir = uintptr(r0)
+ dir = r0
if e1 != 0 {
err = errnoErr(e1)
}