Skip to content

Commit

Permalink
Auto merge of #2116 - JohnTitor:renameat2, r=Amanieu
Browse files Browse the repository at this point in the history
Add `renameat2` and change their flags' type to `c_uint`

Taking over #1508. This changes the type of some flags but it should've been `c_uint`.

Closes #1508
  • Loading branch information
bors committed Mar 17, 2021
2 parents 801487e + b90fda7 commit e3dd608
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -1477,6 +1477,13 @@ extern "C" {
offset: ::off_t,
flags: ::c_int,
) -> ::ssize_t;
pub fn renameat2(
olddirfd: ::c_int,
oldpath: *const ::c_char,
newdirfd: ::c_int,
newpath: *const ::c_char,
flags: ::c_uint,
) -> ::c_int;
}

extern "C" {
Expand Down
6 changes: 3 additions & 3 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -1418,9 +1418,9 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;

pub const RENAME_NOREPLACE: ::c_int = 1;
pub const RENAME_EXCHANGE: ::c_int = 2;
pub const RENAME_WHITEOUT: ::c_int = 4;
pub const RENAME_NOREPLACE: ::c_uint = 1;
pub const RENAME_EXCHANGE: ::c_uint = 2;
pub const RENAME_WHITEOUT: ::c_uint = 4;

pub const SCHED_OTHER: ::c_int = 0;
pub const SCHED_FIFO: ::c_int = 1;
Expand Down

0 comments on commit e3dd608

Please sign in to comment.