@@ -48,21 +48,20 @@ pub type name_t = u64;
4848
4949pub type iconv_t = * mut :: c_void ;
5050
51- #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
52- pub enum fpos64_t { } // FIXME: fill this out with a struct
53- impl :: Copy for fpos64_t { }
54- impl :: Clone for fpos64_t {
55- fn clone ( & self ) -> fpos64_t {
56- * self
51+ cfg_if ! {
52+ if #[ cfg( not( target_env = "musl" ) ) ] {
53+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
54+ pub enum fpos64_t { } // FIXME: fill this out with a struct
55+ impl :: Copy for fpos64_t { }
56+ impl :: Clone for fpos64_t {
57+ fn clone( & self ) -> fpos64_t {
58+ * self
59+ }
60+ }
5761 }
5862}
5963
6064s ! {
61- pub struct rlimit64 {
62- pub rlim_cur: rlim64_t,
63- pub rlim_max: rlim64_t,
64- }
65-
6665 pub struct glob_t {
6766 pub gl_pathc: :: size_t,
6867 pub gl_pathv: * mut * mut c_char,
@@ -605,6 +604,17 @@ s! {
605604 }
606605}
607606
607+ cfg_if ! {
608+ if #[ cfg( not( target_env = "musl" ) ) ] {
609+ s! {
610+ pub struct rlimit64 {
611+ pub rlim_cur: rlim64_t,
612+ pub rlim_max: rlim64_t,
613+ }
614+ }
615+ }
616+ }
617+
608618s_no_extra_traits ! {
609619 pub struct sockaddr_nl {
610620 pub nl_family: :: sa_family_t,
@@ -621,14 +631,6 @@ s_no_extra_traits! {
621631 pub d_name: [ :: c_char; 256 ] ,
622632 }
623633
624- pub struct dirent64 {
625- pub d_ino: :: ino64_t,
626- pub d_off: :: off64_t,
627- pub d_reclen: :: c_ushort,
628- pub d_type: :: c_uchar,
629- pub d_name: [ :: c_char; 256 ] ,
630- }
631-
632634 pub struct sockaddr_alg {
633635 pub salg_family: :: sa_family_t,
634636 pub salg_type: [ :: c_uchar; 14 ] ,
@@ -692,6 +694,20 @@ s_no_extra_traits! {
692694 }
693695}
694696
697+ cfg_if ! {
698+ if #[ cfg( not( target_env = "musl" ) ) ] {
699+ s_no_extra_traits! {
700+ pub struct dirent64 {
701+ pub d_ino: :: ino64_t,
702+ pub d_off: :: off64_t,
703+ pub d_reclen: :: c_ushort,
704+ pub d_type: :: c_uchar,
705+ pub d_name: [ :: c_char; 256 ] ,
706+ }
707+ }
708+ }
709+ }
710+
695711s_no_extra_traits ! {
696712 // linux/net_tstamp.h
697713 #[ allow( missing_debug_implementations) ]
@@ -3764,30 +3780,8 @@ extern "C" {
37643780 pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
37653781 pub fn __errno_location ( ) -> * mut :: c_int ;
37663782
3767- #[ cfg( not( target_env = "musl" ) ) ]
3768- pub fn fopen64 ( filename : * const c_char , mode : * const c_char ) -> * mut :: FILE ;
3769- #[ cfg( not( target_env = "musl" ) ) ]
3770- pub fn freopen64 (
3771- filename : * const c_char ,
3772- mode : * const c_char ,
3773- file : * mut :: FILE ,
3774- ) -> * mut :: FILE ;
3775- #[ cfg( not( target_env = "musl" ) ) ]
3776- pub fn tmpfile64 ( ) -> * mut :: FILE ;
3777- #[ cfg( not( target_env = "musl" ) ) ]
3778- pub fn fgetpos64 ( stream : * mut :: FILE , ptr : * mut fpos64_t ) -> :: c_int ;
3779- #[ cfg( not( target_env = "musl" ) ) ]
3780- pub fn fsetpos64 ( stream : * mut :: FILE , ptr : * const fpos64_t ) -> :: c_int ;
3781- #[ cfg( not( target_env = "musl" ) ) ]
3782- pub fn fseeko64 ( stream : * mut :: FILE , offset : :: off64_t , whence : :: c_int ) -> :: c_int ;
3783- #[ cfg( not( target_env = "musl" ) ) ]
3784- pub fn ftello64 ( stream : * mut :: FILE ) -> :: off64_t ;
37853783 pub fn fallocate ( fd : :: c_int , mode : :: c_int , offset : :: off_t , len : :: off_t ) -> :: c_int ;
3786- #[ cfg( not( target_env = "musl" ) ) ]
3787- pub fn fallocate64 ( fd : :: c_int , mode : :: c_int , offset : :: off64_t , len : :: off64_t ) -> :: c_int ;
37883784 pub fn posix_fallocate ( fd : :: c_int , offset : :: off_t , len : :: off_t ) -> :: c_int ;
3789- #[ cfg( not( target_env = "musl" ) ) ]
3790- pub fn posix_fallocate64 ( fd : :: c_int , offset : :: off64_t , len : :: off64_t ) -> :: c_int ;
37913785 pub fn readahead ( fd : :: c_int , offset : :: off64_t , count : :: size_t ) -> :: ssize_t ;
37923786 pub fn getxattr (
37933787 path : * const c_char ,
@@ -4104,13 +4098,6 @@ extern "C" {
41044098 offset : * mut off_t ,
41054099 count : :: size_t ,
41064100 ) -> :: ssize_t ;
4107- #[ cfg( not( target_env = "musl" ) ) ]
4108- pub fn sendfile64 (
4109- out_fd : :: c_int ,
4110- in_fd : :: c_int ,
4111- offset : * mut off64_t ,
4112- count : :: size_t ,
4113- ) -> :: ssize_t ;
41144101 pub fn sigsuspend ( mask : * const :: sigset_t ) -> :: c_int ;
41154102 pub fn getgrgid_r (
41164103 gid : :: gid_t ,
@@ -4355,6 +4342,35 @@ extern "C" {
43554342 pub fn pthread_setname_np ( thread : :: pthread_t , name : * const :: c_char ) -> :: c_int ;
43564343}
43574344
4345+ // LFS64 extensions
4346+ //
4347+ // * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones
4348+ cfg_if ! {
4349+ if #[ cfg( not( target_env = "musl" ) ) ] {
4350+ extern "C" {
4351+ pub fn fallocate64( fd: :: c_int, mode: :: c_int, offset: :: off64_t, len: :: off64_t) -> :: c_int;
4352+ pub fn fgetpos64( stream: * mut :: FILE , ptr: * mut fpos64_t) -> :: c_int;
4353+ pub fn fopen64( filename: * const c_char, mode: * const c_char) -> * mut :: FILE ;
4354+ pub fn freopen64(
4355+ filename: * const c_char,
4356+ mode: * const c_char,
4357+ file: * mut :: FILE ,
4358+ ) -> * mut :: FILE ;
4359+ pub fn fseeko64( stream: * mut :: FILE , offset: :: off64_t, whence: :: c_int) -> :: c_int;
4360+ pub fn fsetpos64( stream: * mut :: FILE , ptr: * const fpos64_t) -> :: c_int;
4361+ pub fn ftello64( stream: * mut :: FILE ) -> :: off64_t;
4362+ pub fn posix_fallocate64( fd: :: c_int, offset: :: off64_t, len: :: off64_t) -> :: c_int;
4363+ pub fn sendfile64(
4364+ out_fd: :: c_int,
4365+ in_fd: :: c_int,
4366+ offset: * mut off64_t,
4367+ count: :: size_t,
4368+ ) -> :: ssize_t;
4369+ pub fn tmpfile64( ) -> * mut :: FILE ;
4370+ }
4371+ }
4372+ }
4373+
43584374cfg_if ! {
43594375 if #[ cfg( target_env = "uclibc" ) ] {
43604376 mod uclibc;
0 commit comments