From 097f864e79338c0329d7f2e39c724198ce06dffa Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Sun, 21 Aug 2022 23:45:42 +0900 Subject: [PATCH] apple SEEK_{DATA,HOLE} O_{EVTONLY,NOFOLLOW_ANY} Checked values in MacOSX12.3.sdk and iPhoneOS15.5.sdk /usr/include/sys/_types/_seek_set.h /usr/include/sys/fcntl.h Also updated representation format by following Apple's form and order --- libc-test/semver/apple.txt | 4 ++++ src/unix/bsd/apple/mod.rs | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 60e8391ce0126..ae81735586be2 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -917,10 +917,12 @@ ONOEOT OXTABS O_ASYNC O_DSYNC +O_EVTONLY O_EXLOCK O_FSYNC O_NDELAY O_NOCTTY +O_NOFOLLOW_ANY O_SHLOCK O_SYMLINK O_SYNC @@ -1164,6 +1166,8 @@ SCHED_RR SCM_CREDS SCM_RIGHTS SCM_TIMESTAMP +SEEK_DATA +SEEK_HOLE SEM_FAILED SEM_UNDO SETALL diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index a831ca850f4be..d3cd8503491be 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2654,6 +2654,8 @@ pub const EOF: ::c_int = -1; pub const SEEK_SET: ::c_int = 0; pub const SEEK_CUR: ::c_int = 1; pub const SEEK_END: ::c_int = 2; +pub const SEEK_HOLE: ::c_int = 3; +pub const SEEK_DATA: ::c_int = 4; pub const _IOFBF: ::c_int = 0; pub const _IONBF: ::c_int = 2; pub const _IOLBF: ::c_int = 1; @@ -2671,11 +2673,13 @@ pub const _PC_PIPE_BUF: ::c_int = 6; pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; pub const _PC_NO_TRUNC: ::c_int = 8; pub const _PC_VDISABLE: ::c_int = 9; -pub const O_DSYNC: ::c_int = 0x400000; -pub const O_NOCTTY: ::c_int = 0x20000; -pub const O_CLOEXEC: ::c_int = 0x1000000; -pub const O_DIRECTORY: ::c_int = 0x100000; -pub const O_SYMLINK: ::c_int = 0x200000; +pub const O_EVTONLY: ::c_int = 0x00008000; +pub const O_NOCTTY: ::c_int = 0x00020000; +pub const O_DIRECTORY: ::c_int = 0x00100000; +pub const O_SYMLINK: ::c_int = 0x00200000; +pub const O_DSYNC: ::c_int = 0x00400000; +pub const O_CLOEXEC: ::c_int = 0x01000000; +pub const O_NOFOLLOW_ANY: ::c_int = 0x20000000; pub const S_IFIFO: mode_t = 4096; pub const S_IFCHR: mode_t = 8192; pub const S_IFBLK: mode_t = 24576;