@@ -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,
@@ -620,6 +619,17 @@ s! {
620619 }
621620}
622621
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+
623633s_no_extra_traits ! {
624634 pub struct sockaddr_nl {
625635 pub nl_family: :: sa_family_t,
@@ -636,14 +646,6 @@ s_no_extra_traits! {
636646 pub d_name: [ :: c_char; 256 ] ,
637647 }
638648
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-
647649 pub struct sockaddr_alg {
648650 pub salg_family: :: sa_family_t,
649651 pub salg_type: [ :: c_uchar; 14 ] ,
@@ -733,6 +735,20 @@ s_no_extra_traits! {
733735 }
734736}
735737
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+
736752s_no_extra_traits ! {
737753 // linux/net_tstamp.h
738754 #[ allow( missing_debug_implementations) ]
@@ -3852,30 +3868,8 @@ extern "C" {
38523868 pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int ) -> :: c_int ;
38533869 pub fn __errno_location ( ) -> * mut :: c_int ;
38543870
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 ;
38733871 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 ;
38763872 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 ;
38793873 pub fn readahead ( fd : :: c_int , offset : :: off64_t , count : :: size_t ) -> :: ssize_t ;
38803874 pub fn getxattr (
38813875 path : * const c_char ,
@@ -4192,13 +4186,6 @@ extern "C" {
41924186 offset : * mut off_t ,
41934187 count : :: size_t ,
41944188 ) -> :: 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 ;
42024189 pub fn sigsuspend ( mask : * const :: sigset_t ) -> :: c_int ;
42034190 pub fn getgrgid_r (
42044191 gid : :: gid_t ,
@@ -4443,6 +4430,35 @@ extern "C" {
44434430 pub fn pthread_setname_np ( thread : :: pthread_t , name : * const :: c_char ) -> :: c_int ;
44444431}
44454432
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+
44464462cfg_if ! {
44474463 if #[ cfg( target_env = "uclibc" ) ] {
44484464 mod uclibc;
0 commit comments