summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/libc_darwin_amd64.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/modernc.org/libc/libc_darwin_amd64.go')
-rw-r--r--vendor/modernc.org/libc/libc_darwin_amd64.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/modernc.org/libc/libc_darwin_amd64.go b/vendor/modernc.org/libc/libc_darwin_amd64.go
index ab1ed5c46..e8f46c49e 100644
--- a/vendor/modernc.org/libc/libc_darwin_amd64.go
+++ b/vendor/modernc.org/libc/libc_darwin_amd64.go
@@ -377,14 +377,13 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 {
// int dup2(int oldfd, int newfd);
func Xdup2(t *TLS, oldfd, newfd int32) int32 {
- panic(todo(""))
- // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
- // if err != 0 {
- // t.setErrno(err)
- // return -1
- // }
+ n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
+ if err != 0 {
+ t.setErrno(err)
+ return -1
+ }
- // return int32(n)
+ return int32(n)
}
// ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize);