Skip to content

Commit 2b158ce

Browse files
committed
Adding UTIME_NOW and UTIME_OMIT to OSes which support utimensat
1 parent 4bd0c00 commit 2b158ce

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,9 @@ pub const P_ALL: idtype_t = 0;
28232823
pub const P_PID: idtype_t = 1;
28242824
pub const P_PGID: idtype_t = 2;
28252825

2826+
pub const UTIME_OMIT: c_long = -2;
2827+
pub const UTIME_NOW: c_long = -1;
2828+
28262829
pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
28272830
pub const XATTR_CREATE: ::c_int = 0x0002;
28282831
pub const XATTR_REPLACE: ::c_int = 0x0004;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,9 @@ pub const P_PID: idtype_t = 0;
10411041
pub const P_PGID: idtype_t = 2;
10421042
pub const P_ALL: idtype_t = 7;
10431043

1044+
pub const UTIME_OMIT: c_long = -2;
1045+
pub const UTIME_NOW: c_long = -1;
1046+
10441047
pub const B460800: ::speed_t = 460800;
10451048
pub const B921600: ::speed_t = 921600;
10461049

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,9 @@ pub const P_ALL: idtype_t = 0;
13571357
pub const P_PID: idtype_t = 1;
13581358
pub const P_PGID: idtype_t = 4;
13591359

1360+
pub const UTIME_OMIT: c_long = 1073741822;
1361+
pub const UTIME_NOW: c_long = 1073741823;
1362+
13601363
pub const B460800: ::speed_t = 460800;
13611364
pub const B921600: ::speed_t = 921600;
13621365

src/unix/haiku/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,9 @@ pub const P_ALL: idtype_t = 0;
10391039
pub const P_PID: idtype_t = 1;
10401040
pub const P_PGID: idtype_t = 2;
10411041

1042+
pub const UTIME_OMIT: c_long = 1000000001;
1043+
pub const UTIME_NOW: c_long = 1000000000;
1044+
10421045
pub const VINTR: usize = 0;
10431046
pub const VQUIT: usize = 1;
10441047
pub const VERASE: usize = 2;

src/unix/solarish/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,9 @@ pub const P_CTID: idtype_t = 13;
965965
pub const P_CPUID: idtype_t = 14;
966966
pub const P_PSETID: idtype_t = 15;
967967

968+
pub const UTIME_OMIT: c_long = -2;
969+
pub const UTIME_NOW: c_long = -1;
970+
968971
pub const PROT_NONE: ::c_int = 0;
969972
pub const PROT_READ: ::c_int = 1;
970973
pub const PROT_WRITE: ::c_int = 2;

src/wasi.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ pub const AT_EACCESS: c_int = 0x0;
334334
pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1;
335335
pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
336336
pub const AT_REMOVEDIR: c_int = 0x4;
337+
pub const UTIME_OMIT: c_long = 1073741822;
338+
pub const UTIME_NOW: c_long = 1073741823;
339+
337340

338341
pub const E2BIG: c_int = __WASI_E2BIG as c_int;
339342
pub const EACCES: c_int = __WASI_EACCES as c_int;

0 commit comments

Comments
 (0)