Skip to content

Commit 8e81c08

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 58b2706 + fea39c1 commit 8e81c08

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
@@ -1187,9 +1187,9 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
11871187
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
11881188
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
11891189

1190-
pub const RENAME_NOREPLACE: ::c_int = 1;
1191-
pub const RENAME_EXCHANGE: ::c_int = 2;
1192-
pub const RENAME_WHITEOUT: ::c_int = 4;
1190+
pub const RENAME_NOREPLACE: ::c_uint = 1;
1191+
pub const RENAME_EXCHANGE: ::c_uint = 2;
1192+
pub const RENAME_WHITEOUT: ::c_uint = 4;
11931193

11941194
pub const SCHED_OTHER: ::c_int = 0;
11951195
pub const SCHED_FIFO: ::c_int = 1;

0 commit comments

Comments
 (0)