Skip to content

Commit 9d1230e

Browse files
committed
Auto merge of #1508 - phi-gamma:renameat2, r=gnzlbg
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*.
2 parents cfd561c + fea39c1 commit 9d1230e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,13 @@ extern "C" {
943943
buflen: ::size_t,
944944
flags: ::c_uint,
945945
) -> ::ssize_t;
946+
pub fn renameat2(
947+
olddirfd: ::c_int,
948+
oldpath: *const ::c_char,
949+
newdirfd: ::c_int,
950+
newpath: *const ::c_char,
951+
flags: ::c_uint,
952+
) -> ::c_int;
946953
}
947954

948955
#[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)