From 117ac87ddb18d88cf62ea00c2aae9144583ba40a Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 1 Mar 2019 08:22:37 -0700 Subject: [PATCH] Fix the build on OSX with libc 0.2.49 Several symbols are now marked as deprecated on OSX. --- src/sys/event.rs | 3 +++ src/unistd.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/sys/event.rs b/src/sys/event.rs index e2a4eaa16e..b238d6eeb3 100644 --- a/src/sys/event.rs +++ b/src/sys/event.rs @@ -135,6 +135,7 @@ libc_bitflags!( NOTE_EXEC; NOTE_EXIT; #[cfg(any(target_os = "macos", target_os = "ios"))] + #[deprecated( since="0.14.0", note="Deprecated since OSX 10.9")] NOTE_EXIT_REPARENTED; #[cfg(any(target_os = "macos", target_os = "ios"))] NOTE_EXITSTATUS; @@ -183,6 +184,8 @@ libc_bitflags!( NOTE_PCTRLMASK; NOTE_PDATAMASK; #[cfg(any(target_os = "macos", target_os = "ios"))] + #[cfg(any(target_os = "macos", target_os = "ios"))] + #[deprecated( since="0.14.0", note="Deprecated since OSX 10.9")] NOTE_REAP; NOTE_RENAME; NOTE_REVOKE; diff --git a/src/unistd.rs b/src/unistd.rs index a41c1392be..9022fa1070 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -828,6 +828,10 @@ pub fn execveat(dirfd: RawFd, pathname: &CString, args: &[CString], /// descriptors will remain identical after daemonizing. /// * `noclose = false`: The process' stdin, stdout, and stderr will point to /// `/dev/null` after daemonizing. +#[cfg_attr(any(target_os = "macos", target_os = "ios"), deprecated( + since="0.14.0", + note="Deprecated in MacOSX 10.5" +))] pub fn daemon(nochdir: bool, noclose: bool) -> Result<()> { let res = unsafe { libc::daemon(nochdir as c_int, noclose as c_int) }; Errno::result(res).map(drop)