@@ -577,17 +577,20 @@ extern "C" {
577
577
all( target_os = "macos" , target_arch = "x86" ) ,
578
578
link_name = "fopen$UNIX2003"
579
579
) ]
580
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fopen64" ) ]
580
581
pub fn fopen ( filename : * const c_char , mode : * const c_char ) -> * mut FILE ;
581
582
#[ cfg_attr(
582
583
all( target_os = "macos" , target_arch = "x86" ) ,
583
584
link_name = "freopen$UNIX2003"
584
585
) ]
586
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "freopen64" ) ]
585
587
pub fn freopen ( filename : * const c_char , mode : * const c_char , file : * mut FILE ) -> * mut FILE ;
586
588
587
589
pub fn fflush ( file : * mut FILE ) -> c_int ;
588
590
pub fn fclose ( file : * mut FILE ) -> c_int ;
589
591
pub fn remove ( filename : * const c_char ) -> c_int ;
590
592
pub fn rename ( oldname : * const c_char , newname : * const c_char ) -> c_int ;
593
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "tmpfile64" ) ]
591
594
pub fn tmpfile ( ) -> * mut FILE ;
592
595
pub fn setvbuf ( stream : * mut FILE , buffer : * mut c_char , mode : c_int , size : size_t ) -> c_int ;
593
596
pub fn setbuf ( stream : * mut FILE , buf : * mut c_char ) ;
@@ -613,8 +616,10 @@ extern "C" {
613
616
pub fn ftell ( stream : * mut FILE ) -> c_long ;
614
617
pub fn rewind ( stream : * mut FILE ) ;
615
618
#[ cfg_attr( target_os = "netbsd" , link_name = "__fgetpos50" ) ]
619
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fgetpos64" ) ]
616
620
pub fn fgetpos ( stream : * mut FILE , ptr : * mut fpos_t ) -> c_int ;
617
621
#[ cfg_attr( target_os = "netbsd" , link_name = "__fsetpos50" ) ]
622
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fsetpos64" ) ]
618
623
pub fn fsetpos ( stream : * mut FILE , ptr : * const fpos_t ) -> c_int ;
619
624
pub fn feof ( stream : * mut FILE ) -> c_int ;
620
625
pub fn ferror ( stream : * mut FILE ) -> c_int ;
@@ -826,6 +831,7 @@ extern "C" {
826
831
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
827
832
link_name = "fstat@FBSD_1.0"
828
833
) ]
834
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstat64" ) ]
829
835
pub fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
830
836
831
837
pub fn mkdir ( path : * const c_char , mode : mode_t ) -> c_int ;
@@ -839,6 +845,7 @@ extern "C" {
839
845
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
840
846
link_name = "stat@FBSD_1.0"
841
847
) ]
848
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "stat64" ) ]
842
849
pub fn stat ( path : * const c_char , buf : * mut stat ) -> c_int ;
843
850
844
851
pub fn pclose ( stream : * mut crate :: FILE ) -> c_int ;
@@ -853,16 +860,19 @@ extern "C" {
853
860
all( target_os = "macos" , target_arch = "x86" ) ,
854
861
link_name = "open$UNIX2003"
855
862
) ]
863
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "open64" ) ]
856
864
pub fn open ( path : * const c_char , oflag : c_int , ...) -> c_int ;
857
865
#[ cfg_attr(
858
866
all( target_os = "macos" , target_arch = "x86" ) ,
859
867
link_name = "creat$UNIX2003"
860
868
) ]
869
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "creat64" ) ]
861
870
pub fn creat ( path : * const c_char , mode : mode_t ) -> c_int ;
862
871
#[ cfg_attr(
863
872
all( target_os = "macos" , target_arch = "x86" ) ,
864
873
link_name = "fcntl$UNIX2003"
865
874
) ]
875
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "__fcntl_time64" ) ]
866
876
pub fn fcntl ( fd : c_int , cmd : c_int , ...) -> c_int ;
867
877
868
878
#[ cfg_attr(
@@ -885,6 +895,7 @@ extern "C" {
885
895
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
886
896
link_name = "readdir@FBSD_1.0"
887
897
) ]
898
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "readdir64" ) ]
888
899
pub fn readdir ( dirp : * mut crate :: DIR ) -> * mut crate :: dirent ;
889
900
#[ cfg_attr(
890
901
all( target_os = "macos" , target_arch = "x86" ) ,
@@ -923,6 +934,7 @@ extern "C" {
923
934
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
924
935
link_name = "fstatat@FBSD_1.1"
925
936
) ]
937
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstatat64" ) ]
926
938
pub fn fstatat ( dirfd : c_int , pathname : * const c_char , buf : * mut stat , flags : c_int ) -> c_int ;
927
939
pub fn linkat (
928
940
olddirfd : c_int ,
@@ -992,6 +1004,7 @@ extern "C" {
992
1004
pub fn isatty ( fd : c_int ) -> c_int ;
993
1005
#[ cfg_attr( target_os = "solaris" , link_name = "__link_xpg4" ) ]
994
1006
pub fn link ( src : * const c_char , dst : * const c_char ) -> c_int ;
1007
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lseek64" ) ]
995
1008
pub fn lseek ( fd : c_int , offset : off_t , whence : c_int ) -> off_t ;
996
1009
pub fn pathconf ( path : * const c_char , name : c_int ) -> c_long ;
997
1010
pub fn pipe ( fds : * mut c_int ) -> c_int ;
@@ -1054,11 +1067,13 @@ extern "C" {
1054
1067
all( target_os = "macos" , target_arch = "x86" ) ,
1055
1068
link_name = "pread$UNIX2003"
1056
1069
) ]
1070
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "pread64" ) ]
1057
1071
pub fn pread ( fd : c_int , buf : * mut c_void , count : size_t , offset : off_t ) -> ssize_t ;
1058
1072
#[ cfg_attr(
1059
1073
all( target_os = "macos" , target_arch = "x86" ) ,
1060
1074
link_name = "pwrite$UNIX2003"
1061
1075
) ]
1076
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "pwrite64" ) ]
1062
1077
pub fn pwrite ( fd : c_int , buf : * const c_void , count : size_t , offset : off_t ) -> ssize_t ;
1063
1078
pub fn umask ( mask : mode_t ) -> mode_t ;
1064
1079
@@ -1085,6 +1100,7 @@ extern "C" {
1085
1100
all( target_os = "macos" , target_arch = "x86" ) ,
1086
1101
link_name = "mmap$UNIX2003"
1087
1102
) ]
1103
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "mmap64" ) ]
1088
1104
pub fn mmap (
1089
1105
addr : * mut c_void ,
1090
1106
len : size_t ,
@@ -1111,6 +1127,7 @@ extern "C" {
1111
1127
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
1112
1128
link_name = "lstat@FBSD_1.0"
1113
1129
) ]
1130
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lstat64" ) ]
1114
1131
pub fn lstat ( path : * const c_char , buf : * mut stat ) -> c_int ;
1115
1132
1116
1133
#[ cfg_attr(
@@ -1133,7 +1150,9 @@ extern "C" {
1133
1150
1134
1151
pub fn symlink ( path1 : * const c_char , path2 : * const c_char ) -> c_int ;
1135
1152
1153
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "truncate64" ) ]
1136
1154
pub fn truncate ( path : * const c_char , length : off_t ) -> c_int ;
1155
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "ftruncate64" ) ]
1137
1156
pub fn ftruncate ( fd : c_int , length : off_t ) -> c_int ;
1138
1157
1139
1158
pub fn signal ( signum : c_int , handler : sighandler_t ) -> sighandler_t ;
@@ -1438,7 +1457,9 @@ extern "C" {
1438
1457
pub fn sem_wait ( sem : * mut sem_t ) -> c_int ;
1439
1458
pub fn sem_trywait ( sem : * mut sem_t ) -> c_int ;
1440
1459
pub fn sem_post ( sem : * mut sem_t ) -> c_int ;
1460
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "statvfs64" ) ]
1441
1461
pub fn statvfs ( path : * const c_char , buf : * mut statvfs ) -> c_int ;
1462
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstatvfs64" ) ]
1442
1463
pub fn fstatvfs ( fd : c_int , buf : * mut statvfs ) -> c_int ;
1443
1464
1444
1465
#[ cfg_attr( target_os = "netbsd" , link_name = "__sigemptyset14" ) ]
@@ -1462,7 +1483,9 @@ extern "C" {
1462
1483
1463
1484
pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> c_int ;
1464
1485
1486
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fseeko64" ) ]
1465
1487
pub fn fseeko ( stream : * mut crate :: FILE , offset : off_t , whence : c_int ) -> c_int ;
1488
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "ftello64" ) ]
1466
1489
pub fn ftello ( stream : * mut crate :: FILE ) -> off_t ;
1467
1490
#[ cfg_attr(
1468
1491
all( target_os = "macos" , target_arch = "x86" ) ,
@@ -1479,6 +1502,7 @@ extern "C" {
1479
1502
pub fn tcflush ( fd : c_int , action : c_int ) -> c_int ;
1480
1503
pub fn tcgetsid ( fd : c_int ) -> crate :: pid_t ;
1481
1504
pub fn tcsendbreak ( fd : c_int , duration : c_int ) -> c_int ;
1505
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "mkstemp64" ) ]
1482
1506
pub fn mkstemp ( template : * mut c_char ) -> c_int ;
1483
1507
pub fn mkdtemp ( template : * mut c_char ) -> * mut c_char ;
1484
1508
@@ -1503,6 +1527,7 @@ extern "C" {
1503
1527
pub fn strcasestr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
1504
1528
pub fn getline ( lineptr : * mut * mut c_char , n : * mut size_t , stream : * mut FILE ) -> ssize_t ;
1505
1529
1530
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lockf64" ) ]
1506
1531
pub fn lockf ( fd : c_int , cmd : c_int , len : off_t ) -> c_int ;
1507
1532
1508
1533
}
@@ -1603,6 +1628,7 @@ cfg_if! {
1603
1628
pub fn pause( ) -> c_int;
1604
1629
1605
1630
pub fn mkdirat( dirfd: c_int, pathname: * const c_char, mode: crate :: mode_t) -> c_int;
1631
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "openat64" ) ]
1606
1632
pub fn openat( dirfd: c_int, pathname: * const c_char, flags: c_int, ...) -> c_int;
1607
1633
1608
1634
#[ cfg_attr(
@@ -1631,6 +1657,7 @@ cfg_if! {
1631
1657
/// https://illumos.org/man/3lib/libc
1632
1658
/// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
1633
1659
/// https://www.unix.com/man-page/opensolaris/3LIB/libc/
1660
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "readdir64_r" ) ]
1634
1661
pub fn readdir_r(
1635
1662
dirp: * mut crate :: DIR ,
1636
1663
entry: * mut crate :: dirent,
0 commit comments