1- pub const PATH_MAX : :: c_int = 4096 ;
2-
3- pub const F_GETLK : :: c_int = 5 ;
4- pub const F_SETLK : :: c_int = 6 ;
5- pub const F_SETLKW : :: c_int = 7 ;
6-
71pub type c_char = i8 ;
82pub type c_long = i64 ;
93pub type c_ulong = u64 ;
@@ -49,8 +43,6 @@ impl ::Clone for timezone {
4943 fn clone ( & self ) -> timezone { * self }
5044}
5145
52- pub const UTSLENGTH : usize = 65 ;
53-
5446s_no_extra_traits ! {
5547 #[ repr( C ) ]
5648 pub struct utsname {
@@ -243,6 +235,27 @@ s! {
243235 }
244236}
245237
238+ pub const UTSLENGTH : usize = 65 ;
239+
240+ // intentionally not public, only used for fd_set
241+ cfg_if ! {
242+ if #[ cfg( target_pointer_width = "32" ) ] {
243+ const ULONG_SIZE : usize = 32 ;
244+ } else if #[ cfg( target_pointer_width = "64" ) ] {
245+ const ULONG_SIZE : usize = 64 ;
246+ } else {
247+ // Unknown target_pointer_width
248+ }
249+ }
250+
251+ // limits.h
252+ pub const PATH_MAX : :: c_int = 4096 ;
253+
254+ // fcntl.h
255+ pub const F_GETLK : :: c_int = 5 ;
256+ pub const F_SETLK : :: c_int = 6 ;
257+ pub const F_SETLKW : :: c_int = 7 ;
258+
246259// TODO: relibc {
247260pub const RTLD_DEFAULT : * mut :: c_void = 0i64 as * mut :: c_void ;
248261// }
@@ -335,10 +348,12 @@ pub const EREMCHG: ::c_int = 78; /* Remote address changed */
335348pub const ELIBACC : :: c_int = 79 ; /* Can not access a needed shared library */
336349pub const ELIBBAD : :: c_int = 80 ; /* Accessing a corrupted shared library */
337350pub const ELIBSCN : :: c_int = 81 ; /* .lib section in a.out corrupted */
338- pub const ELIBMAX : :: c_int = 82 ; /* Attempting to link in too many shared libraries */
351+ /* Attempting to link in too many shared libraries */
352+ pub const ELIBMAX : :: c_int = 82 ;
339353pub const ELIBEXEC : :: c_int = 83 ; /* Cannot exec a shared library directly */
340354pub const EILSEQ : :: c_int = 84 ; /* Illegal byte sequence */
341- pub const ERESTART : :: c_int = 85 ; /* Interrupted system call should be restarted */
355+ /* Interrupted system call should be restarted */
356+ pub const ERESTART : :: c_int = 85 ;
342357pub const ESTRPIPE : :: c_int = 86 ; /* Streams pipe error */
343358pub const EUSERS : :: c_int = 87 ; /* Too many users */
344359pub const ENOTSOCK : :: c_int = 88 ; /* Socket operation on non-socket */
@@ -348,20 +363,24 @@ pub const EPROTOTYPE: ::c_int = 91; /* Protocol wrong type for socket */
348363pub const ENOPROTOOPT : :: c_int = 92 ; /* Protocol not available */
349364pub const EPROTONOSUPPORT : :: c_int = 93 ; /* Protocol not supported */
350365pub const ESOCKTNOSUPPORT : :: c_int = 94 ; /* Socket type not supported */
351- pub const EOPNOTSUPP : :: c_int = 95 ; /* Operation not supported on transport endpoint */
366+ /* Operation not supported on transport endpoint */
367+ pub const EOPNOTSUPP : :: c_int = 95 ;
352368pub const EPFNOSUPPORT : :: c_int = 96 ; /* Protocol family not supported */
353- pub const EAFNOSUPPORT : :: c_int = 97 ; /* Address family not supported by protocol */
369+ /* Address family not supported by protocol */
370+ pub const EAFNOSUPPORT : :: c_int = 97 ;
354371pub const EADDRINUSE : :: c_int = 98 ; /* Address already in use */
355372pub const EADDRNOTAVAIL : :: c_int = 99 ; /* Cannot assign requested address */
356373pub const ENETDOWN : :: c_int = 100 ; /* Network is down */
357374pub const ENETUNREACH : :: c_int = 101 ; /* Network is unreachable */
358- pub const ENETRESET : :: c_int = 102 ; /* Network dropped connection because of reset */
375+ /* Network dropped connection because of reset */
376+ pub const ENETRESET : :: c_int = 102 ;
359377pub const ECONNABORTED : :: c_int = 103 ; /* Software caused connection abort */
360378pub const ECONNRESET : :: c_int = 104 ; /* Connection reset by peer */
361379pub const ENOBUFS : :: c_int = 105 ; /* No buffer space available */
362380pub const EISCONN : :: c_int = 106 ; /* Transport endpoint is already connected */
363381pub const ENOTCONN : :: c_int = 107 ; /* Transport endpoint is not connected */
364- pub const ESHUTDOWN : :: c_int = 108 ; /* Cannot send after transport endpoint shutdown */
382+ /* Cannot send after transport endpoint shutdown */
383+ pub const ESHUTDOWN : :: c_int = 108 ;
365384pub const ETOOMANYREFS : :: c_int = 109 ; /* Too many references: cannot splice */
366385pub const ETIMEDOUT : :: c_int = 110 ; /* Connection timed out */
367386pub const ECONNREFUSED : :: c_int = 111 ; /* Connection refused */
@@ -705,18 +724,7 @@ f! {
705724 }
706725}
707726
708- // intentionally not public, only used for fd_set
709- cfg_if ! {
710- if #[ cfg( target_pointer_width = "32" ) ] {
711- const ULONG_SIZE : usize = 32 ;
712- } else if #[ cfg( target_pointer_width = "64" ) ] {
713- const ULONG_SIZE : usize = 64 ;
714- } else {
715- // Unknown target_pointer_width
716- }
717- }
718-
719- extern "C" {
727+ extern {
720728 // errno.h
721729 pub fn __errno_location ( ) -> * mut :: c_int ;
722730
@@ -728,14 +736,14 @@ extern "C" {
728736
729737 // pthread.h
730738 pub fn pthread_atfork (
731- prepare : :: Option < unsafe extern "C" fn ( ) > ,
732- parent : :: Option < unsafe extern "C" fn ( ) > ,
733- child : :: Option < unsafe extern "C" fn ( ) > ,
739+ prepare : :: Option < unsafe extern fn ( ) > ,
740+ parent : :: Option < unsafe extern fn ( ) > ,
741+ child : :: Option < unsafe extern fn ( ) > ,
734742 ) -> :: c_int ;
735743 pub fn pthread_create (
736744 tid : * mut :: pthread_t ,
737745 attr : * const :: pthread_attr_t ,
738- start : extern "C" fn ( * mut :: c_void ) -> * mut :: c_void ,
746+ start : extern fn ( * mut :: c_void ) -> * mut :: c_void ,
739747 arg : * mut :: c_void ,
740748 ) -> :: c_int ;
741749 pub fn pthread_condattr_setclock (
0 commit comments