]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: rename close to closeFD
authorIan Lance Taylor <iant@golang.org>
Sat, 6 Aug 2022 20:28:20 +0000 (13:28 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 8 Aug 2022 20:38:29 +0000 (20:38 +0000)
...to avoid conflicts with the predeclared close function.

Change-Id: If6a19a004c390f4e0795ec207c72caa79a7281f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/421934
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/runtime/syscall_aix.go
src/syscall/asm_solaris_amd64.s
src/syscall/exec_libc.go

index f294922e7dd29b6f5f11e3d92fb8523062724b9a..cc9e912613dcacd1bf9f5ca7eaa0ed80e2d320aa 100644 (file)
@@ -127,9 +127,9 @@ func syscall_chroot1(path uintptr) (err uintptr) {
 
 // like close, but must not split stack, for fork.
 //
-//go:linkname syscall_close syscall.close
+//go:linkname syscall_closeFD syscall.closeFD
 //go:nosplit
-func syscall_close(fd int32) int32 {
+func syscall_closeFD(fd int32) int32 {
        _, err := syscall1(&libc_close, uintptr(fd))
        return int32(err)
 }
index 3672d3667fa126c290692cef0e20669437edea54..6891e9c8f96d5e335badbd3bf2a91fb3b686322b 100644 (file)
@@ -20,7 +20,7 @@ TEXT ·chdir(SB),NOSPLIT,$0
 TEXT ·chroot1(SB),NOSPLIT,$0
        JMP     runtime·syscall_chroot(SB)
 
-TEXT ·close(SB),NOSPLIT,$0
+TEXT ·closeFD(SB),NOSPLIT,$0
        JMP     runtime·syscall_close(SB)
 
 TEXT ·dup2child(SB),NOSPLIT,$0
index aee1b8c98ab3566028d2f1e588f7fab02a1f216c..72f73a268a05bedf73878fca49ab2e79c5ef8906 100644 (file)
@@ -43,7 +43,7 @@ func runtime_AfterForkInChild()
 
 func chdir(path uintptr) (err Errno)
 func chroot1(path uintptr) (err Errno)
-func close(fd uintptr) (err Errno)
+func closeFD(fd uintptr) (err Errno)
 func dup2child(old uintptr, new uintptr) (val uintptr, err Errno)
 func execve(path uintptr, argv uintptr, envp uintptr) (err Errno)
 func exit(code uintptr)
@@ -240,7 +240,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
        // Pass 2: dup fd[i] down onto i.
        for i = 0; i < len(fd); i++ {
                if fd[i] == -1 {
-                       close(uintptr(i))
+                       closeFD(uintptr(i))
                        continue
                }
                if fd[i] == int(i) {
@@ -265,7 +265,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
        // Programs that know they inherit fds >= 3 will need
        // to set them close-on-exec.
        for i = len(fd); i < 3; i++ {
-               close(uintptr(i))
+               closeFD(uintptr(i))
        }
 
        // Detach fd 0 from tty