@@ -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 ,
@@ -993,6 +1005,7 @@ extern "C" {
993
1005
pub fn isatty ( fd : c_int ) -> c_int ;
994
1006
#[ cfg_attr( target_os = "solaris" , link_name = "__link_xpg4" ) ]
995
1007
pub fn link ( src : * const c_char , dst : * const c_char ) -> c_int ;
1008
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lseek64" ) ]
996
1009
pub fn lseek ( fd : c_int , offset : off_t , whence : c_int ) -> off_t ;
997
1010
pub fn pathconf ( path : * const c_char , name : c_int ) -> c_long ;
998
1011
pub fn pipe ( fds : * mut c_int ) -> c_int ;
@@ -1055,11 +1068,13 @@ extern "C" {
1055
1068
all( target_os = "macos" , target_arch = "x86" ) ,
1056
1069
link_name = "pread$UNIX2003"
1057
1070
) ]
1071
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "pread64" ) ]
1058
1072
pub fn pread ( fd : c_int , buf : * mut c_void , count : size_t , offset : off_t ) -> ssize_t ;
1059
1073
#[ cfg_attr(
1060
1074
all( target_os = "macos" , target_arch = "x86" ) ,
1061
1075
link_name = "pwrite$UNIX2003"
1062
1076
) ]
1077
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "pwrite64" ) ]
1063
1078
pub fn pwrite ( fd : c_int , buf : * const c_void , count : size_t , offset : off_t ) -> ssize_t ;
1064
1079
pub fn umask ( mask : mode_t ) -> mode_t ;
1065
1080
@@ -1086,6 +1101,7 @@ extern "C" {
1086
1101
all( target_os = "macos" , target_arch = "x86" ) ,
1087
1102
link_name = "mmap$UNIX2003"
1088
1103
) ]
1104
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "mmap64" ) ]
1089
1105
pub fn mmap (
1090
1106
addr : * mut c_void ,
1091
1107
len : size_t ,
@@ -1112,6 +1128,7 @@ extern "C" {
1112
1128
all( target_os = "freebsd" , any( freebsd11, freebsd10) ) ,
1113
1129
link_name = "lstat@FBSD_1.0"
1114
1130
) ]
1131
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lstat64" ) ]
1115
1132
pub fn lstat ( path : * const c_char , buf : * mut stat ) -> c_int ;
1116
1133
1117
1134
#[ cfg_attr(
@@ -1134,7 +1151,9 @@ extern "C" {
1134
1151
1135
1152
pub fn symlink ( path1 : * const c_char , path2 : * const c_char ) -> c_int ;
1136
1153
1154
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "truncate64" ) ]
1137
1155
pub fn truncate ( path : * const c_char , length : off_t ) -> c_int ;
1156
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "ftruncate64" ) ]
1138
1157
pub fn ftruncate ( fd : c_int , length : off_t ) -> c_int ;
1139
1158
1140
1159
pub fn signal ( signum : c_int , handler : sighandler_t ) -> sighandler_t ;
@@ -1439,7 +1458,9 @@ extern "C" {
1439
1458
pub fn sem_wait ( sem : * mut sem_t ) -> c_int ;
1440
1459
pub fn sem_trywait ( sem : * mut sem_t ) -> c_int ;
1441
1460
pub fn sem_post ( sem : * mut sem_t ) -> c_int ;
1461
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "statvfs64" ) ]
1442
1462
pub fn statvfs ( path : * const c_char , buf : * mut statvfs ) -> c_int ;
1463
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fstatvfs64" ) ]
1443
1464
pub fn fstatvfs ( fd : c_int , buf : * mut statvfs ) -> c_int ;
1444
1465
1445
1466
#[ cfg_attr( target_os = "netbsd" , link_name = "__sigemptyset14" ) ]
@@ -1463,7 +1484,9 @@ extern "C" {
1463
1484
1464
1485
pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> c_int ;
1465
1486
1487
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "fseeko64" ) ]
1466
1488
pub fn fseeko ( stream : * mut crate :: FILE , offset : off_t , whence : c_int ) -> c_int ;
1489
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "ftello64" ) ]
1467
1490
pub fn ftello ( stream : * mut crate :: FILE ) -> off_t ;
1468
1491
#[ cfg_attr(
1469
1492
all( target_os = "macos" , target_arch = "x86" ) ,
@@ -1480,6 +1503,7 @@ extern "C" {
1480
1503
pub fn tcflush ( fd : c_int , action : c_int ) -> c_int ;
1481
1504
pub fn tcgetsid ( fd : c_int ) -> crate :: pid_t ;
1482
1505
pub fn tcsendbreak ( fd : c_int , duration : c_int ) -> c_int ;
1506
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "mkstemp64" ) ]
1483
1507
pub fn mkstemp ( template : * mut c_char ) -> c_int ;
1484
1508
pub fn mkdtemp ( template : * mut c_char ) -> * mut c_char ;
1485
1509
@@ -1504,6 +1528,7 @@ extern "C" {
1504
1528
pub fn strcasestr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
1505
1529
pub fn getline ( lineptr : * mut * mut c_char , n : * mut size_t , stream : * mut FILE ) -> ssize_t ;
1506
1530
1531
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "lockf64" ) ]
1507
1532
pub fn lockf ( fd : c_int , cmd : c_int , len : off_t ) -> c_int ;
1508
1533
1509
1534
}
@@ -1604,6 +1629,7 @@ cfg_if! {
1604
1629
pub fn pause( ) -> c_int;
1605
1630
1606
1631
pub fn mkdirat( dirfd: c_int, pathname: * const c_char, mode: crate :: mode_t) -> c_int;
1632
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "openat64" ) ]
1607
1633
pub fn openat( dirfd: c_int, pathname: * const c_char, flags: c_int, ...) -> c_int;
1608
1634
1609
1635
#[ cfg_attr(
@@ -1632,6 +1658,7 @@ cfg_if! {
1632
1658
/// https://illumos.org/man/3lib/libc
1633
1659
/// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
1634
1660
/// https://www.unix.com/man-page/opensolaris/3LIB/libc/
1661
+ #[ cfg_attr( gnu_file_offset_bits64, link_name = "readdir64_r" ) ]
1635
1662
pub fn readdir_r(
1636
1663
dirp: * mut crate :: DIR ,
1637
1664
entry: * mut crate :: dirent,
0 commit comments