Skip to content

Commit 13664cc

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 13d4a5d + fea39c1 commit 13664cc

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
@@ -938,6 +938,13 @@ extern "C" {
938938
buflen: ::size_t,
939939
flags: ::c_uint,
940940
) -> ::ssize_t;
941+
pub fn renameat2(
942+
olddirfd: ::c_int,
943+
oldpath: *const ::c_char,
944+
newdirfd: ::c_int,
945+
newpath: *const ::c_char,
946+
flags: ::c_uint,
947+
) -> ::c_int;
941948
}
942949

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

src/unix/linux_like/linux/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,9 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
11941194
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
11951195
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
11961196

1197-
pub const RENAME_NOREPLACE: ::c_int = 1;
1198-
pub const RENAME_EXCHANGE: ::c_int = 2;
1199-
pub const RENAME_WHITEOUT: ::c_int = 4;
1197+
pub const RENAME_NOREPLACE: ::c_uint = 1;
1198+
pub const RENAME_EXCHANGE: ::c_uint = 2;
1199+
pub const RENAME_WHITEOUT: ::c_uint = 4;
12001200

12011201
pub const SCHED_OTHER: ::c_int = 0;
12021202
pub const SCHED_FIFO: ::c_int = 1;

0 commit comments

Comments
 (0)