Skip to content

Commit 50c5a33

Browse files
committed
Auto merge of #621 - mneumann:dragonfly-at-fixes, r=alexcrichton
Fix AT_ constants for DragonFly
2 parents a9ae173 + abdeff3 commit 50c5a33

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ pub const TIOCMODG: ::c_uint = 0x40047403;
404404
pub const TIOCMODS: ::c_ulong = 0x80047404;
405405
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
406406

407+
// Constants used by "at" family of system calls.
408+
pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor
409+
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1;
410+
pub const AT_REMOVEDIR: ::c_int = 2;
411+
pub const AT_EACCESS: ::c_int = 4;
412+
pub const AT_SYMLINK_FOLLOW: ::c_int = 8;
413+
407414
extern {
408415
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
409416
-> ::c_int;

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ pub const P_ALL: idtype_t = 7;
508508
pub const B460800: ::speed_t = 460800;
509509
pub const B921600: ::speed_t = 921600;
510510

511+
pub const AT_FDCWD: ::c_int = -100;
512+
pub const AT_EACCESS: ::c_int = 0x100;
513+
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
514+
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
515+
pub const AT_REMOVEDIR: ::c_int = 0x800;
516+
511517
extern {
512518
pub fn __error() -> *mut ::c_int;
513519

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,6 @@ pub const F_SETFD: ::c_int = 2;
452452
pub const F_GETFL: ::c_int = 3;
453453
pub const F_SETFL: ::c_int = 4;
454454

455-
pub const AT_EACCESS: ::c_int = 0x100;
456-
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
457-
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
458-
pub const AT_REMOVEDIR: ::c_int = 0x800;
459-
460455
pub const SIGTRAP: ::c_int = 5;
461456

462457
pub const GLOB_APPEND : ::c_int = 0x0001;
@@ -876,8 +871,6 @@ pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
876871

877872
pub const CRTSCTS: ::tcflag_t = 0x00030000;
878873

879-
pub const AT_FDCWD: ::c_int = -100;
880-
881874
f! {
882875
pub fn WIFCONTINUED(status: ::c_int) -> bool {
883876
status == 0x13

0 commit comments

Comments
 (0)