summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
authorMarkus Reiter <me@reitermark.us>2020-01-28 04:41:02 +0100
committerMarkus Reiter <me@reitermark.us>2020-02-20 01:15:28 +0100
commitb1d6c663d3580fdf9af98c49bfe7d8770a3196db (patch)
treeab3e59320fd9153095acdadfe56db825f2663d8c /src/unix
parent46c8eccb22fef9531e579a57be92983cf9a39762 (diff)
downloadrust-libc-b1d6c663d3580fdf9af98c49bfe7d8770a3196db.tar.gz
Add Newlib clock constants and functions.
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/newlib/mod.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs
index bd9a107983..0900e903fd 100644
--- a/src/unix/newlib/mod.rs
+++ b/src/unix/newlib/mod.rs
@@ -417,6 +417,10 @@ pub const AF_UNSPEC: ::c_int = 0;
pub const AF_INET: ::c_int = 2;
pub const AF_INET6: ::c_int = 23;
+pub const CLOCK_REALTIME: ::clockid_t = 1;
+pub const CLOCK_MONOTONIC: ::clockid_t = 4;
+pub const CLOCK_BOOTTIME: ::clockid_t = 4;
+
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -597,6 +601,18 @@ extern "C" {
pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t)
-> ::c_int;
+ pub fn clock_settime(
+ clock_id: ::clockid_t,
+ tp: *const ::timespec,
+ ) -> ::c_int;
+ pub fn clock_gettime(
+ clock_id: ::clockid_t,
+ tp: *mut ::timespec,
+ ) -> ::c_int;
+ pub fn clock_getres(
+ clock_id: ::clockid_t,
+ res: *mut ::timespec,
+ ) -> ::c_int;
pub fn closesocket(sockfd: ::c_int) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn recvfrom(