Mark setitimer as unimplemented, obsolete

This commit is contained in:
Ron Williams
2025-04-21 23:29:35 -07:00
parent f216665916
commit c779c1d941
3 changed files with 7 additions and 0 deletions
+1
View File
@@ -114,6 +114,7 @@ pub unsafe extern "C" fn setitimer(
value: *const itimerval,
ovalue: *mut itimerval,
) -> c_int {
// TODO setitimer is unimplemented on Redox
Sys::setitimer(which, &*value, ovalue.as_mut())
.map(|()| 0)
.or_minus_one_errno()
+2
View File
@@ -96,6 +96,7 @@ pub unsafe extern "C" fn access(path: *const c_char, mode: c_int) -> c_int {
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/alarm.html>.
#[no_mangle]
pub extern "C" fn alarm(seconds: c_uint) -> c_uint {
// TODO setitimer is unimplemented on Redox and obsolete
let mut timer = sys_time::itimerval {
it_value: sys_time::timeval {
tv_sec: seconds as time_t,
@@ -1032,6 +1033,7 @@ pub extern "C" fn ttyname_r(fildes: c_int, name: *mut c_char, namesize: size_t)
#[deprecated]
#[no_mangle]
pub extern "C" fn ualarm(usecs: useconds_t, interval: useconds_t) -> useconds_t {
// TODO setitimer is unimplemented on Redox and obsolete
let mut timer = sys_time::itimerval {
it_value: sys_time::timeval {
tv_sec: 0,
+4
View File
@@ -90,6 +90,10 @@ impl PalSignal for Sys {
}
fn setitimer(which: c_int, _new: &itimerval, old: Option<&mut itimerval>) -> Result<()> {
// TODO: setitimer is no longer part of POSIX and should not be implemented in Redox
// Change the platform-independent implementation to use POSIX timers.
// For Redox, the timer should probably use "/scheme/time"
unimplemented!();
let _path = match which {
ITIMER_REAL => "/scheme/itimer/1",
_ => return Err(Errno(EINVAL)),