@@ -249,6 +249,36 @@ s! {
249249 pub ch_size: :: Elf32_Word ,
250250 pub ch_addralign: :: Elf32_Word ,
251251 }
252+
253+ pub struct timex {
254+ pub modes: :: c_uint,
255+ pub offset: :: c_long,
256+ pub freq: :: c_long,
257+ pub maxerror: :: c_long,
258+ pub esterror: :: c_long,
259+ pub status: :: c_int,
260+ pub constant: :: c_long,
261+ pub precision: :: c_long,
262+ pub tolerance: :: c_long,
263+ pub time: :: timeval,
264+ pub tick: :: c_long,
265+ pub ppsfreq: :: c_long,
266+ pub jitter: :: c_long,
267+ pub shift: :: c_int,
268+ pub stabil: :: c_long,
269+ pub jitcnt: :: c_long,
270+ pub calcnt: :: c_long,
271+ pub errcnt: :: c_long,
272+ pub stbcnt: :: c_long,
273+ pub tai: :: c_int,
274+ pub __padding: [ :: c_int; 11 ] ,
275+ }
276+
277+ pub struct ntptimeval {
278+ pub time: :: timeval,
279+ pub maxerror: :: c_long,
280+ pub esterror: :: c_long,
281+ }
252282}
253283
254284s_no_extra_traits ! {
@@ -623,6 +653,64 @@ pub const PRIO_PROCESS: ::c_int = 0;
623653pub const PRIO_PGRP : :: c_int = 1 ;
624654pub const PRIO_USER : :: c_int = 2 ;
625655
656+ pub const ADJ_OFFSET : :: c_uint = 0x0001 ;
657+ pub const ADJ_FREQUENCY : :: c_uint = 0x0002 ;
658+ pub const ADJ_MAXERROR : :: c_uint = 0x0004 ;
659+ pub const ADJ_ESTERROR : :: c_uint = 0x0008 ;
660+ pub const ADJ_STATUS : :: c_uint = 0x0010 ;
661+ pub const ADJ_TIMECONST : :: c_uint = 0x0020 ;
662+ pub const ADJ_TAI : :: c_uint = 0x0080 ;
663+ pub const ADJ_SETOFFSET : :: c_uint = 0x0100 ;
664+ pub const ADJ_MICRO : :: c_uint = 0x1000 ;
665+ pub const ADJ_NANO : :: c_uint = 0x2000 ;
666+ pub const ADJ_TICK : :: c_uint = 0x4000 ;
667+ pub const ADJ_OFFSET_SINGLESHOT : :: c_uint = 0x8001 ;
668+ pub const ADJ_OFFSET_SS_READ : :: c_uint = 0xa001 ;
669+ pub const MOD_OFFSET : :: c_uint = ADJ_OFFSET ;
670+ pub const MOD_FREQUENCY : :: c_uint = ADJ_FREQUENCY ;
671+ pub const MOD_MAXERROR : :: c_uint = ADJ_MAXERROR ;
672+ pub const MOD_ESTERROR : :: c_uint = ADJ_ESTERROR ;
673+ pub const MOD_STATUS : :: c_uint = ADJ_STATUS ;
674+ pub const MOD_TIMECONST : :: c_uint = ADJ_TIMECONST ;
675+ pub const MOD_CLKB : :: c_uint = ADJ_TICK ;
676+ pub const MOD_CLKA : :: c_uint = ADJ_OFFSET_SINGLESHOT ;
677+ pub const MOD_TAI : :: c_uint = ADJ_TAI ;
678+ pub const MOD_MICRO : :: c_uint = ADJ_MICRO ;
679+ pub const MOD_NANO : :: c_uint = ADJ_NANO ;
680+ pub const STA_PLL : :: c_int = 0x0001 ;
681+ pub const STA_PPSFREQ : :: c_int = 0x0002 ;
682+ pub const STA_PPSTIME : :: c_int = 0x0004 ;
683+ pub const STA_FLL : :: c_int = 0x0008 ;
684+ pub const STA_INS : :: c_int = 0x0010 ;
685+ pub const STA_DEL : :: c_int = 0x0020 ;
686+ pub const STA_UNSYNC : :: c_int = 0x0040 ;
687+ pub const STA_FREQHOLD : :: c_int = 0x0080 ;
688+ pub const STA_PPSSIGNAL : :: c_int = 0x0100 ;
689+ pub const STA_PPSJITTER : :: c_int = 0x0200 ;
690+ pub const STA_PPSWANDER : :: c_int = 0x0400 ;
691+ pub const STA_PPSERROR : :: c_int = 0x0800 ;
692+ pub const STA_CLOCKERR : :: c_int = 0x1000 ;
693+ pub const STA_NANO : :: c_int = 0x2000 ;
694+ pub const STA_MODE : :: c_int = 0x4000 ;
695+ pub const STA_CLK : :: c_int = 0x8000 ;
696+ pub const STA_RONLY : :: c_int = STA_PPSSIGNAL
697+ | STA_PPSJITTER
698+ | STA_PPSWANDER
699+ | STA_PPSERROR
700+ | STA_CLOCKERR
701+ | STA_NANO
702+ | STA_MODE
703+ | STA_CLK ;
704+
705+ pub const TIME_OK : :: c_int = 0 ;
706+ pub const TIME_INS : :: c_int = 1 ;
707+ pub const TIME_DEL : :: c_int = 2 ;
708+ pub const TIME_OOP : :: c_int = 3 ;
709+ pub const TIME_WAIT : :: c_int = 4 ;
710+ pub const TIME_ERROR : :: c_int = 5 ;
711+ pub const TIME_BAD : :: c_int = TIME_ERROR ;
712+ pub const MAXTC : :: c_long = 6 ;
713+
626714cfg_if ! {
627715 if #[ cfg( target_arch = "s390x" ) ] {
628716 pub const POSIX_FADV_DONTNEED : :: c_int = 6 ;
@@ -702,6 +790,9 @@ extern "C" {
702790 pub fn explicit_bzero ( s : * mut :: c_void , len : :: size_t ) ;
703791 // Added in `musl` 1.2.2
704792 pub fn reallocarray ( ptr : * mut :: c_void , nmemb : :: size_t , size : :: size_t ) -> * mut :: c_void ;
793+
794+ pub fn adjtimex ( buf : * mut :: timex ) -> :: c_int ;
795+ pub fn clock_adjtime ( clk_id : :: clockid_t , buf : * mut :: timex ) -> :: c_int ;
705796}
706797
707798cfg_if ! {
0 commit comments