@@ -28,8 +28,12 @@ pub type fsfilcnt_t = i64;
28
28
pub type pthread_attr_t = * mut :: c_void ;
29
29
pub type nl_item = :: c_int ;
30
30
pub type id_t = i32 ;
31
- pub type idtype_t = :: c_uint ;
31
+ pub type idtype_t = :: c_int ;
32
32
pub type fd_mask = u32 ;
33
+ pub type regoff_t = :: c_int ;
34
+ pub type key_t = i32 ;
35
+ pub type msgqnum_t = u32 ;
36
+ pub type msglen_t = u32 ;
33
37
34
38
pub type Elf32_Addr = u32 ;
35
39
pub type Elf32_Half = u16 ;
@@ -45,6 +49,9 @@ pub type Elf64_Sxword = i64;
45
49
pub type Elf64_Word = u32 ;
46
50
pub type Elf64_Xword = u64 ;
47
51
52
+ pub type ENTRY = entry ;
53
+ pub type ACTION = :: c_int ;
54
+
48
55
#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
49
56
pub enum timezone { }
50
57
impl :: Copy for timezone { }
@@ -362,17 +369,6 @@ s! {
362
369
pub sdl_data: [ u8 ; 46 ] ,
363
370
}
364
371
365
- pub struct dl_phdr_info {
366
- pub dlpi_addr: Elf_Addr ,
367
- pub dlpi_name: * const :: c_char,
368
- pub dlpi_phdr: * const Elf_Phdr ,
369
- pub dlpi_phnum: Elf_Half ,
370
- pub dlpi_adds: :: c_ulonglong,
371
- pub dlpi_subs: :: c_ulonglong,
372
- pub dlpi_tls_modid: usize ,
373
- pub dlpi_tls_data: * mut :: c_void,
374
- }
375
-
376
372
pub struct spwd {
377
373
pub sp_namp: * mut :: c_char,
378
374
pub sp_pwdp: * mut :: c_char,
@@ -384,6 +380,53 @@ s! {
384
380
pub sp_expire: :: c_int,
385
381
pub sp_flag: :: c_int,
386
382
}
383
+
384
+ pub struct regex_t {
385
+ __buffer: * mut :: c_void,
386
+ __allocated: :: size_t,
387
+ __used: :: size_t,
388
+ __syntax: :: c_ulong,
389
+ __fastmap: * mut :: c_char,
390
+ __translate: * mut :: c_char,
391
+ __re_nsub: :: size_t,
392
+ __bitfield: u8 ,
393
+ }
394
+
395
+ pub struct regmatch_t {
396
+ pub rm_so: regoff_t,
397
+ pub rm_eo: regoff_t,
398
+ }
399
+
400
+ pub struct msqid_ds {
401
+ pub msg_perm: :: ipc_perm,
402
+ pub msg_qnum: :: msgqnum_t,
403
+ pub msg_qbytes: :: msglen_t,
404
+ pub msg_lspid: :: pid_t,
405
+ pub msg_lrpid: :: pid_t,
406
+ pub msg_stime: :: time_t,
407
+ pub msg_rtime: :: time_t,
408
+ pub msg_ctime: :: time_t,
409
+ }
410
+
411
+ pub struct ipc_perm {
412
+ pub key: :: key_t,
413
+ pub uid: :: uid_t,
414
+ pub gid: :: gid_t,
415
+ pub cuid: :: uid_t,
416
+ pub cgid: :: gid_t,
417
+ pub mode: :: mode_t,
418
+ }
419
+
420
+ pub struct sembuf {
421
+ pub sem_num: :: c_ushort,
422
+ pub sem_op: :: c_short,
423
+ pub sem_flg: :: c_short,
424
+ }
425
+
426
+ pub struct entry {
427
+ pub key: * mut :: c_char,
428
+ pub data: * mut :: c_void,
429
+ }
387
430
}
388
431
389
432
s_no_extra_traits ! {
@@ -657,6 +700,8 @@ pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
657
700
658
701
pub const CLOCK_REALTIME : :: c_int = -1 ;
659
702
pub const CLOCK_MONOTONIC : :: c_int = 0 ;
703
+ pub const CLOCK_PROCESS_CPUTIME_ID : :: c_int = -2 ;
704
+ pub const CLOCK_THREAD_CPUTIME_ID : :: c_int = -3 ;
660
705
661
706
pub const RLIMIT_CORE : :: c_int = 0 ;
662
707
pub const RLIMIT_CPU : :: c_int = 1 ;
@@ -665,7 +710,7 @@ pub const RLIMIT_FSIZE: ::c_int = 3;
665
710
pub const RLIMIT_NOFILE : :: c_int = 4 ;
666
711
pub const RLIMIT_STACK : :: c_int = 5 ;
667
712
pub const RLIMIT_AS : :: c_int = 6 ;
668
- pub const RLIM_INFINITY : :: c_ulong = 0xffffffff ;
713
+ pub const RLIM_INFINITY : :: rlim_t = 0xffffffff ;
669
714
// Haiku specific
670
715
pub const RLIMIT_NOVMON : :: c_int = 7 ;
671
716
pub const RLIM_NLIMITS : :: c_int = 8 ;
@@ -1564,15 +1609,20 @@ extern "C" {
1564
1609
bufferSize : :: size_t ,
1565
1610
res : * mut * mut spwd ,
1566
1611
) -> :: c_int ;
1567
- }
1568
-
1569
- #[ link( name = "bsd" ) ]
1570
- extern "C" {
1612
+ pub fn mkfifoat ( dirfd : :: c_int , pathname : * const :: c_char , mode : :: mode_t ) -> :: c_int ;
1613
+ pub fn mknodat (
1614
+ dirfd : :: c_int ,
1615
+ pathname : * const :: c_char ,
1616
+ mode : :: mode_t ,
1617
+ dev : dev_t ,
1618
+ ) -> :: c_int ;
1571
1619
pub fn sem_destroy ( sem : * mut sem_t ) -> :: c_int ;
1572
1620
pub fn sem_init ( sem : * mut sem_t , pshared : :: c_int , value : :: c_uint ) -> :: c_int ;
1573
1621
1574
- pub fn clock_gettime ( clk_id : :: c_int , tp : * mut :: timespec ) -> :: c_int ;
1575
- pub fn clock_settime ( clk_id : :: c_int , tp : * const :: timespec ) -> :: c_int ;
1622
+ pub fn clock_getres ( clk_id : :: clockid_t , tp : * mut :: timespec ) -> :: c_int ;
1623
+ pub fn clock_gettime ( clk_id : :: clockid_t , tp : * mut :: timespec ) -> :: c_int ;
1624
+ pub fn clock_settime ( clk_id : :: clockid_t , tp : * const :: timespec ) -> :: c_int ;
1625
+ pub fn clock_getcpuclockid ( pid : :: pid_t , clk_id : * mut :: clockid_t ) -> :: c_int ;
1576
1626
pub fn pthread_create (
1577
1627
thread : * mut :: pthread_t ,
1578
1628
attr : * const :: pthread_attr_t ,
@@ -1600,6 +1650,7 @@ extern "C" {
1600
1650
pub fn malloc_usable_size ( ptr : * mut :: c_void ) -> :: size_t ;
1601
1651
pub fn memalign ( align : :: size_t , size : :: size_t ) -> * mut :: c_void ;
1602
1652
pub fn setgroups ( ngroups : :: c_int , ptr : * const :: gid_t ) -> :: c_int ;
1653
+ pub fn initgroups ( name : * const :: c_char , basegid : :: gid_t ) -> :: c_int ;
1603
1654
pub fn ioctl ( fd : :: c_int , request : :: c_ulong , ...) -> :: c_int ;
1604
1655
pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
1605
1656
pub fn dirfd ( dirp : * mut :: DIR ) -> :: c_int ;
@@ -1655,7 +1706,6 @@ extern "C" {
1655
1706
addrlen : * mut :: socklen_t ,
1656
1707
) -> :: ssize_t ;
1657
1708
pub fn mkstemps ( template : * mut :: c_char , suffixlen : :: c_int ) -> :: c_int ;
1658
- pub fn lutimes ( file : * const :: c_char , times : * const :: timeval ) -> :: c_int ;
1659
1709
pub fn nl_langinfo ( item : :: nl_item ) -> * mut :: c_char ;
1660
1710
1661
1711
pub fn bind ( socket : :: c_int , address : * const :: sockaddr , address_len : :: socklen_t ) -> :: c_int ;
@@ -1698,7 +1748,6 @@ extern "C" {
1698
1748
pub fn getgrnam ( name : * const :: c_char ) -> * mut :: group ;
1699
1749
pub fn pthread_kill ( thread : :: pthread_t , sig : :: c_int ) -> :: c_int ;
1700
1750
pub fn sem_unlink ( name : * const :: c_char ) -> :: c_int ;
1701
- pub fn daemon ( nochdir : :: c_int , noclose : :: c_int ) -> :: c_int ;
1702
1751
pub fn getpwnam_r (
1703
1752
name : * const :: c_char ,
1704
1753
pwd : * mut passwd ,
@@ -1713,6 +1762,14 @@ extern "C" {
1713
1762
buflen : :: size_t ,
1714
1763
result : * mut * mut passwd ,
1715
1764
) -> :: c_int ;
1765
+ pub fn getpwent ( ) -> * mut passwd ;
1766
+ pub fn setpwent ( ) ;
1767
+ pub fn endpwent ( ) ;
1768
+ pub fn endgrent ( ) ;
1769
+ pub fn getgrent ( ) -> * mut :: group ;
1770
+ pub fn setgrent ( ) ;
1771
+ pub fn setreuid ( ruid : :: uid_t , euid : :: uid_t ) -> :: c_int ;
1772
+ pub fn setregid ( rgid : :: gid_t , egid : :: gid_t ) -> :: c_int ;
1716
1773
pub fn sigwait ( set : * const sigset_t , sig : * mut :: c_int ) -> :: c_int ;
1717
1774
pub fn pthread_atfork (
1718
1775
prepare : :: Option < unsafe extern "C" fn ( ) > ,
@@ -1721,19 +1778,6 @@ extern "C" {
1721
1778
) -> :: c_int ;
1722
1779
pub fn getgrgid ( gid : :: gid_t ) -> * mut :: group ;
1723
1780
pub fn popen ( command : * const c_char , mode : * const c_char ) -> * mut :: FILE ;
1724
- pub fn openpty (
1725
- amaster : * mut :: c_int ,
1726
- aslave : * mut :: c_int ,
1727
- name : * mut :: c_char ,
1728
- termp : * mut termios ,
1729
- winp : * mut :: winsize ,
1730
- ) -> :: c_int ;
1731
- pub fn forkpty (
1732
- amaster : * mut :: c_int ,
1733
- name : * mut :: c_char ,
1734
- termp : * mut termios ,
1735
- winp : * mut :: winsize ,
1736
- ) -> :: pid_t ;
1737
1781
pub fn sethostname ( name : * const :: c_char , len : :: size_t ) -> :: c_int ;
1738
1782
pub fn uname ( buf : * mut :: utsname ) -> :: c_int ;
1739
1783
pub fn getutxent ( ) -> * mut utmpx ;
@@ -1742,31 +1786,126 @@ extern "C" {
1742
1786
pub fn pututxline ( ut : * const utmpx ) -> * mut utmpx ;
1743
1787
pub fn setutxent ( ) ;
1744
1788
pub fn endutxent ( ) ;
1789
+ pub fn faccessat (
1790
+ dirfd : :: c_int ,
1791
+ pathname : * const :: c_char ,
1792
+ mode : :: c_int ,
1793
+ flags : :: c_int ,
1794
+ ) -> :: c_int ;
1745
1795
1746
- pub fn dl_iterate_phdr (
1747
- callback : :: Option <
1748
- unsafe extern "C" fn (
1749
- info : * mut dl_phdr_info ,
1750
- size : usize ,
1751
- data : * mut :: c_void ,
1752
- ) -> :: c_int ,
1753
- > ,
1754
- data : * mut :: c_void ,
1796
+ pub fn sigtimedwait (
1797
+ set : * const sigset_t ,
1798
+ info : * mut siginfo_t ,
1799
+ timeout : * const :: timespec ,
1755
1800
) -> :: c_int ;
1801
+ pub fn sigwaitinfo ( set : * const sigset_t , info : * mut siginfo_t ) -> :: c_int ;
1756
1802
1757
- pub fn strsep ( string : * mut * mut :: c_char , delimiters : * const :: c_char ) -> * mut :: c_char ;
1758
- pub fn explicit_bzero ( buf : * mut :: c_void , len : :: size_t ) ;
1803
+ pub fn getitimer ( which : :: c_int , curr_value : * mut :: itimerval ) -> :: c_int ;
1804
+ pub fn setitimer (
1805
+ which : :: c_int ,
1806
+ new_value : * const :: itimerval ,
1807
+ old_value : * mut :: itimerval ,
1808
+ ) -> :: c_int ;
1759
1809
1760
- pub fn login_tty ( _fd : :: c_int ) -> :: c_int ;
1761
- pub fn fgetln ( stream : * mut :: FILE , _length : * mut :: size_t ) -> * mut :: c_char ;
1810
+ pub fn regcomp ( preg : * mut regex_t , pattern : * const :: c_char , cflags : :: c_int ) -> :: c_int ;
1762
1811
1763
- pub fn realhostname ( host : * mut :: c_char , hsize : :: size_t , ip : * const in_addr ) -> :: c_int ;
1764
- pub fn realhostname_sa (
1765
- host : * mut :: c_char ,
1766
- hsize : :: size_t ,
1767
- addr : * mut sockaddr ,
1768
- addrlen : :: c_int ,
1812
+ pub fn regexec (
1813
+ preg : * const regex_t ,
1814
+ input : * const :: c_char ,
1815
+ nmatch : :: size_t ,
1816
+ pmatch : * mut regmatch_t ,
1817
+ eflags : :: c_int ,
1769
1818
) -> :: c_int ;
1819
+
1820
+ pub fn regerror (
1821
+ errcode : :: c_int ,
1822
+ preg : * const regex_t ,
1823
+ errbuf : * mut :: c_char ,
1824
+ errbuf_size : :: size_t ,
1825
+ ) -> :: size_t ;
1826
+
1827
+ pub fn regfree ( preg : * mut regex_t ) ;
1828
+
1829
+ pub fn msgctl ( msqid : :: c_int , cmd : :: c_int , buf : * mut msqid_ds ) -> :: c_int ;
1830
+ pub fn msgget ( key : :: key_t , msgflg : :: c_int ) -> :: c_int ;
1831
+ pub fn msgrcv (
1832
+ msqid : :: c_int ,
1833
+ msgp : * mut :: c_void ,
1834
+ msgsz : :: size_t ,
1835
+ msgtype : :: c_long ,
1836
+ msgflg : :: c_int ,
1837
+ ) -> :: ssize_t ;
1838
+ pub fn msgsnd (
1839
+ msqid : :: c_int ,
1840
+ msgp : * const :: c_void ,
1841
+ msgsz : :: size_t ,
1842
+ msgflg : :: c_int ,
1843
+ ) -> :: c_int ;
1844
+ pub fn semget ( key : :: key_t , nsems : :: c_int , semflg : :: c_int ) -> :: c_int ;
1845
+ pub fn semctl ( semid : :: c_int , semnum : :: c_int , cmd : :: c_int , ...) -> :: c_int ;
1846
+ pub fn semop ( semid : :: c_int , sops : * mut sembuf , nsops : :: size_t ) -> :: c_int ;
1847
+ pub fn ftok ( pathname : * const :: c_char , proj_id : :: c_int ) -> :: key_t ;
1848
+
1849
+ pub fn memrchr ( cx : * const :: c_void , c : :: c_int , n : :: size_t ) -> * mut :: c_void ;
1850
+
1851
+ pub fn lsearch (
1852
+ key : * const :: c_void ,
1853
+ base : * mut :: c_void ,
1854
+ nelp : * mut :: size_t ,
1855
+ width : :: size_t ,
1856
+ compar : :: Option < unsafe extern "C" fn ( * const :: c_void , * const :: c_void ) -> :: c_int > ,
1857
+ ) -> * mut :: c_void ;
1858
+ pub fn lfind (
1859
+ key : * const :: c_void ,
1860
+ base : * const :: c_void ,
1861
+ nelp : * mut :: size_t ,
1862
+ width : :: size_t ,
1863
+ compar : :: Option < unsafe extern "C" fn ( * const :: c_void , * const :: c_void ) -> :: c_int > ,
1864
+ ) -> * mut :: c_void ;
1865
+ pub fn hcreate ( nelt : :: size_t ) -> :: c_int ;
1866
+ pub fn hdestroy ( ) ;
1867
+ pub fn hsearch ( entry : :: ENTRY , action : :: ACTION ) -> * mut :: ENTRY ;
1868
+
1869
+ pub fn drand48 ( ) -> :: c_double ;
1870
+ pub fn erand48 ( xseed : * mut :: c_ushort ) -> :: c_double ;
1871
+ pub fn lrand48 ( ) -> :: c_long ;
1872
+ pub fn nrand48 ( xseed : * mut :: c_ushort ) -> :: c_long ;
1873
+ pub fn mrand48 ( ) -> :: c_long ;
1874
+ pub fn jrand48 ( xseed : * mut :: c_ushort ) -> :: c_long ;
1875
+ pub fn srand48 ( seed : :: c_long ) ;
1876
+ pub fn seed48 ( xseed : * mut :: c_ushort ) -> * mut :: c_ushort ;
1877
+ pub fn lcong48 ( p : * mut :: c_ushort ) ;
1878
+
1879
+ pub fn clearenv ( ) -> :: c_int ;
1880
+ pub fn ctermid ( s : * mut :: c_char ) -> * mut :: c_char ;
1881
+
1882
+ pub fn sync ( ) ;
1883
+ pub fn getpagesize ( ) -> :: c_int ;
1884
+
1885
+ pub fn brk ( addr : * mut :: c_void ) -> :: c_int ;
1886
+ pub fn sbrk ( increment : :: intptr_t ) -> * mut :: c_void ;
1887
+ }
1888
+
1889
+ #[ link( name = "bsd" ) ]
1890
+ extern "C" {
1891
+ pub fn lutimes ( file : * const :: c_char , times : * const :: timeval ) -> :: c_int ;
1892
+ pub fn daemon ( nochdir : :: c_int , noclose : :: c_int ) -> :: c_int ;
1893
+ pub fn forkpty (
1894
+ amaster : * mut :: c_int ,
1895
+ name : * mut :: c_char ,
1896
+ termp : * mut termios ,
1897
+ winp : * mut :: winsize ,
1898
+ ) -> :: pid_t ;
1899
+ pub fn openpty (
1900
+ amaster : * mut :: c_int ,
1901
+ aslave : * mut :: c_int ,
1902
+ name : * mut :: c_char ,
1903
+ termp : * mut termios ,
1904
+ winp : * mut :: winsize ,
1905
+ ) -> :: c_int ;
1906
+ pub fn strsep ( string : * mut * mut :: c_char , delimiters : * const :: c_char ) -> * mut :: c_char ;
1907
+ pub fn explicit_bzero ( buf : * mut :: c_void , len : :: size_t ) ;
1908
+ pub fn login_tty ( _fd : :: c_int ) -> :: c_int ;
1770
1909
}
1771
1910
1772
1911
cfg_if ! {
0 commit comments