@@ -905,6 +905,7 @@ extern "C" {
905905 all( not( gnu_time_bits64) , gnu_file_offset_bits64) ,
906906 link_name = "fstat64"
907907 ) ]
908+ #[ cfg_attr( musl32_time64, link_name = "__fstat_time64" ) ]
908909 pub fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
909910
910911 pub fn mkdir ( path : * const c_char , mode : mode_t ) -> c_int ;
@@ -923,6 +924,7 @@ extern "C" {
923924 all( not( gnu_time_bits64) , gnu_file_offset_bits64) ,
924925 link_name = "stat64"
925926 ) ]
927+ #[ cfg_attr( musl32_time64, link_name = "__stat_time64" ) ]
926928 pub fn stat ( path : * const c_char , buf : * mut stat ) -> c_int ;
927929
928930 pub fn pclose ( stream : * mut crate :: FILE ) -> c_int ;
@@ -1017,6 +1019,7 @@ extern "C" {
10171019 link_name = "fstatat64"
10181020 ) ]
10191021 #[ cfg( not( target_os = "l4re" ) ) ]
1022+ #[ cfg_attr( musl32_time64, link_name = "__fstatat_time64" ) ]
10201023 pub fn fstatat ( dirfd : c_int , pathname : * const c_char , buf : * mut stat , flags : c_int ) -> c_int ;
10211024 #[ cfg( not( target_os = "l4re" ) ) ]
10221025 pub fn linkat (
@@ -1121,6 +1124,7 @@ extern "C" {
11211124 ) ]
11221125 #[ cfg_attr( target_os = "netbsd" , link_name = "__nanosleep50" ) ]
11231126 #[ cfg_attr( gnu_time_bits64, link_name = "__nanosleep64" ) ]
1127+ #[ cfg_attr( musl32_time64, link_name = "__nanosleep_time64" ) ]
11241128 pub fn nanosleep ( rqtp : * const timespec , rmtp : * mut timespec ) -> c_int ;
11251129 pub fn tcgetpgrp ( fd : c_int ) -> pid_t ;
11261130 pub fn tcsetpgrp ( fd : c_int , pgrp : crate :: pid_t ) -> c_int ;
@@ -1165,7 +1169,7 @@ extern "C" {
11651169 pub fn umask ( mask : mode_t ) -> mode_t ;
11661170
11671171 #[ cfg_attr( target_os = "netbsd" , link_name = "__utime50" ) ]
1168- #[ cfg_attr( gnu_time_bits64, link_name = "__utime64" ) ]
1172+ #[ cfg_attr( any ( gnu_time_bits64, musl32_time64 ) , link_name = "__utime64" ) ]
11691173 pub fn utime ( file : * const c_char , buf : * const utimbuf ) -> c_int ;
11701174
11711175 #[ cfg_attr(
@@ -1220,6 +1224,7 @@ extern "C" {
12201224 all( not( gnu_time_bits64) , gnu_file_offset_bits64) ,
12211225 link_name = "lstat64"
12221226 ) ]
1227+ #[ cfg_attr( musl32_time64, link_name = "__lstat_time64" ) ]
12231228 pub fn lstat ( path : * const c_char , buf : * mut stat ) -> c_int ;
12241229
12251230 #[ cfg_attr(
@@ -1251,6 +1256,7 @@ extern "C" {
12511256
12521257 #[ cfg_attr( target_os = "netbsd" , link_name = "__getrusage50" ) ]
12531258 #[ cfg_attr( gnu_time_bits64, link_name = "__getrusage64" ) ]
1259+ #[ cfg_attr( musl32_time64, link_name = "__getrusage_time64" ) ]
12541260 pub fn getrusage ( resource : c_int , usage : * mut rusage ) -> c_int ;
12551261
12561262 #[ cfg_attr(
@@ -1333,6 +1339,7 @@ extern "C" {
13331339 link_name = "pthread_cond_timedwait$UNIX2003"
13341340 ) ]
13351341 #[ cfg_attr( gnu_time_bits64, link_name = "__pthread_cond_timedwait64" ) ]
1342+ #[ cfg_attr( musl32_time64, link_name = "__pthread_cond_timedwait_time64" ) ]
13361343 pub fn pthread_cond_timedwait (
13371344 cond : * mut crate :: pthread_cond_t ,
13381345 lock : * mut crate :: pthread_mutex_t ,
@@ -1401,9 +1408,11 @@ extern "C" {
14011408
14021409 #[ cfg_attr( target_os = "netbsd" , link_name = "__utimes50" ) ]
14031410 #[ cfg_attr( gnu_time_bits64, link_name = "__utimes64" ) ]
1411+ #[ cfg_attr( musl32_time64, link_name = "__utimes_time64" ) ]
14041412 pub fn utimes ( filename : * const c_char , times : * const crate :: timeval ) -> c_int ;
14051413 pub fn dlopen ( filename : * const c_char , flag : c_int ) -> * mut c_void ;
14061414 pub fn dlerror ( ) -> * mut c_char ;
1415+ #[ cfg_attr( musl32_time64, link_name = "__dlsym_time64" ) ]
14071416 pub fn dlsym ( handle : * mut c_void , symbol : * const c_char ) -> * mut c_void ;
14081417 pub fn dlclose ( handle : * mut c_void ) -> c_int ;
14091418
@@ -1452,49 +1461,44 @@ extern "C" {
14521461 pub fn res_init ( ) -> c_int ;
14531462
14541463 #[ cfg_attr( target_os = "netbsd" , link_name = "__gmtime_r50" ) ]
1455- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1456- // FIXME(time): for `time_t`
14571464 #[ cfg_attr( gnu_time_bits64, link_name = "__gmtime64_r" ) ]
1465+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
1466+ #[ cfg_attr( musl32_time64, link_name = "__gmtime64_r" ) ]
14581467 pub fn gmtime_r ( time_p : * const time_t , result : * mut tm ) -> * mut tm ;
14591468 #[ cfg_attr( target_os = "netbsd" , link_name = "__localtime_r50" ) ]
1460- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1461- // FIXME(time): for `time_t`
14621469 #[ cfg_attr( gnu_time_bits64, link_name = "__localtime64_r" ) ]
1470+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
1471+ #[ cfg_attr( musl32_time64, link_name = "__localtime64_r" ) ]
14631472 pub fn localtime_r ( time_p : * const time_t , result : * mut tm ) -> * mut tm ;
14641473 #[ cfg_attr(
14651474 all( target_os = "macos" , target_arch = "x86" ) ,
14661475 link_name = "mktime$UNIX2003"
14671476 ) ]
14681477 #[ cfg_attr( target_os = "netbsd" , link_name = "__mktime50" ) ]
1469- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1470- // FIXME: for `time_t`
1471- #[ cfg_attr( gnu_time_bits64, link_name = "__mktime64" ) ]
1478+ #[ cfg_attr( any( gnu_time_bits64, musl32_time64) , link_name = "__mktime64" ) ]
1479+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
14721480 pub fn mktime ( tm : * mut tm ) -> time_t ;
14731481 #[ cfg_attr( target_os = "netbsd" , link_name = "__time50" ) ]
1474- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1475- // FIXME: for `time_t`
1476- #[ cfg_attr( gnu_time_bits64, link_name = "__time64" ) ]
1482+ #[ cfg_attr( any( gnu_time_bits64, musl32_time64) , link_name = "__time64" ) ]
1483+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
14771484 pub fn time ( time : * mut time_t ) -> time_t ;
14781485 #[ cfg_attr( target_os = "netbsd" , link_name = "__gmtime50" ) ]
1479- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1480- // FIXME(time): for `time_t`
1481- #[ cfg_attr( gnu_time_bits64, link_name = "__gmtime64" ) ]
1486+ #[ cfg_attr( any( gnu_time_bits64, musl32_time64) , link_name = "__gmtime64" ) ]
1487+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
14821488 pub fn gmtime ( time_p : * const time_t ) -> * mut tm ;
14831489 #[ cfg_attr( target_os = "netbsd" , link_name = "__locatime50" ) ]
1484- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1485- // FIXME(time): for `time_t`
1486- #[ cfg_attr( gnu_time_bits64, link_name = "__localtime64" ) ]
1490+ #[ cfg_attr( any( gnu_time_bits64, musl32_time64) , link_name = "__localtime64" ) ]
1491+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
14871492 pub fn localtime ( time_p : * const time_t ) -> * mut tm ;
14881493 #[ cfg_attr( target_os = "netbsd" , link_name = "__difftime50" ) ]
1489- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1490- // FIXME(time): for `time_t`
1491- #[ cfg_attr( gnu_time_bits64, link_name = "__difftime64" ) ]
1494+ #[ cfg_attr( any( gnu_time_bits64, musl32_time64) , link_name = "__difftime64" ) ]
1495+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
14921496 pub fn difftime ( time1 : time_t , time0 : time_t ) -> c_double ;
14931497 #[ cfg( not( target_os = "aix" ) ) ]
14941498 #[ cfg_attr( target_os = "netbsd" , link_name = "__timegm50" ) ]
1495- #[ cfg_attr( any( target_env = "musl" , target_env = "ohos" ) , allow( deprecated) ) ]
1496- // FIXME(time): for `time_t`
14971499 #[ cfg_attr( gnu_time_bits64, link_name = "__timegm64" ) ]
1500+ #[ cfg_attr( not( musl32_time64) , allow( deprecated) ) ]
1501+ #[ cfg_attr( musl32_time64, link_name = "__timegm_time64" ) ]
14981502 pub fn timegm ( tm : * mut crate :: tm ) -> time_t ;
14991503
15001504 #[ cfg_attr( target_os = "netbsd" , link_name = "__mknod50" ) ]
@@ -1555,6 +1559,7 @@ extern "C" {
15551559 #[ cfg_attr( target_os = "netbsd" , link_name = "__select50" ) ]
15561560 #[ cfg_attr( target_os = "aix" , link_name = "__fd_select" ) ]
15571561 #[ cfg_attr( gnu_time_bits64, link_name = "__select64" ) ]
1562+ #[ cfg_attr( musl32_time64, link_name = "__select_time64" ) ]
15581563 pub fn select (
15591564 nfds : c_int ,
15601565 readfds : * mut fd_set ,
@@ -1683,7 +1688,7 @@ cfg_if! {
16831688 ) ) ) ] {
16841689 extern "C" {
16851690 #[ cfg_attr( target_os = "netbsd" , link_name = "__adjtime50" ) ]
1686- #[ cfg_attr( gnu_time_bits64, link_name = "__adjtime64" ) ]
1691+ #[ cfg_attr( any ( gnu_time_bits64, musl32_time64 ) , link_name = "__adjtime64" ) ]
16871692 pub fn adjtime( delta: * const timeval, olddelta: * mut timeval) -> c_int;
16881693 }
16891694 } else if #[ cfg( target_os = "solaris" ) ] {
@@ -1861,6 +1866,7 @@ cfg_if! {
18611866 ) ]
18621867 #[ cfg_attr( target_os = "netbsd" , link_name = "__pselect50" ) ]
18631868 #[ cfg_attr( gnu_time_bits64, link_name = "__pselect64" ) ]
1869+ #[ cfg_attr( musl32_time64, link_name = "__pselect_time64" ) ]
18641870 pub fn pselect(
18651871 nfds: c_int,
18661872 readfds: * mut fd_set,
0 commit comments