From 7315cfda3569251f16db8c309b91419e66f81c9b Mon Sep 17 00:00:00 2001 From: debris Date: Mon, 4 Jun 2018 15:51:32 +0200 Subject: added renameat2, renamex_np, renameatx_np --- src/unix/bsd/apple/mod.rs | 8 ++++++++ src/unix/notbsd/linux/mod.rs | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index d97eb3f4f6..147ee80c24 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1859,6 +1859,9 @@ pub const NI_MAXHOST: ::socklen_t = 1025; pub const Q_GETQUOTA: ::c_int = 0x300; pub const Q_SETQUOTA: ::c_int = 0x400; +pub const RENAME_SWAP: ::c_uint = 0x00000002; +pub const RENAME_EXCL: ::c_uint = 0x00000004; + pub const RTLD_LOCAL: ::c_int = 0x4; pub const RTLD_FIRST: ::c_int = 0x100; pub const RTLD_NODELETE: ::c_int = 0x80; @@ -2451,6 +2454,11 @@ extern { size: ::size_t, flags: ::c_int) -> ::ssize_t; pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int; + pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, + flags: ::c_uint) -> ::c_int; + pub fn renameatx_np(fromfd: ::c_int, from: *const ::c_char, + tofd: ::c_int, to: *const ::c_char, + flags: ::c_uint) -> ::c_int; pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 60e0d8e2a8..5c7f96139b 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -1616,6 +1616,9 @@ extern { len: ::off_t) -> ::c_int; pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t; + pub fn renameat2(olddirfd: ::c_int, oldpath: *const ::c_char, + newdirfd: ::c_int, newpath: *const ::c_char, + flags: ::c_int) -> ::c_int; pub fn getxattr(path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t) -> ::ssize_t; pub fn lgetxattr(path: *const c_char, name: *const c_char, -- cgit v1.2.1 From 843388ac7dad39243927e8c24bac74a238f2682f Mon Sep 17 00:00:00 2001 From: debris Date: Mon, 4 Jun 2018 16:37:03 +0200 Subject: glibc does not provide a wrapper for the renameat2 --- src/unix/notbsd/linux/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 5c7f96139b..60e0d8e2a8 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -1616,9 +1616,6 @@ extern { len: ::off_t) -> ::c_int; pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t; - pub fn renameat2(olddirfd: ::c_int, oldpath: *const ::c_char, - newdirfd: ::c_int, newpath: *const ::c_char, - flags: ::c_int) -> ::c_int; pub fn getxattr(path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t) -> ::ssize_t; pub fn lgetxattr(path: *const c_char, name: *const c_char, -- cgit v1.2.1