aboutsummaryrefslogtreecommitdiff
path: root/src/internal/syscall/unix/at.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/syscall/unix/at.go')
-rw-r--r--src/internal/syscall/unix/at.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/internal/syscall/unix/at.go b/src/internal/syscall/unix/at.go
index 794f8ace14..be7920c115 100644
--- a/src/internal/syscall/unix/at.go
+++ b/src/internal/syscall/unix/at.go
@@ -114,3 +114,25 @@ func Fchownat(dirfd int, path string, uid, gid int, flags int) error {
}
return nil
}
+
+func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) error {
+ oldp, err := syscall.BytePtrFromString(oldpath)
+ if err != nil {
+ return err
+ }
+ newp, err := syscall.BytePtrFromString(newpath)
+ if err != nil {
+ return err
+ }
+ _, _, errno := syscall.Syscall6(renameatTrap,
+ uintptr(olddirfd),
+ uintptr(unsafe.Pointer(oldp)),
+ uintptr(newdirfd),
+ uintptr(unsafe.Pointer(newp)),
+ 0,
+ 0)
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}