Skip to content

Commit 28074d5

Browse files
syscall: change Dup,Dup2,Dup3 to use Syscall, not RawSyscall
This avoids hanging when a Go program uses a FUSE filesystem and the dup system call has to close a file descriptor. When dup uses RawSyscall then the goroutine calling dup will occupy a scheduler slot (a p structure) during the call, and may block waiting for some other goroutine to respond to the close call on the FUSE filesystem. Changing to Syscall avoids the problem. This makes Dup a tiny bit slower but is quite unlikely to make a difference for any real programs. Fixes #10202. Change-Id: If6490a8f9b3c9cfed6acbfb4bfd1eaeac62ced17 Reviewed-on: https://go-review.googlesource.com/8095 Reviewed-by: Rob Pike <[email protected]>
1 parent ec2c7e6 commit 28074d5

29 files changed

+59
-59
lines changed

src/syscall/syscall_darwin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
222222
//sys Chown(path string, uid int, gid int) (err error)
223223
//sys Chroot(path string) (err error)
224224
//sys Close(fd int) (err error)
225-
//sysnb Dup(fd int) (nfd int, err error)
226-
//sysnb Dup2(from int, to int) (err error)
225+
//sys Dup(fd int) (nfd int, err error)
226+
//sys Dup2(from int, to int) (err error)
227227
//sys Exchangedata(path1 string, path2 string, options int) (err error)
228228
//sys Exit(code int)
229229
//sys Fchdir(fd int) (err error)

src/syscall/syscall_dragonfly.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
127127
//sys Chown(path string, uid int, gid int) (err error)
128128
//sys Chroot(path string) (err error)
129129
//sys Close(fd int) (err error)
130-
//sysnb Dup(fd int) (nfd int, err error)
131-
//sysnb Dup2(from int, to int) (err error)
130+
//sys Dup(fd int) (nfd int, err error)
131+
//sys Dup2(from int, to int) (err error)
132132
//sys Exit(code int)
133133
//sys Fchdir(fd int) (err error)
134134
//sys Fchflags(fd int, flags int) (err error)

src/syscall/syscall_freebsd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
147147
//sys Chown(path string, uid int, gid int) (err error)
148148
//sys Chroot(path string) (err error)
149149
//sys Close(fd int) (err error)
150-
//sysnb Dup(fd int) (nfd int, err error)
151-
//sysnb Dup2(from int, to int) (err error)
150+
//sys Dup(fd int) (nfd int, err error)
151+
//sys Dup2(from int, to int) (err error)
152152
//sys Exit(code int)
153153
//sys Fchdir(fd int) (err error)
154154
//sys Fchflags(fd int, flags int) (err error)

src/syscall/syscall_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,8 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
820820
//sys Chdir(path string) (err error)
821821
//sys Chroot(path string) (err error)
822822
//sys Close(fd int) (err error)
823-
//sysnb Dup(oldfd int) (fd int, err error)
824-
//sysnb Dup3(oldfd int, newfd int, flags int) (err error)
823+
//sys Dup(oldfd int) (fd int, err error)
824+
//sys Dup3(oldfd int, newfd int, flags int) (err error)
825825
//sysnb EpollCreate(size int) (fd int, err error)
826826
//sysnb EpollCreate1(flag int) (fd int, err error)
827827
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)

src/syscall/syscall_linux_386.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func Pipe2(p []int, flags int) (err error) {
5858

5959
// 64-bit file system and 32-bit uid calls
6060
// (386 default is 32-bit file system and 16-bit uid).
61-
//sysnb Dup2(oldfd int, newfd int) (err error)
61+
//sys Dup2(oldfd int, newfd int) (err error)
6262
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
6363
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
6464
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64

src/syscall/syscall_linux_amd64.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package syscall
66

77
const _SYS_dup = SYS_DUP2
88

9-
//sysnb Dup2(oldfd int, newfd int) (err error)
9+
//sys Dup2(oldfd int, newfd int) (err error)
1010
//sys Fchown(fd int, uid int, gid int) (err error)
1111
//sys Fstat(fd int, stat *Stat_t) (err error)
1212
//sys Fstatfs(fd int, buf *Statfs_t) (err error)

src/syscall/syscall_linux_arm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
8080

8181
// 64-bit file system and 32-bit uid calls
8282
// (16-bit uid calls are not always supported in newer kernels)
83-
//sysnb Dup2(oldfd int, newfd int) (err error)
83+
//sys Dup2(oldfd int, newfd int) (err error)
8484
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
8585
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
8686
//sysnb Getegid() (egid int) = SYS_GETEGID32

src/syscall/syscall_linux_ppc64x.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package syscall
99

1010
const _SYS_dup = SYS_DUP2
1111

12-
//sysnb Dup2(oldfd int, newfd int) (err error)
12+
//sys Dup2(oldfd int, newfd int) (err error)
1313
//sys Fchown(fd int, uid int, gid int) (err error)
1414
//sys Fstat(fd int, stat *Stat_t) (err error)
1515
//sys Fstatfs(fd int, buf *Statfs_t) (err error)

src/syscall/syscall_netbsd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
148148
//sys Chown(path string, uid int, gid int) (err error)
149149
//sys Chroot(path string) (err error)
150150
//sys Close(fd int) (err error)
151-
//sysnb Dup(fd int) (nfd int, err error)
152-
//sysnb Dup2(from int, to int) (err error)
151+
//sys Dup(fd int) (nfd int, err error)
152+
//sys Dup2(from int, to int) (err error)
153153
//sys Exit(code int)
154154
//sys Fchdir(fd int) (err error)
155155
//sys Fchflags(fd int, flags int) (err error)

src/syscall/syscall_openbsd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
126126
//sys Chown(path string, uid int, gid int) (err error)
127127
//sys Chroot(path string) (err error)
128128
//sys Close(fd int) (err error)
129-
//sysnb Dup(fd int) (nfd int, err error)
130-
//sysnb Dup2(from int, to int) (err error)
129+
//sys Dup(fd int) (nfd int, err error)
130+
//sys Dup2(from int, to int) (err error)
131131
//sys Exit(code int)
132132
//sys Fchdir(fd int) (err error)
133133
//sys Fchflags(fd int, flags int) (err error)

src/syscall/zsyscall_darwin_386.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ func Close(fd int) (err error) {
409409
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
410410

411411
func Dup(fd int) (nfd int, err error) {
412-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
412+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
413413
nfd = int(r0)
414414
if e1 != 0 {
415415
err = e1
@@ -420,7 +420,7 @@ func Dup(fd int) (nfd int, err error) {
420420
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
421421

422422
func Dup2(from int, to int) (err error) {
423-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
423+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
424424
if e1 != 0 {
425425
err = e1
426426
}

src/syscall/zsyscall_darwin_amd64.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ func Close(fd int) (err error) {
409409
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
410410

411411
func Dup(fd int) (nfd int, err error) {
412-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
412+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
413413
nfd = int(r0)
414414
if e1 != 0 {
415415
err = e1
@@ -420,7 +420,7 @@ func Dup(fd int) (nfd int, err error) {
420420
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
421421

422422
func Dup2(from int, to int) (err error) {
423-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
423+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
424424
if e1 != 0 {
425425
err = e1
426426
}

src/syscall/zsyscall_darwin_arm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ func Close(fd int) (err error) {
409409
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
410410

411411
func Dup(fd int) (nfd int, err error) {
412-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
412+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
413413
nfd = int(r0)
414414
if e1 != 0 {
415415
err = e1
@@ -420,7 +420,7 @@ func Dup(fd int) (nfd int, err error) {
420420
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
421421

422422
func Dup2(from int, to int) (err error) {
423-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
423+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
424424
if e1 != 0 {
425425
err = e1
426426
}

src/syscall/zsyscall_dragonfly_amd64.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func Close(fd int) (err error) {
423423
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
424424

425425
func Dup(fd int) (nfd int, err error) {
426-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
426+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
427427
nfd = int(r0)
428428
if e1 != 0 {
429429
err = e1
@@ -434,7 +434,7 @@ func Dup(fd int) (nfd int, err error) {
434434
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
435435

436436
func Dup2(from int, to int) (err error) {
437-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
437+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
438438
if e1 != 0 {
439439
err = e1
440440
}

src/syscall/zsyscall_freebsd_386.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func Close(fd int) (err error) {
389389
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
390390

391391
func Dup(fd int) (nfd int, err error) {
392-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
392+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
393393
nfd = int(r0)
394394
if e1 != 0 {
395395
err = e1
@@ -400,7 +400,7 @@ func Dup(fd int) (nfd int, err error) {
400400
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
401401

402402
func Dup2(from int, to int) (err error) {
403-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
403+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
404404
if e1 != 0 {
405405
err = e1
406406
}

src/syscall/zsyscall_freebsd_amd64.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func Close(fd int) (err error) {
389389
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
390390

391391
func Dup(fd int) (nfd int, err error) {
392-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
392+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
393393
nfd = int(r0)
394394
if e1 != 0 {
395395
err = e1
@@ -400,7 +400,7 @@ func Dup(fd int) (nfd int, err error) {
400400
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
401401

402402
func Dup2(from int, to int) (err error) {
403-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
403+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
404404
if e1 != 0 {
405405
err = e1
406406
}

src/syscall/zsyscall_freebsd_arm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func Close(fd int) (err error) {
389389
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
390390

391391
func Dup(fd int) (nfd int, err error) {
392-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
392+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
393393
nfd = int(r0)
394394
if e1 != 0 {
395395
err = e1
@@ -400,7 +400,7 @@ func Dup(fd int) (nfd int, err error) {
400400
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
401401

402402
func Dup2(from int, to int) (err error) {
403-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
403+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
404404
if e1 != 0 {
405405
err = e1
406406
}

src/syscall/zsyscall_linux_386.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func Close(fd int) (err error) {
301301
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
302302

303303
func Dup(oldfd int) (fd int, err error) {
304-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
304+
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
305305
fd = int(r0)
306306
if e1 != 0 {
307307
err = e1
@@ -312,7 +312,7 @@ func Dup(oldfd int) (fd int, err error) {
312312
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
313313

314314
func Dup3(oldfd int, newfd int, flags int) (err error) {
315-
_, _, e1 := RawSyscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
315+
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
316316
if e1 != 0 {
317317
err = e1
318318
}
@@ -1227,7 +1227,7 @@ func pipe2(p *[2]_C_int, flags int) (err error) {
12271227
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
12281228

12291229
func Dup2(oldfd int, newfd int) (err error) {
1230-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
1230+
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
12311231
if e1 != 0 {
12321232
err = e1
12331233
}

src/syscall/zsyscall_linux_amd64.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func Close(fd int) (err error) {
301301
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
302302

303303
func Dup(oldfd int) (fd int, err error) {
304-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
304+
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
305305
fd = int(r0)
306306
if e1 != 0 {
307307
err = e1
@@ -312,7 +312,7 @@ func Dup(oldfd int) (fd int, err error) {
312312
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
313313

314314
func Dup3(oldfd int, newfd int, flags int) (err error) {
315-
_, _, e1 := RawSyscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
315+
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
316316
if e1 != 0 {
317317
err = e1
318318
}
@@ -1207,7 +1207,7 @@ func Munlockall() (err error) {
12071207
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
12081208

12091209
func Dup2(oldfd int, newfd int) (err error) {
1210-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
1210+
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
12111211
if e1 != 0 {
12121212
err = e1
12131213
}

src/syscall/zsyscall_linux_arm.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func Close(fd int) (err error) {
301301
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
302302

303303
func Dup(oldfd int) (fd int, err error) {
304-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
304+
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
305305
fd = int(r0)
306306
if e1 != 0 {
307307
err = e1
@@ -312,7 +312,7 @@ func Dup(oldfd int) (fd int, err error) {
312312
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
313313

314314
func Dup3(oldfd int, newfd int, flags int) (err error) {
315-
_, _, e1 := RawSyscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
315+
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
316316
if e1 != 0 {
317317
err = e1
318318
}
@@ -1396,7 +1396,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
13961396
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
13971397

13981398
func Dup2(oldfd int, newfd int) (err error) {
1399-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
1399+
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
14001400
if e1 != 0 {
14011401
err = e1
14021402
}

src/syscall/zsyscall_linux_arm64.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func Close(fd int) (err error) {
301301
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
302302

303303
func Dup(oldfd int) (fd int, err error) {
304-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
304+
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
305305
fd = int(r0)
306306
if e1 != 0 {
307307
err = e1
@@ -312,7 +312,7 @@ func Dup(oldfd int) (fd int, err error) {
312312
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
313313

314314
func Dup3(oldfd int, newfd int, flags int) (err error) {
315-
_, _, e1 := RawSyscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
315+
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
316316
if e1 != 0 {
317317
err = e1
318318
}

src/syscall/zsyscall_linux_ppc64.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func Close(fd int) (err error) {
301301
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
302302

303303
func Dup(oldfd int) (fd int, err error) {
304-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
304+
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
305305
fd = int(r0)
306306
if e1 != 0 {
307307
err = e1
@@ -312,7 +312,7 @@ func Dup(oldfd int) (fd int, err error) {
312312
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
313313

314314
func Dup3(oldfd int, newfd int, flags int) (err error) {
315-
_, _, e1 := RawSyscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
315+
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
316316
if e1 != 0 {
317317
err = e1
318318
}
@@ -1207,7 +1207,7 @@ func Munlockall() (err error) {
12071207
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
12081208

12091209
func Dup2(oldfd int, newfd int) (err error) {
1210-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
1210+
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
12111211
if e1 != 0 {
12121212
err = e1
12131213
}

src/syscall/zsyscall_linux_ppc64le.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func Close(fd int) (err error) {
301301
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
302302

303303
func Dup(oldfd int) (fd int, err error) {
304-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(oldfd), 0, 0)
304+
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
305305
fd = int(r0)
306306
if e1 != 0 {
307307
err = e1
@@ -312,7 +312,7 @@ func Dup(oldfd int) (fd int, err error) {
312312
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
313313

314314
func Dup3(oldfd int, newfd int, flags int) (err error) {
315-
_, _, e1 := RawSyscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
315+
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
316316
if e1 != 0 {
317317
err = e1
318318
}
@@ -1207,7 +1207,7 @@ func Munlockall() (err error) {
12071207
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
12081208

12091209
func Dup2(oldfd int, newfd int) (err error) {
1210-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
1210+
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
12111211
if e1 != 0 {
12121212
err = e1
12131213
}

src/syscall/zsyscall_netbsd_386.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func Close(fd int) (err error) {
406406
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
407407

408408
func Dup(fd int) (nfd int, err error) {
409-
r0, _, e1 := RawSyscall(SYS_DUP, uintptr(fd), 0, 0)
409+
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
410410
nfd = int(r0)
411411
if e1 != 0 {
412412
err = e1
@@ -417,7 +417,7 @@ func Dup(fd int) (nfd int, err error) {
417417
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
418418

419419
func Dup2(from int, to int) (err error) {
420-
_, _, e1 := RawSyscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
420+
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
421421
if e1 != 0 {
422422
err = e1
423423
}

0 commit comments

Comments
 (0)