import timespec from time rather than bits
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
//! See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/aio.h.html>.
|
||||
|
||||
use crate::{
|
||||
header::{bits_timespec::timespec, signal::sigevent},
|
||||
header::{signal::sigevent, time::timespec},
|
||||
platform::types::{c_int, c_void},
|
||||
};
|
||||
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
# - sys/select.h (not currently imported, needed for pselect, no TODO)
|
||||
# - sys/stat.h
|
||||
# - sys/time.h
|
||||
#
|
||||
# include sys/types.h to get time_t for timespec
|
||||
sys_includes = ["sys/types.h"]
|
||||
include_guard = "_RELIBC_BITS_TIME_H"
|
||||
# - time.h (where it should be defined)
|
||||
after_includes = """
|
||||
#include <bits/time_t.h>
|
||||
"""
|
||||
include_guard = "_RELIBC_BITS_TIMESPEC_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
no_includes = true
|
||||
|
||||
@@ -12,7 +12,6 @@ use crate::{
|
||||
use crate::header::{
|
||||
bits_arpainet::htons,
|
||||
bits_socklen_t::socklen_t,
|
||||
bits_timespec::timespec,
|
||||
errno::*,
|
||||
netinet_in::{IPPROTO_UDP, in_addr, sockaddr_in},
|
||||
sys_socket::{
|
||||
@@ -20,7 +19,7 @@ use crate::header::{
|
||||
constants::{AF_INET, SOCK_DGRAM},
|
||||
sockaddr,
|
||||
},
|
||||
time,
|
||||
time::{self, timespec},
|
||||
};
|
||||
|
||||
use super::{
|
||||
|
||||
@@ -8,13 +8,13 @@ use crate::{
|
||||
fs::File,
|
||||
header::{
|
||||
bits_sigset_t::sigset_t,
|
||||
bits_timespec::timespec,
|
||||
errno::EBADF,
|
||||
sys_epoll::{
|
||||
EPOLL_CLOEXEC, EPOLL_CTL_ADD, EPOLLERR, EPOLLHUP, EPOLLIN, EPOLLNVAL, EPOLLOUT,
|
||||
EPOLLPRI, EPOLLRDBAND, EPOLLRDNORM, EPOLLWRBAND, EPOLLWRNORM, epoll_create1, epoll_ctl,
|
||||
epoll_data, epoll_event, epoll_pwait,
|
||||
},
|
||||
time::timespec,
|
||||
},
|
||||
platform::{
|
||||
self,
|
||||
|
||||
@@ -7,7 +7,7 @@ use core::{cell::Cell, ptr::NonNull};
|
||||
|
||||
use crate::{
|
||||
error::Errno,
|
||||
header::{bits_timespec::timespec, sched::*},
|
||||
header::{sched::*, time::timespec},
|
||||
platform::{
|
||||
Pal, Sys,
|
||||
types::{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
use crate::{
|
||||
error::ResultExt,
|
||||
header::bits_timespec::timespec,
|
||||
header::time::timespec,
|
||||
platform::{
|
||||
Pal, Sys,
|
||||
types::{c_int, pid_t},
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
//! See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/semaphore.h.html>.
|
||||
|
||||
use crate::{
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
time::{CLOCK_MONOTONIC, CLOCK_REALTIME},
|
||||
},
|
||||
header::time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec},
|
||||
platform::types::{c_char, c_int, c_long, c_uint, clockid_t},
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use cbitset::BitSet;
|
||||
|
||||
use crate::{
|
||||
error::{Errno, ResultExt},
|
||||
header::{bits_sigset_t::sigset_t, bits_timespec::timespec, errno, setjmp},
|
||||
header::{bits_sigset_t::sigset_t, errno, setjmp, time::timespec},
|
||||
platform::{
|
||||
self, ERRNO, Pal, PalSignal, Sys,
|
||||
types::{
|
||||
|
||||
@@ -6,8 +6,8 @@ use crate::{
|
||||
c_str::CStr,
|
||||
error::ResultExt,
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
fcntl::{O_NOFOLLOW, O_PATH},
|
||||
time::timespec,
|
||||
},
|
||||
out::Out,
|
||||
platform::{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
use crate::{
|
||||
c_str::CStr,
|
||||
error::ResultExt,
|
||||
header::{bits_timespec::timespec, sys_select::timeval},
|
||||
header::{sys_select::timeval, time::timespec},
|
||||
out::Out,
|
||||
platform::{
|
||||
Pal, PalSignal, Sys,
|
||||
|
||||
@@ -6,7 +6,6 @@ use crate::{
|
||||
c_str::{CStr, CString},
|
||||
error::{Errno, ResultExt},
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
errno::{EFAULT, ENOMEM, EOVERFLOW, ETIMEDOUT},
|
||||
signal::sigevent,
|
||||
stdlib::getenv,
|
||||
@@ -30,6 +29,8 @@ use chrono::{
|
||||
use chrono_tz::{OffsetComponents, OffsetName, Tz};
|
||||
use core::{cell::OnceCell, convert::TryFrom, mem, ptr};
|
||||
|
||||
pub use crate::header::bits_timespec::timespec;
|
||||
|
||||
pub use self::constants::*;
|
||||
|
||||
pub mod constants;
|
||||
|
||||
@@ -16,7 +16,6 @@ use crate::{
|
||||
error::{Errno, ResultExt},
|
||||
header::{
|
||||
bits_sigset_t::sigset_t,
|
||||
bits_timespec::timespec,
|
||||
crypt::{crypt_data, crypt_r},
|
||||
errno::{self, ENAMETOOLONG},
|
||||
fcntl, limits,
|
||||
@@ -25,6 +24,7 @@ use crate::{
|
||||
sys_ioctl, sys_resource,
|
||||
sys_select::timeval,
|
||||
sys_time, sys_utsname, termios,
|
||||
time::timespec,
|
||||
},
|
||||
out::Out,
|
||||
platform::{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
use crate::{
|
||||
c_str::CStr,
|
||||
error::ResultExt,
|
||||
header::bits_timespec::timespec,
|
||||
header::time::timespec,
|
||||
platform::{
|
||||
Pal, Sys,
|
||||
types::{c_char, c_int, time_t},
|
||||
|
||||
@@ -6,7 +6,6 @@ use crate::{
|
||||
c_str::CStr,
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
dirent::dirent,
|
||||
errno::{EINVAL, EIO},
|
||||
fcntl::{AT_EMPTY_PATH, AT_FDCWD, AT_REMOVEDIR},
|
||||
@@ -17,7 +16,7 @@ use crate::{
|
||||
sys_statvfs::statvfs,
|
||||
sys_time::timezone,
|
||||
sys_utsname::utsname,
|
||||
time::itimerspec,
|
||||
time::{itimerspec, timespec},
|
||||
unistd::{SEEK_CUR, SEEK_SET},
|
||||
},
|
||||
ld_so::tcb::OsSpecific,
|
||||
|
||||
@@ -16,12 +16,11 @@ use crate::{
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_sigset_t::sigset_t,
|
||||
bits_timespec::timespec,
|
||||
signal::{
|
||||
SA_RESTORER, SI_QUEUE, SIGALRM, SIGEV_SIGNAL, sigaction, sigevent, siginfo_t, sigval,
|
||||
stack_t,
|
||||
},
|
||||
time,
|
||||
time::{self, timespec},
|
||||
},
|
||||
out::Out,
|
||||
platform::{self, Pal, types::timer_t},
|
||||
|
||||
@@ -5,7 +5,6 @@ use crate::{
|
||||
c_str::CStr,
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
fcntl::{AT_EMPTY_PATH, AT_FDCWD},
|
||||
signal::sigevent,
|
||||
sys_resource::{rlimit, rusage},
|
||||
@@ -14,7 +13,7 @@ use crate::{
|
||||
sys_statvfs::statvfs,
|
||||
sys_time::timezone,
|
||||
sys_utsname::utsname,
|
||||
time::itimerspec,
|
||||
time::{itimerspec, timespec},
|
||||
},
|
||||
ld_so::tcb::OsSpecific,
|
||||
out::Out,
|
||||
|
||||
@@ -8,8 +8,8 @@ use crate::{
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_sigset_t::sigset_t,
|
||||
bits_timespec::timespec,
|
||||
signal::{sigaction, siginfo_t, sigval, stack_t},
|
||||
time::timespec,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ use core::mem::size_of;
|
||||
|
||||
use crate::header::{
|
||||
bits_sigset_t::sigset_t,
|
||||
bits_timespec::timespec,
|
||||
fcntl::{O_CLOEXEC, O_CREAT, O_RDWR},
|
||||
time::timespec,
|
||||
};
|
||||
|
||||
use super::libredox::RawResult;
|
||||
|
||||
@@ -12,8 +12,7 @@ use syscall::{
|
||||
|
||||
use crate::{
|
||||
header::{
|
||||
bits_iovec::iovec, bits_timespec::timespec, errno::EINVAL, signal::sigaction,
|
||||
sys_stat::UTIME_NOW,
|
||||
bits_iovec::iovec, errno::EINVAL, signal::sigaction, sys_stat::UTIME_NOW, time::timespec,
|
||||
},
|
||||
out::Out,
|
||||
platform::{PalSignal, pal::Pal, types::*},
|
||||
|
||||
@@ -27,7 +27,6 @@ use crate::{
|
||||
error::{Errno, Result},
|
||||
fs::File,
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
errno::{
|
||||
EBADF, EBADFD, EEXIST, EFAULT, EFBIG, EINTR, EINVAL, EIO, ENAMETOOLONG, ENOENT, ENOMEM,
|
||||
ENOSYS, EOPNOTSUPP, EPERM,
|
||||
@@ -50,7 +49,7 @@ use crate::{
|
||||
sys_statvfs::statvfs,
|
||||
sys_time::timezone,
|
||||
sys_utsname::{UTSLENGTH, utsname},
|
||||
time::{TIMER_ABSTIME, itimerspec, timer_internal_t},
|
||||
time::{TIMER_ABSTIME, itimerspec, timer_internal_t, timespec},
|
||||
unistd::{F_OK, R_OK, SEEK_CUR, SEEK_SET, W_OK, X_OK},
|
||||
},
|
||||
io::{self, BufReader, prelude::*},
|
||||
|
||||
@@ -8,13 +8,12 @@ use crate::{
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_sigset_t::sigset_t,
|
||||
bits_timespec::timespec,
|
||||
errno::{EINVAL, ENOSYS},
|
||||
signal::{
|
||||
SIG_BLOCK, SIG_DFL, SIG_IGN, SIG_SETMASK, SIG_UNBLOCK, SIGALRM, SIGEV_SIGNAL,
|
||||
SS_DISABLE, SS_ONSTACK, sigaction, sigevent, siginfo_t, sigval, stack_t, ucontext_t,
|
||||
},
|
||||
time::{itimerspec, timer_internal_t},
|
||||
time::{itimerspec, timer_internal_t, timespec},
|
||||
},
|
||||
out::Out,
|
||||
sync::Mutex,
|
||||
|
||||
@@ -3,10 +3,9 @@ use syscall::Error;
|
||||
use crate::{
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
errno::EIO,
|
||||
signal::{SIGEV_SIGNAL, SIGEV_THREAD},
|
||||
time::timer_internal_t,
|
||||
time::{timer_internal_t, timespec},
|
||||
},
|
||||
out::Out,
|
||||
platform::{Pal, Sys, sys::event, types::c_void},
|
||||
|
||||
+1
-2
@@ -3,10 +3,9 @@
|
||||
use crate::{
|
||||
error::Errno,
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
errno::{EINVAL, ETIMEDOUT},
|
||||
pthread::*,
|
||||
time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec_realtime_to_monotonic},
|
||||
time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec, timespec_realtime_to_monotonic},
|
||||
},
|
||||
platform::types::clockid_t,
|
||||
};
|
||||
|
||||
+1
-1
@@ -20,8 +20,8 @@ pub use self::{
|
||||
use crate::{
|
||||
error::Errno,
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
errno::{EAGAIN, EINTR, ETIMEDOUT},
|
||||
time::timespec,
|
||||
},
|
||||
out::Out,
|
||||
platform::{Pal, Sys, types::c_int},
|
||||
|
||||
@@ -5,7 +5,7 @@ use core::{
|
||||
|
||||
use crate::{
|
||||
error::Errno,
|
||||
header::{bits_timespec::timespec, errno::*, pthread::*},
|
||||
header::{errno::*, pthread::*, time::timespec},
|
||||
};
|
||||
|
||||
use crate::platform::{Pal, Sys, types::c_int};
|
||||
|
||||
+1
-2
@@ -7,9 +7,8 @@ use core::{
|
||||
use crate::{
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
errno::{EINVAL, ETIMEDOUT},
|
||||
time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec_realtime_to_monotonic},
|
||||
time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec, timespec_realtime_to_monotonic},
|
||||
},
|
||||
platform::types::clockid_t,
|
||||
pthread::Pshared,
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
//TODO: improve implementation
|
||||
|
||||
use crate::{
|
||||
header::{
|
||||
bits_timespec::timespec,
|
||||
time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec_realtime_to_monotonic},
|
||||
},
|
||||
header::time::{CLOCK_MONOTONIC, CLOCK_REALTIME, timespec, timespec_realtime_to_monotonic},
|
||||
platform::types::{c_uint, clockid_t},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user