summaryrefslogtreecommitdiff
path: root/src/unix/bsd/netbsdlike
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-20 09:45:52 +0000
committerbors <bors@rust-lang.org>2019-08-20 09:45:52 +0000
commit38750521a627db61344bc9a8e072b9e3326b089e (patch)
tree75387377b8dca5a4d0570592d818d6390425052f /src/unix/bsd/netbsdlike
parentafcb42e71b955961625873dfd19a5b0cdaf09ada (diff)
parent6c995607ce202511c769eed41d3342459020ed06 (diff)
downloadrust-libc-0.2.63.tar.gz
Auto merge of #1474 - lpetre:add_utime_constants, r=gnzlbg0.2.63
Adding UTIME_NOW and UTIME_OMIT to OSes which support utimensat I've managed to verify a handful of these: - [FreeBSD](https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/tools/build/stat.h#L35) - [NetBSD](https://github.com/NetBSD/src/blob/64b8a48e1288eb3902ed73113d157af50b2ec596/sys/sys/stat.h#L235) - [Apple](https://opensource.apple.com/source/xnu/xnu-4903.221.2/bsd/sys/stat.h.auto.html) I'm less confident in these: - [Haiku](https://github.com/haiku/haiku/blob/abb59d7351c7ddb50c63c40430a82d94fa61917a/headers/posix/sys/stat.h#L105) - I could be wrong on this one: https://github.com/haiku/haiku/search?q=UTIME_NOW&unscoped_q=UTIME_NOW - [WASI](https://github.com/CraneStation/wasi-libc/blob/24792713d7e31cf593d7e19b943ef0c3aa26ef63/libc-top-half/musl/include/sys/stat.h#L71) - I could be wrong on this one: https://github.com/CraneStation/wasi-libc/search?q=UTIME_NOW&unscoped_q=UTIME_NOW - [Solarish](https://github.com/illumos/illumos-gate/blob/4e0c5eff9af325c80994e9527b7cb8b3a1ffd1d4/usr/src/uts/common/sys/stat.h#L478)
Diffstat (limited to 'src/unix/bsd/netbsdlike')
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs3
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index dc5b092ce9..9401c024bf 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1363,6 +1363,9 @@ pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 4;
+pub const UTIME_OMIT: c_long = 1073741822;
+pub const UTIME_NOW: c_long = 1073741823;
+
pub const B460800: ::speed_t = 460800;
pub const B921600: ::speed_t = 921600;
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index f942ece375..ab65a6de98 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -748,6 +748,9 @@ pub const ELAST : ::c_int = 95;
pub const F_DUPFD_CLOEXEC : ::c_int = 10;
+pub const UTIME_OMIT: c_long = -2;
+pub const UTIME_NOW: c_long = -1;
+
pub const AT_FDCWD: ::c_int = -100;
pub const AT_EACCESS: ::c_int = 0x01;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02;