diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs index 858d5ed474..a1913a0c09 100644 --- a/src/header/signal/mod.rs +++ b/src/header/signal/mod.rs @@ -292,6 +292,7 @@ pub extern "C" fn sigignore(sig: c_int) -> c_int { /// See . /// /// Marked obsolescent in issue 7. Removed in issue 8. +#[deprecated] #[unsafe(no_mangle)] pub extern "C" fn siginterrupt(sig: c_int, flag: c_int) -> c_int { let mut psa = mem::MaybeUninit::::uninit(); diff --git a/src/header/stdio/mod.rs b/src/header/stdio/mod.rs index 069d45562a..0ece8d2ed8 100644 --- a/src/header/stdio/mod.rs +++ b/src/header/stdio/mod.rs @@ -315,6 +315,7 @@ pub unsafe extern "C" fn ctermid(s: *mut c_char) -> *mut c_char { /// /// Marked legacy in SUS Version 2. // #[unsafe(no_mangle)] +#[deprecated] pub unsafe extern "C" fn cuserid(s: *mut c_char) -> *mut c_char { let mut buf: Vec = vec![0; 256]; let mut pwd: pwd::passwd = unsafe { mem::zeroed() }; @@ -894,6 +895,7 @@ pub unsafe extern "C" fn getchar_unlocked() -> c_int { /// `fgets` is recommended instead, which is what this implementation calls. /// /// Get a string from `stdin` +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn gets(s: *mut c_char) -> *mut c_char { unsafe { fgets(s, c_int::MAX, &raw mut *stdin) } @@ -904,6 +906,7 @@ pub unsafe extern "C" fn gets(s: *mut c_char) -> *mut c_char { /// Was marked legacy and removed in issue 6. /// /// Get an integer from `stream` +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn getw(stream: *mut FILE) -> c_int { let mut ret: c_int = 0; @@ -1125,6 +1128,7 @@ pub unsafe extern "C" fn puts(s: *const c_char) -> c_int { /// Marked legacy in SUS Version 2. /// /// Put an integer `w` into `stream` +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn putw(w: c_int, stream: *mut FILE) -> c_int { (unsafe { @@ -1258,6 +1262,7 @@ pub unsafe extern "C" fn setvbuf( /// See . /// /// Marked obsolescent in issue 7. +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn tempnam(dir: *const c_char, pfx: *const c_char) -> *mut c_char { unsafe fn is_appropriate(pos_dir: *const c_char) -> bool { @@ -1331,6 +1336,7 @@ pub unsafe extern "C" fn tmpfile() -> *mut FILE { /// See . /// /// Marked obsolescent in issue 7. +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn tmpnam(s: *mut c_char) -> *mut c_char { let buf = if s.is_null() { @@ -1343,6 +1349,7 @@ pub unsafe extern "C" fn tmpnam(s: *mut c_char) -> *mut c_char { unsafe { tmpnam_inner(buf, 1) } } +#[deprecated] unsafe extern "C" fn tmpnam_inner(buf: *mut c_char, offset: usize) -> *mut c_char { const TEMPLATE: &[u8] = b"XXXXXX\0"; diff --git a/src/header/stdlib/mod.rs b/src/header/stdlib/mod.rs index 2afc7f627c..17132c9c53 100644 --- a/src/header/stdlib/mod.rs +++ b/src/header/stdlib/mod.rs @@ -1113,6 +1113,7 @@ pub unsafe extern "C" fn rand() -> c_int { /// # Deprecation /// The `rand_r()` function was marked as obsolescent in the Open Group Base /// Specifications Issue 7, and the function was removed in Issue 8. +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn rand_r(seed: *mut c_uint) -> c_int { if seed.is_null() { diff --git a/src/header/sys_time/mod.rs b/src/header/sys_time/mod.rs index 723ee1a48b..152f145318 100644 --- a/src/header/sys_time/mod.rs +++ b/src/header/sys_time/mod.rs @@ -117,6 +117,7 @@ pub unsafe extern "C" fn setitimer( /// # Deprecation /// The `utimes()` function was marked legacy in the Open Group Base /// Specifications Issue 6, and then unmarked in Issue 7. +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn utimes(path: *const c_char, times: *const timeval) -> c_int { let path = unsafe { CStr::from_ptr(path) }; diff --git a/src/header/sys_timeb/mod.rs b/src/header/sys_timeb/mod.rs index 85c0ff1ec9..b2294238e5 100644 --- a/src/header/sys_timeb/mod.rs +++ b/src/header/sys_timeb/mod.rs @@ -18,6 +18,7 @@ use crate::{ }; /// See . +#[deprecated] #[repr(C)] #[derive(Default)] pub struct timeb { @@ -32,6 +33,7 @@ pub struct timeb { /// # Safety /// The caller must ensure that `tp` is convertible to a `&mut /// MaybeUninit`. +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn ftime(tp: *mut timeb) -> c_int { // SAFETY: the caller is required to ensure that the pointer is valid. diff --git a/src/header/unistd/mod.rs b/src/header/unistd/mod.rs index 91158a0511..6c00d74964 100644 --- a/src/header/unistd/mod.rs +++ b/src/header/unistd/mod.rs @@ -38,7 +38,10 @@ pub use crate::header::pthread::fork_hooks; // Inclusion of ctermid() prototype marked as obsolescent since Issue 7, cf. // . // cuserid() marked legacy in Issue 5. -pub use crate::header::stdio::{ctermid, cuserid}; +#[deprecated] +pub use crate::header::stdio::ctermid; +#[allow(deprecated)] +pub use crate::header::stdio::cuserid; // TODO: implement and reexport fcntl functions: //pub use crate::header::fcntl::{faccessat, fchownat, fexecve, linkat, readlinkat, symlinkat, unlinkat}; diff --git a/src/header/wchar/mod.rs b/src/header/wchar/mod.rs index b29e71a218..fa4ff454f3 100644 --- a/src/header/wchar/mod.rs +++ b/src/header/wchar/mod.rs @@ -911,6 +911,7 @@ pub unsafe extern "C" fn wcstoull( /// /// Marked legacy in issue 6. /// Encouraged to use `wcsstr` instead, which this implementation simply forwards to. +#[deprecated] #[unsafe(no_mangle)] pub unsafe extern "C" fn wcswcs(ws1: *const wchar_t, ws2: *const wchar_t) -> *mut wchar_t { unsafe { wcsstr(ws1, ws2) }