Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
relibc
Commits
b9c4a910
Commit
b9c4a910
authored
3 weeks ago
by
Peter Limkilde Svendsen
Browse files
Options
Downloads
Patches
Plain Diff
Reorder alphabetically
parent
1fea91cb
No related branches found
No related tags found
1 merge request
!616
Add docs, deprecations for sys/time.h
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/header/sys_time/mod.rs
+28
-28
28 additions, 28 deletions
src/header/sys_time/mod.rs
with
28 additions
and
28 deletions
src/header/sys_time/mod.rs
+
28
−
28
View file @
b9c4a910
...
...
@@ -38,18 +38,8 @@ pub const ITIMER_PROF: c_int = 2;
///
/// TODO: specified for `sys/select.h` in modern POSIX?
#[repr(C)]
#[derive(Default)]
pub
struct
timeval
{
pub
tv_sec
:
time_t
,
pub
tv_usec
:
suseconds_t
,
}
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>.
#[repr(C)]
#[derive(Default)]
pub
struct
timezone
{
pub
tz_minuteswest
:
c_int
,
pub
tz_dsttime
:
c_int
,
pub
struct
fd_set
{
pub
fds_bits
:
[
c_long
;
16usize
],
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html>.
...
...
@@ -69,8 +59,18 @@ pub struct itimerval {
///
/// TODO: specified for `sys/select.h` in modern POSIX?
#[repr(C)]
pub
struct
fd_set
{
pub
fds_bits
:
[
c_long
;
16usize
],
#[derive(Default)]
pub
struct
timeval
{
pub
tv_sec
:
time_t
,
pub
tv_usec
:
suseconds_t
,
}
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>.
#[repr(C)]
#[derive(Default)]
pub
struct
timezone
{
pub
tz_minuteswest
:
c_int
,
pub
tz_dsttime
:
c_int
,
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getitimer.html>.
...
...
@@ -86,6 +86,20 @@ pub unsafe extern "C" fn getitimer(which: c_int, value: *mut itimerval) -> c_int
.or_minus_one_errno
()
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html>.
///
/// See also <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>
/// for further details on the `tzp` argument.
///
/// # Deprecation
/// The `gettimeofday()` function was marked obsolescent in the Open Group Base
/// Specifications Issue 7, and removed in Issue 8.
#[deprecated]
#[no_mangle]
pub
unsafe
extern
"C"
fn
gettimeofday
(
tp
:
*
mut
timeval
,
tzp
:
*
mut
timezone
)
->
c_int
{
Sys
::
gettimeofday
(
tp
,
tzp
)
.map
(|()|
0
)
.or_minus_one_errno
()
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getitimer.html>.
///
/// # Deprecation
...
...
@@ -103,20 +117,6 @@ pub unsafe extern "C" fn setitimer(
.or_minus_one_errno
()
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html>.
///
/// See also <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>
/// for further details on the `tzp` argument.
///
/// # Deprecation
/// The `gettimeofday()` function was marked obsolescent in the Open Group Base
/// Specifications Issue 7, and removed in Issue 8.
#[deprecated]
#[no_mangle]
pub
unsafe
extern
"C"
fn
gettimeofday
(
tp
:
*
mut
timeval
,
tzp
:
*
mut
timezone
)
->
c_int
{
Sys
::
gettimeofday
(
tp
,
tzp
)
.map
(|()|
0
)
.or_minus_one_errno
()
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/utimes.html>.
///
/// # Deprecation
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment