@@ -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,
@@ -620,6 +619,17 @@ s! {
620
619
}
621
620
}
622
621
622
+ cfg_if ! {
623
+ if #[ cfg( not( target_env = "musl" ) ) ] {
624
+ s! {
625
+ pub struct rlimit64 {
626
+ pub rlim_cur: rlim64_t,
627
+ pub rlim_max: rlim64_t,
628
+ }
629
+ }
630
+ }
631
+ }
632
+
623
633
s_no_extra_traits ! {
624
634
pub struct sockaddr_nl {
625
635
pub nl_family: :: sa_family_t,
@@ -636,14 +646,6 @@ s_no_extra_traits! {
636
646
pub d_name: [ :: c_char; 256 ] ,
637
647
}
638
648
639
- pub struct dirent64 {
640
- pub d_ino: :: ino64_t,
641
- pub d_off: :: off64_t,
642
- pub d_reclen: :: c_ushort,
643
- pub d_type: :: c_uchar,
644
- pub d_name: [ :: c_char; 256 ] ,
645
- }
646
-
647
649
pub struct sockaddr_alg {
648
650
pub salg_family: :: sa_family_t,
649
651
pub salg_type: [ :: c_uchar; 14 ] ,
@@ -733,6 +735,20 @@ s_no_extra_traits! {
733
735
}
734
736
}
735
737
738
+ cfg_if ! {
739
+ if #[ cfg( not( target_env = "musl" ) ) ] {
740
+ s_no_extra_traits! {
741
+ pub struct dirent64 {
742
+ pub d_ino: :: ino64_t,
743
+ pub d_off: :: off64_t,
744
+ pub d_reclen: :: c_ushort,
745
+ pub d_type: :: c_uchar,
746
+ pub d_name: [ :: c_char; 256 ] ,
747
+ }
748
+ }
749
+ }
750
+ }
751
+
736
752
s_no_extra_traits ! {
737
753
// linux/net_tstamp.h
738
754
#[ allow( missing_debug_implementations) ]
@@ -3852,30 +3868,8 @@ extern "C" {
3852
3868
pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
3853
3869
pub fn __errno_location ( ) -> * mut :: c_int ;
3854
3870
3855
- #[ cfg( not( target_env = "musl" ) ) ]
3856
- pub fn fopen64 ( filename : * const c_char , mode : * const c_char ) -> * mut :: FILE ;
3857
- #[ cfg( not( target_env = "musl" ) ) ]
3858
- pub fn freopen64 (
3859
- filename : * const c_char ,
3860
- mode : * const c_char ,
3861
- file : * mut :: FILE ,
3862
- ) -> * mut :: FILE ;
3863
- #[ cfg( not( target_env = "musl" ) ) ]
3864
- pub fn tmpfile64 ( ) -> * mut :: FILE ;
3865
- #[ cfg( not( target_env = "musl" ) ) ]
3866
- pub fn fgetpos64 ( stream : * mut :: FILE , ptr : * mut fpos64_t ) -> :: c_int ;
3867
- #[ cfg( not( target_env = "musl" ) ) ]
3868
- pub fn fsetpos64 ( stream : * mut :: FILE , ptr : * const fpos64_t ) -> :: c_int ;
3869
- #[ cfg( not( target_env = "musl" ) ) ]
3870
- pub fn fseeko64 ( stream : * mut :: FILE , offset : :: off64_t , whence : :: c_int ) -> :: c_int ;
3871
- #[ cfg( not( target_env = "musl" ) ) ]
3872
- pub fn ftello64 ( stream : * mut :: FILE ) -> :: off64_t ;
3873
3871
pub fn fallocate ( fd : :: c_int , mode : :: c_int , offset : :: off_t , len : :: off_t ) -> :: c_int ;
3874
- #[ cfg( not( target_env = "musl" ) ) ]
3875
- pub fn fallocate64 ( fd : :: c_int , mode : :: c_int , offset : :: off64_t , len : :: off64_t ) -> :: c_int ;
3876
3872
pub fn posix_fallocate ( fd : :: c_int , offset : :: off_t , len : :: off_t ) -> :: c_int ;
3877
- #[ cfg( not( target_env = "musl" ) ) ]
3878
- pub fn posix_fallocate64 ( fd : :: c_int , offset : :: off64_t , len : :: off64_t ) -> :: c_int ;
3879
3873
pub fn readahead ( fd : :: c_int , offset : :: off64_t , count : :: size_t ) -> :: ssize_t ;
3880
3874
pub fn getxattr (
3881
3875
path : * const c_char ,
@@ -4192,13 +4186,6 @@ extern "C" {
4192
4186
offset : * mut off_t ,
4193
4187
count : :: size_t ,
4194
4188
) -> :: ssize_t ;
4195
- #[ cfg( not( target_env = "musl" ) ) ]
4196
- pub fn sendfile64 (
4197
- out_fd : :: c_int ,
4198
- in_fd : :: c_int ,
4199
- offset : * mut off64_t ,
4200
- count : :: size_t ,
4201
- ) -> :: ssize_t ;
4202
4189
pub fn sigsuspend ( mask : * const :: sigset_t ) -> :: c_int ;
4203
4190
pub fn getgrgid_r (
4204
4191
gid : :: gid_t ,
@@ -4443,6 +4430,35 @@ extern "C" {
4443
4430
pub fn pthread_setname_np ( thread : :: pthread_t , name : * const :: c_char ) -> :: c_int ;
4444
4431
}
4445
4432
4433
+ // LFS64 extensions
4434
+ //
4435
+ // * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones
4436
+ cfg_if ! {
4437
+ if #[ cfg( not( target_env = "musl" ) ) ] {
4438
+ extern "C" {
4439
+ pub fn fallocate64( fd: :: c_int, mode: :: c_int, offset: :: off64_t, len: :: off64_t) -> :: c_int;
4440
+ pub fn fgetpos64( stream: * mut :: FILE , ptr: * mut fpos64_t) -> :: c_int;
4441
+ pub fn fopen64( filename: * const c_char, mode: * const c_char) -> * mut :: FILE ;
4442
+ pub fn freopen64(
4443
+ filename: * const c_char,
4444
+ mode: * const c_char,
4445
+ file: * mut :: FILE ,
4446
+ ) -> * mut :: FILE ;
4447
+ pub fn fseeko64( stream: * mut :: FILE , offset: :: off64_t, whence: :: c_int) -> :: c_int;
4448
+ pub fn fsetpos64( stream: * mut :: FILE , ptr: * const fpos64_t) -> :: c_int;
4449
+ pub fn ftello64( stream: * mut :: FILE ) -> :: off64_t;
4450
+ pub fn posix_fallocate64( fd: :: c_int, offset: :: off64_t, len: :: off64_t) -> :: c_int;
4451
+ pub fn sendfile64(
4452
+ out_fd: :: c_int,
4453
+ in_fd: :: c_int,
4454
+ offset: * mut off64_t,
4455
+ count: :: size_t,
4456
+ ) -> :: ssize_t;
4457
+ pub fn tmpfile64( ) -> * mut :: FILE ;
4458
+ }
4459
+ }
4460
+ }
4461
+
4446
4462
cfg_if ! {
4447
4463
if #[ cfg( target_env = "uclibc" ) ] {
4448
4464
mod uclibc;
0 commit comments