Skip to content

Commit 4cafe5c

Browse files
zcheegopherbot
authored andcommitted
unix: implements RenamexNp and RenameatxNp for darwin
Fixes golang/go#48425 Change-Id: Ib3619863e238eadf09da479bd2e1e47d9ab6f274 Reviewed-on: https://go-review.googlesource.com/c/sys/+/361958 Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent faed7ec commit 4cafe5c

10 files changed

+143
-0
lines changed

unix/darwin_amd64_test.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/darwin_arm64_test.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/mkerrors.sh

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ includes_Darwin='
5858
#define _DARWIN_USE_64_BIT_INODE
5959
#define __APPLE_USE_RFC_3542
6060
#include <stdint.h>
61+
#include <sys/stdio.h>
6162
#include <sys/attr.h>
6263
#include <sys/clonefile.h>
6364
#include <sys/kern_control.h>

unix/syscall_darwin.go

+12
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,18 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error {
402402
return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq))
403403
}
404404

405+
//sys renamexNp(from string, to string, flag uint32) (err error)
406+
407+
func RenamexNp(from string, to string, flag uint32) (err error) {
408+
return renamexNp(from, to, flag)
409+
}
410+
411+
//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error)
412+
413+
func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) {
414+
return renameatxNp(fromfd, from, tofd, to, flag)
415+
}
416+
405417
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
406418

407419
func Uname(uname *Utsname) error {

unix/zerrors_darwin_amd64.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zerrors_darwin_arm64.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zsyscall_darwin_amd64.go

+48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zsyscall_darwin_amd64.s

+10
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,16 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
223223
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
224224
DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB)
225225

226+
TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0
227+
JMP libc_renamex_np(SB)
228+
GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8
229+
DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB)
230+
231+
TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0
232+
JMP libc_renameatx_np(SB)
233+
GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8
234+
DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB)
235+
226236
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
227237
JMP libc_sysctl(SB)
228238
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8

unix/zsyscall_darwin_arm64.go

+48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zsyscall_darwin_arm64.s

+10
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,16 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
223223
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
224224
DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB)
225225

226+
TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0
227+
JMP libc_renamex_np(SB)
228+
GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8
229+
DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB)
230+
231+
TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0
232+
JMP libc_renameatx_np(SB)
233+
GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8
234+
DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB)
235+
226236
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
227237
JMP libc_sysctl(SB)
228238
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8

0 commit comments

Comments
 (0)