Skip to content

Commit ad29be4

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*. Signed-off-by: Philipp Gesang <[email protected]>
1 parent 71e298f commit ad29be4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,13 @@ extern {
912912
buflen: ::size_t,
913913
flags: ::c_uint,
914914
) -> ::ssize_t;
915+
pub fn renameat2(
916+
olddirfd: ::c_int,
917+
oldpath: *const ::c_char,
918+
newdirfd: ::c_int,
919+
newpath: *const ::c_char,
920+
flags: ::c_uint
921+
) -> ::c_int;
915922
}
916923

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

src/unix/linux_like/linux/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,9 +1185,9 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
11851185
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
11861186
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
11871187

1188-
pub const RENAME_NOREPLACE: ::c_int = 1;
1189-
pub const RENAME_EXCHANGE: ::c_int = 2;
1190-
pub const RENAME_WHITEOUT: ::c_int = 4;
1188+
pub const RENAME_NOREPLACE: ::c_uint = 1;
1189+
pub const RENAME_EXCHANGE: ::c_uint = 2;
1190+
pub const RENAME_WHITEOUT: ::c_uint = 4;
11911191

11921192
pub const SCHED_OTHER: ::c_int = 0;
11931193
pub const SCHED_FIFO: ::c_int = 1;

0 commit comments

Comments
 (0)