@@ -51,21 +51,20 @@ pub type iconv_t = *mut ::c_void;
5151// linux/sctp.h
5252pub type sctp_assoc_t = :: __s32 ;
5353
54- #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
55- pub enum fpos64_t { } // FIXME: fill this out with a struct
56- impl :: Copy for fpos64_t { }
57- impl :: Clone for fpos64_t {
58- fn clone ( & self ) -> fpos64_t {
59- * self
54+ cfg_if ! {
55+ if #[ cfg( not( target_env = "musl" ) ) ] {
56+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
57+ pub enum fpos64_t { } // FIXME: fill this out with a struct
58+ impl :: Copy for fpos64_t { }
59+ impl :: Clone for fpos64_t {
60+ fn clone( & self ) -> fpos64_t {
61+ * self
62+ }
63+ }
6064 }
6165}
6266
6367s ! {
64- pub struct rlimit64 {
65- pub rlim_cur: rlim64_t,
66- pub rlim_max: rlim64_t,
67- }
68-
6968 pub struct glob_t {
7069 pub gl_pathc: :: size_t,
7170 pub gl_pathv: * mut * mut c_char,
@@ -687,6 +686,17 @@ s! {
687686 }
688687}
689688
689+ cfg_if ! {
690+ if #[ cfg( not( target_env = "musl" ) ) ] {
691+ s! {
692+ pub struct rlimit64 {
693+ pub rlim_cur: rlim64_t,
694+ pub rlim_max: rlim64_t,
695+ }
696+ }
697+ }
698+ }
699+
690700s_no_extra_traits ! {
691701 pub struct sockaddr_nl {
692702 pub nl_family: :: sa_family_t,
@@ -703,14 +713,6 @@ s_no_extra_traits! {
703713 pub d_name: [ :: c_char; 256 ] ,
704714 }
705715
706- pub struct dirent64 {
707- pub d_ino: :: ino64_t,
708- pub d_off: :: off64_t,
709- pub d_reclen: :: c_ushort,
710- pub d_type: :: c_uchar,
711- pub d_name: [ :: c_char; 256 ] ,
712- }
713-
714716 pub struct sockaddr_alg {
715717 pub salg_family: :: sa_family_t,
716718 pub salg_type: [ :: c_uchar; 14 ] ,
@@ -806,6 +808,20 @@ s_no_extra_traits! {
806808 }
807809}
808810
811+ cfg_if ! {
812+ if #[ cfg( not( target_env = "musl" ) ) ] {
813+ s_no_extra_traits! {
814+ pub struct dirent64 {
815+ pub d_ino: :: ino64_t,
816+ pub d_off: :: off64_t,
817+ pub d_reclen: :: c_ushort,
818+ pub d_type: :: c_uchar,
819+ pub d_name: [ :: c_char; 256 ] ,
820+ }
821+ }
822+ }
823+ }
824+
809825s_no_extra_traits ! {
810826 // linux/net_tstamp.h
811827 #[ allow( missing_debug_implementations) ]
@@ -4269,30 +4285,8 @@ extern "C" {
42694285 pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
42704286 pub fn __errno_location ( ) -> * mut :: c_int ;
42714287
4272- #[ cfg( not( target_env = "musl" ) ) ]
4273- pub fn fopen64 ( filename : * const c_char , mode : * const c_char ) -> * mut :: FILE ;
4274- #[ cfg( not( target_env = "musl" ) ) ]
4275- pub fn freopen64 (
4276- filename : * const c_char ,
4277- mode : * const c_char ,
4278- file : * mut :: FILE ,
4279- ) -> * mut :: FILE ;
4280- #[ cfg( not( target_env = "musl" ) ) ]
4281- pub fn tmpfile64 ( ) -> * mut :: FILE ;
4282- #[ cfg( not( target_env = "musl" ) ) ]
4283- pub fn fgetpos64 ( stream : * mut :: FILE , ptr : * mut fpos64_t ) -> :: c_int ;
4284- #[ cfg( not( target_env = "musl" ) ) ]
4285- pub fn fsetpos64 ( stream : * mut :: FILE , ptr : * const fpos64_t ) -> :: c_int ;
4286- #[ cfg( not( target_env = "musl" ) ) ]
4287- pub fn fseeko64 ( stream : * mut :: FILE , offset : :: off64_t , whence : :: c_int ) -> :: c_int ;
4288- #[ cfg( not( target_env = "musl" ) ) ]
4289- pub fn ftello64 ( stream : * mut :: FILE ) -> :: off64_t ;
42904288 pub fn fallocate ( fd : :: c_int , mode : :: c_int , offset : :: off_t , len : :: off_t ) -> :: c_int ;
4291- #[ cfg( not( target_env = "musl" ) ) ]
4292- pub fn fallocate64 ( fd : :: c_int , mode : :: c_int , offset : :: off64_t , len : :: off64_t ) -> :: c_int ;
42934289 pub fn posix_fallocate ( fd : :: c_int , offset : :: off_t , len : :: off_t ) -> :: c_int ;
4294- #[ cfg( not( target_env = "musl" ) ) ]
4295- pub fn posix_fallocate64 ( fd : :: c_int , offset : :: off64_t , len : :: off64_t ) -> :: c_int ;
42964290 pub fn readahead ( fd : :: c_int , offset : :: off64_t , count : :: size_t ) -> :: ssize_t ;
42974291 pub fn getxattr (
42984292 path : * const c_char ,
@@ -4593,13 +4587,6 @@ extern "C" {
45934587 offset : * mut off_t ,
45944588 count : :: size_t ,
45954589 ) -> :: ssize_t ;
4596- #[ cfg( not( target_env = "musl" ) ) ]
4597- pub fn sendfile64 (
4598- out_fd : :: c_int ,
4599- in_fd : :: c_int ,
4600- offset : * mut off64_t ,
4601- count : :: size_t ,
4602- ) -> :: ssize_t ;
46034590 pub fn sigsuspend ( mask : * const :: sigset_t ) -> :: c_int ;
46044591 pub fn getgrgid_r (
46054592 gid : :: gid_t ,
@@ -4851,6 +4838,35 @@ extern "C" {
48514838 ) -> :: ssize_t ;
48524839}
48534840
4841+ // LFS64 extensions
4842+ //
4843+ // * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones
4844+ cfg_if ! {
4845+ if #[ cfg( not( target_env = "musl" ) ) ] {
4846+ extern "C" {
4847+ pub fn fallocate64( fd: :: c_int, mode: :: c_int, offset: :: off64_t, len: :: off64_t) -> :: c_int;
4848+ pub fn fgetpos64( stream: * mut :: FILE , ptr: * mut fpos64_t) -> :: c_int;
4849+ pub fn fopen64( filename: * const c_char, mode: * const c_char) -> * mut :: FILE ;
4850+ pub fn freopen64(
4851+ filename: * const c_char,
4852+ mode: * const c_char,
4853+ file: * mut :: FILE ,
4854+ ) -> * mut :: FILE ;
4855+ pub fn fseeko64( stream: * mut :: FILE , offset: :: off64_t, whence: :: c_int) -> :: c_int;
4856+ pub fn fsetpos64( stream: * mut :: FILE , ptr: * const fpos64_t) -> :: c_int;
4857+ pub fn ftello64( stream: * mut :: FILE ) -> :: off64_t;
4858+ pub fn posix_fallocate64( fd: :: c_int, offset: :: off64_t, len: :: off64_t) -> :: c_int;
4859+ pub fn sendfile64(
4860+ out_fd: :: c_int,
4861+ in_fd: :: c_int,
4862+ offset: * mut off64_t,
4863+ count: :: size_t,
4864+ ) -> :: ssize_t;
4865+ pub fn tmpfile64( ) -> * mut :: FILE ;
4866+ }
4867+ }
4868+ }
4869+
48544870cfg_if ! {
48554871 if #[ cfg( target_env = "uclibc" ) ] {
48564872 mod uclibc;
0 commit comments