Skip to content

Commit 087c2f3

Browse files
Mic92phi-gamma
authored andcommitted
add renameat2 and flags
This used to be PR #554. Adapted to match the current state of *libc*. Also, adapt for the fact that in Linux, the *flags* argument is of type *unsigned*, not *int*.
1 parent 0fc7fc6 commit 087c2f3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/unix/linux_like/linux/gnu/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ extern "C" {
978978
needle: *const ::c_void,
979979
needlelen: ::size_t,
980980
) -> *mut ::c_void;
981+
pub fn renameat2(olddirfd: ::c_int, oldpath: *const ::c_char,
982+
newdirfd: ::c_int, newpath: *const ::c_char,
983+
flags: ::c_uint) -> ::c_int;
981984
}
982985

983986
#[link(name = "util")]

src/unix/linux_like/linux/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1226,9 +1226,9 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
12261226
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
12271227
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
12281228

1229-
pub const RENAME_NOREPLACE: ::c_int = 1;
1230-
pub const RENAME_EXCHANGE: ::c_int = 2;
1231-
pub const RENAME_WHITEOUT: ::c_int = 4;
1229+
pub const RENAME_NOREPLACE: ::c_uint = 1;
1230+
pub const RENAME_EXCHANGE: ::c_uint = 2;
1231+
pub const RENAME_WHITEOUT: ::c_uint = 4;
12321232

12331233
pub const SCHED_OTHER: ::c_int = 0;
12341234
pub const SCHED_FIFO: ::c_int = 1;

0 commit comments

Comments
 (0)