@@ -48,21 +48,20 @@ pub type name_t = u64;
48
48
49
49
pub type iconv_t = * mut :: c_void ;
50
50
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
+ }
57
61
}
58
62
}
59
63
60
64
s ! {
61
- pub struct rlimit64 {
62
- pub rlim_cur: rlim64_t,
63
- pub rlim_max: rlim64_t,
64
- }
65
-
66
65
pub struct glob_t {
67
66
pub gl_pathc: :: size_t,
68
67
pub gl_pathv: * mut * mut c_char,
@@ -605,6 +604,17 @@ s! {
605
604
}
606
605
}
607
606
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
+
608
618
s_no_extra_traits ! {
609
619
pub struct sockaddr_nl {
610
620
pub nl_family: :: sa_family_t,
@@ -621,14 +631,6 @@ s_no_extra_traits! {
621
631
pub d_name: [ :: c_char; 256 ] ,
622
632
}
623
633
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
-
632
634
pub struct sockaddr_alg {
633
635
pub salg_family: :: sa_family_t,
634
636
pub salg_type: [ :: c_uchar; 14 ] ,
@@ -692,6 +694,20 @@ s_no_extra_traits! {
692
694
}
693
695
}
694
696
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
+
695
711
s_no_extra_traits ! {
696
712
// linux/net_tstamp.h
697
713
#[ allow( missing_debug_implementations) ]
@@ -3764,30 +3780,8 @@ extern "C" {
3764
3780
pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
3765
3781
pub fn __errno_location ( ) -> * mut :: c_int ;
3766
3782
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 ;
3785
3783
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 ;
3788
3784
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 ;
3791
3785
pub fn readahead ( fd : :: c_int , offset : :: off64_t , count : :: size_t ) -> :: ssize_t ;
3792
3786
pub fn getxattr (
3793
3787
path : * const c_char ,
@@ -4104,13 +4098,6 @@ extern "C" {
4104
4098
offset : * mut off_t ,
4105
4099
count : :: size_t ,
4106
4100
) -> :: 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 ;
4114
4101
pub fn sigsuspend ( mask : * const :: sigset_t ) -> :: c_int ;
4115
4102
pub fn getgrgid_r (
4116
4103
gid : :: gid_t ,
@@ -4355,6 +4342,35 @@ extern "C" {
4355
4342
pub fn pthread_setname_np ( thread : :: pthread_t , name : * const :: c_char ) -> :: c_int ;
4356
4343
}
4357
4344
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
+
4358
4374
cfg_if ! {
4359
4375
if #[ cfg( target_env = "uclibc" ) ] {
4360
4376
mod uclibc;
0 commit comments