@@ -578,17 +578,20 @@ extern "C" {
578
578
all( target_os = "macos" , target_arch = "x86" ) ,
579
579
link_name = "fopen$UNIX2003"
580
580
) ]
581
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fopen64" ) ]
581
582
pub fn fopen ( filename : * const c_char , mode : * const c_char ) -> * mut FILE ;
582
583
#[ cfg_attr(
583
584
all( target_os = "macos" , target_arch = "x86" ) ,
584
585
link_name = "freopen$UNIX2003"
585
586
) ]
587
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "freopen64" ) ]
586
588
pub fn freopen ( filename : * const c_char , mode : * const c_char , file : * mut FILE ) -> * mut FILE ;
587
589
588
590
pub fn fflush ( file : * mut FILE ) -> c_int ;
589
591
pub fn fclose ( file : * mut FILE ) -> c_int ;
590
592
pub fn remove ( filename : * const c_char ) -> c_int ;
591
593
pub fn rename ( oldname : * const c_char , newname : * const c_char ) -> c_int ;
594
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "tmpfile64" ) ]
592
595
pub fn tmpfile ( ) -> * mut FILE ;
593
596
pub fn setvbuf ( stream : * mut FILE , buffer : * mut c_char , mode : c_int , size : size_t ) -> c_int ;
594
597
pub fn setbuf ( stream : * mut FILE , buf : * mut c_char ) ;
@@ -614,8 +617,10 @@ extern "C" {
614
617
pub fn ftell ( stream : * mut FILE ) -> c_long ;
615
618
pub fn rewind ( stream : * mut FILE ) ;
616
619
#[ cfg_attr( target_os = "netbsd" , link_name = "__fgetpos50" ) ]
620
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fgetpos64" ) ]
617
621
pub fn fgetpos ( stream : * mut FILE , ptr : * mut fpos_t ) -> c_int ;
618
622
#[ cfg_attr( target_os = "netbsd" , link_name = "__fsetpos50" ) ]
623
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fsetpos64" ) ]
619
624
pub fn fsetpos ( stream : * mut FILE , ptr : * const fpos_t ) -> c_int ;
620
625
pub fn feof ( stream : * mut FILE ) -> c_int ;
621
626
pub fn ferror ( stream : * mut FILE ) -> c_int ;
@@ -827,6 +832,7 @@ extern "C" {
827
832
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
828
833
link_name = "fstat@FBSD_1.0"
829
834
) ]
835
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstat64" ) ]
830
836
pub fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
831
837
832
838
pub fn mkdir ( path : * const c_char , mode : mode_t ) -> c_int ;
@@ -840,6 +846,7 @@ extern "C" {
840
846
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
841
847
link_name = "stat@FBSD_1.0"
842
848
) ]
849
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "stat64" ) ]
843
850
pub fn stat ( path : * const c_char , buf : * mut stat ) -> c_int ;
844
851
845
852
pub fn pclose ( stream : * mut crate :: FILE ) -> c_int ;
@@ -854,16 +861,19 @@ extern "C" {
854
861
all( target_os = "macos" , target_arch = "x86" ) ,
855
862
link_name = "open$UNIX2003"
856
863
) ]
864
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "open64" ) ]
857
865
pub fn open ( path : * const c_char , oflag : c_int , ...) -> c_int ;
858
866
#[ cfg_attr(
859
867
all( target_os = "macos" , target_arch = "x86" ) ,
860
868
link_name = "creat$UNIX2003"
861
869
) ]
870
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "creat64" ) ]
862
871
pub fn creat ( path : * const c_char , mode : mode_t ) -> c_int ;
863
872
#[ cfg_attr(
864
873
all( target_os = "macos" , target_arch = "x86" ) ,
865
874
link_name = "fcntl$UNIX2003"
866
875
) ]
876
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "__fcntl_time64" ) ]
867
877
pub fn fcntl ( fd : c_int , cmd : c_int , ...) -> c_int ;
868
878
869
879
#[ cfg_attr(
@@ -886,6 +896,7 @@ extern "C" {
886
896
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
887
897
link_name = "readdir@FBSD_1.0"
888
898
) ]
899
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "readdir64" ) ]
889
900
pub fn readdir ( dirp : * mut crate :: DIR ) -> * mut crate :: dirent ;
890
901
#[ cfg_attr(
891
902
all( target_os = "macos" , target_arch = "x86" ) ,
@@ -924,6 +935,7 @@ extern "C" {
924
935
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
925
936
link_name = "fstatat@FBSD_1.1"
926
937
) ]
938
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstatat64" ) ]
927
939
pub fn fstatat ( dirfd : c_int , pathname : * const c_char , buf : * mut stat , flags : c_int ) -> c_int ;
928
940
pub fn linkat (
929
941
olddirfd : c_int ,
@@ -998,6 +1010,7 @@ extern "C" {
998
1010
pub fn isatty ( fd : c_int ) -> c_int ;
999
1011
#[ cfg_attr( target_os = "solaris" , link_name = "__link_xpg4" ) ]
1000
1012
pub fn link ( src : * const c_char , dst : * const c_char ) -> c_int ;
1013
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lseek64" ) ]
1001
1014
pub fn lseek ( fd : c_int , offset : off_t , whence : c_int ) -> off_t ;
1002
1015
pub fn pathconf ( path : * const c_char , name : c_int ) -> c_long ;
1003
1016
pub fn pipe ( fds : * mut c_int ) -> c_int ;
@@ -1060,11 +1073,13 @@ extern "C" {
1060
1073
all( target_os = "macos" , target_arch = "x86" ) ,
1061
1074
link_name = "pread$UNIX2003"
1062
1075
) ]
1076
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "pread64" ) ]
1063
1077
pub fn pread ( fd : c_int , buf : * mut c_void , count : size_t , offset : off_t ) -> ssize_t ;
1064
1078
#[ cfg_attr(
1065
1079
all( target_os = "macos" , target_arch = "x86" ) ,
1066
1080
link_name = "pwrite$UNIX2003"
1067
1081
) ]
1082
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "pwrite64" ) ]
1068
1083
pub fn pwrite ( fd : c_int , buf : * const c_void , count : size_t , offset : off_t ) -> ssize_t ;
1069
1084
pub fn umask ( mask : mode_t ) -> mode_t ;
1070
1085
@@ -1091,6 +1106,7 @@ extern "C" {
1091
1106
all( target_os = "macos" , target_arch = "x86" ) ,
1092
1107
link_name = "mmap$UNIX2003"
1093
1108
) ]
1109
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "mmap64" ) ]
1094
1110
pub fn mmap (
1095
1111
addr : * mut c_void ,
1096
1112
len : size_t ,
@@ -1117,6 +1133,7 @@ extern "C" {
1117
1133
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
1118
1134
link_name = "lstat@FBSD_1.0"
1119
1135
) ]
1136
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lstat64" ) ]
1120
1137
pub fn lstat ( path : * const c_char , buf : * mut stat ) -> c_int ;
1121
1138
1122
1139
#[ cfg_attr(
@@ -1139,7 +1156,9 @@ extern "C" {
1139
1156
1140
1157
pub fn symlink ( path1 : * const c_char , path2 : * const c_char ) -> c_int ;
1141
1158
1159
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "truncate64" ) ]
1142
1160
pub fn truncate ( path : * const c_char , length : off_t ) -> c_int ;
1161
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "ftruncate64" ) ]
1143
1162
pub fn ftruncate ( fd : c_int , length : off_t ) -> c_int ;
1144
1163
1145
1164
pub fn signal ( signum : c_int , handler : sighandler_t ) -> sighandler_t ;
@@ -1444,7 +1463,9 @@ extern "C" {
1444
1463
pub fn sem_wait ( sem : * mut sem_t ) -> c_int ;
1445
1464
pub fn sem_trywait ( sem : * mut sem_t ) -> c_int ;
1446
1465
pub fn sem_post ( sem : * mut sem_t ) -> c_int ;
1466
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "statvfs64" ) ]
1447
1467
pub fn statvfs ( path : * const c_char , buf : * mut statvfs ) -> c_int ;
1468
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstatvfs64" ) ]
1448
1469
pub fn fstatvfs ( fd : c_int , buf : * mut statvfs ) -> c_int ;
1449
1470
1450
1471
#[ cfg_attr( target_os = "netbsd" , link_name = "__sigemptyset14" ) ]
@@ -1468,7 +1489,9 @@ extern "C" {
1468
1489
1469
1490
pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> c_int ;
1470
1491
1492
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fseeko64" ) ]
1471
1493
pub fn fseeko ( stream : * mut crate :: FILE , offset : off_t , whence : c_int ) -> c_int ;
1494
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "ftello64" ) ]
1472
1495
pub fn ftello ( stream : * mut crate :: FILE ) -> off_t ;
1473
1496
#[ cfg_attr(
1474
1497
all( target_os = "macos" , target_arch = "x86" ) ,
@@ -1485,6 +1508,7 @@ extern "C" {
1485
1508
pub fn tcflush ( fd : c_int , action : c_int ) -> c_int ;
1486
1509
pub fn tcgetsid ( fd : c_int ) -> crate :: pid_t ;
1487
1510
pub fn tcsendbreak ( fd : c_int , duration : c_int ) -> c_int ;
1511
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "mkstemp64" ) ]
1488
1512
pub fn mkstemp ( template : * mut c_char ) -> c_int ;
1489
1513
pub fn mkdtemp ( template : * mut c_char ) -> * mut c_char ;
1490
1514
@@ -1509,6 +1533,7 @@ extern "C" {
1509
1533
pub fn strcasestr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
1510
1534
pub fn getline ( lineptr : * mut * mut c_char , n : * mut size_t , stream : * mut FILE ) -> ssize_t ;
1511
1535
1536
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lockf64" ) ]
1512
1537
pub fn lockf ( fd : c_int , cmd : c_int , len : off_t ) -> c_int ;
1513
1538
1514
1539
}
@@ -1609,6 +1634,7 @@ cfg_if! {
1609
1634
pub fn pause( ) -> c_int;
1610
1635
1611
1636
pub fn mkdirat( dirfd: c_int, pathname: * const c_char, mode: crate :: mode_t) -> c_int;
1637
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "openat64" ) ]
1612
1638
pub fn openat( dirfd: c_int, pathname: * const c_char, flags: c_int, ...) -> c_int;
1613
1639
1614
1640
#[ cfg_attr(
@@ -1637,6 +1663,7 @@ cfg_if! {
1637
1663
/// https://illumos.org/man/3lib/libc
1638
1664
/// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
1639
1665
/// https://www.unix.com/man-page/opensolaris/3LIB/libc/
1666
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "readdir64_r" ) ]
1640
1667
pub fn readdir_r(
1641
1668
dirp: * mut crate :: DIR ,
1642
1669
entry: * mut crate :: dirent,
0 commit comments