@@ -51,21 +51,20 @@ pub type iconv_t = *mut ::c_void;
51
51
// linux/sctp.h
52
52
pub type sctp_assoc_t = :: __s32 ;
53
53
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
+ }
60
64
}
61
65
}
62
66
63
67
s ! {
64
- pub struct rlimit64 {
65
- pub rlim_cur: rlim64_t,
66
- pub rlim_max: rlim64_t,
67
- }
68
-
69
68
pub struct glob_t {
70
69
pub gl_pathc: :: size_t,
71
70
pub gl_pathv: * mut * mut c_char,
@@ -687,6 +686,17 @@ s! {
687
686
}
688
687
}
689
688
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
+
690
700
s_no_extra_traits ! {
691
701
pub struct sockaddr_nl {
692
702
pub nl_family: :: sa_family_t,
@@ -703,14 +713,6 @@ s_no_extra_traits! {
703
713
pub d_name: [ :: c_char; 256 ] ,
704
714
}
705
715
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
-
714
716
pub struct sockaddr_alg {
715
717
pub salg_family: :: sa_family_t,
716
718
pub salg_type: [ :: c_uchar; 14 ] ,
@@ -806,6 +808,20 @@ s_no_extra_traits! {
806
808
}
807
809
}
808
810
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
+
809
825
s_no_extra_traits ! {
810
826
// linux/net_tstamp.h
811
827
#[ allow( missing_debug_implementations) ]
@@ -4269,30 +4285,8 @@ extern "C" {
4269
4285
pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
4270
4286
pub fn __errno_location ( ) -> * mut :: c_int ;
4271
4287
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 ;
4290
4288
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 ;
4293
4289
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 ;
4296
4290
pub fn readahead ( fd : :: c_int , offset : :: off64_t , count : :: size_t ) -> :: ssize_t ;
4297
4291
pub fn getxattr (
4298
4292
path : * const c_char ,
@@ -4593,13 +4587,6 @@ extern "C" {
4593
4587
offset : * mut off_t ,
4594
4588
count : :: size_t ,
4595
4589
) -> :: 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 ;
4603
4590
pub fn sigsuspend ( mask : * const :: sigset_t ) -> :: c_int ;
4604
4591
pub fn getgrgid_r (
4605
4592
gid : :: gid_t ,
@@ -4851,6 +4838,35 @@ extern "C" {
4851
4838
) -> :: ssize_t ;
4852
4839
}
4853
4840
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
+
4854
4870
cfg_if ! {
4855
4871
if #[ cfg( target_env = "uclibc" ) ] {
4856
4872
mod uclibc;
0 commit comments