Skip to content

Commit 17ad72e

Browse files
committed
Auto merge of #473 - LegNeato:master, r=alexcrichton
Add clock_settime() See http://www.catb.org/esr/time-programming/#_clock_gettime_2_clock_settime_2_clock_getres_2
2 parents fb8587d + d563089 commit 17ad72e

File tree

6 files changed

+7
-0
lines changed

6 files changed

+7
-0
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ extern {
374374
-> ::c_int;
375375
pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
376376
pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
377+
pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
377378

378379
pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int;
379380

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ extern {
364364

365365
pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
366366
pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
367+
pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
367368

368369
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
369370
len: ::off_t) -> ::c_int;

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ extern {
472472
pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
473473
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
474474
pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
475+
#[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
476+
pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
475477
pub fn __errno() -> *mut ::c_int;
476478
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
477479
-> ::c_int;

src/unix/haiku/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ f! {
712712

713713
extern {
714714
pub fn clock_gettime(clk_id: ::c_int, tp: *mut ::timespec) -> ::c_int;
715+
pub fn clock_settime(clk_id: ::c_int, tp: *const ::timespec) -> ::c_int;
715716
pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
716717
guardsize: *mut ::size_t) -> ::c_int;
717718
pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,

src/unix/notbsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ extern {
725725
flags: ::c_int,
726726
rqtp: *const ::timespec,
727727
rmtp: *mut ::timespec) -> ::c_int;
728+
pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
728729
pub fn prctl(option: ::c_int, ...) -> ::c_int;
729730
pub fn pthread_getattr_np(native: ::pthread_t,
730731
attr: *mut ::pthread_attr_t) -> ::c_int;

src/unix/solaris/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ extern {
979979
flags: ::c_int,
980980
rqtp: *const ::timespec,
981981
rmtp: *mut ::timespec) -> ::c_int;
982+
pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
982983
pub fn getnameinfo(sa: *const ::sockaddr,
983984
salen: ::socklen_t,
984985
host: *mut ::c_char,

0 commit comments

Comments
 (0)