diff options
author | bors <bors@rust-lang.org> | 2023-03-29 09:26:25 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-03-29 09:26:25 +0000 |
commit | 21d90af7feff1c981f77cdb9d48d1fb3e55309d0 (patch) | |
tree | fb60f4155e6ce9ba37d986d9cc4796b03f763445 | |
parent | a7c13b991cab7781b1b46ec458378b69c5e9ac80 (diff) | |
parent | 78244febfab8590aac58308e7b7c3153bc556c4a (diff) | |
download | rust-libc-21d90af7feff1c981f77cdb9d48d1fb3e55309d0.tar.gz |
Auto merge of #3152 - shua:mactime, r=JohnTitor
mac time.h functions
I used these in https://github.com/shua/graf because I'm used to them, and don't really want to pull in time or chrono just for some stuff already present in libc.h . Compilation worked fine on my linux target, but failed on mac osx because these weren't defined in rust-lang/libc (but these are all present in 13.1 SDK).
-rw-r--r-- | libc-test/semver/apple.txt | 7 | ||||
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index b697b893ae..244fe7d780 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1819,6 +1819,8 @@ arc4random arc4random_buf arc4random_uniform arphdr +asctime +asctime_r attrgroup_t attribute_set_t attrlist @@ -1845,6 +1847,8 @@ copyfile copyfile_flags_t cpu_subtype_t cpu_type_t +ctime +ctime_r ctl_info difftime dirfd @@ -1880,6 +1884,7 @@ futimes getattrlist getattrlistat getattrlistbulk +getdate getdomainname getdtablesize getfsstat @@ -2181,8 +2186,10 @@ stack_t statfs strcasecmp strcasestr +strftime strncasecmp strndup +strptime strsignal strtonum sync diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 519a993465..3348a7a8af 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -5121,6 +5121,23 @@ extern "C" { pub fn endutxent(); pub fn utmpxname(file: *const ::c_char) -> ::c_int; + pub fn asctime(tm: *const ::tm) -> *mut ::c_char; + pub fn ctime(clock: *const time_t) -> *mut ::c_char; + pub fn getdate(datestr: *const ::c_char) -> *mut ::tm; + pub fn strftime( + buf: *mut ::c_char, + maxsize: ::size_t, + format: *const ::c_char, + timeptr: *const ::tm, + ) -> ::size_t; + pub fn strptime( + buf: *const ::c_char, + format: *const ::c_char, + timeptr: *mut ::tm, + ) -> *mut ::c_char; + pub fn asctime_r(tm: *const ::tm, result: *mut ::c_char) -> *mut ::c_char; + pub fn ctime_r(clock: *const time_t, result: *mut ::c_char) -> *mut ::c_char; + pub fn getnameinfo( sa: *const ::sockaddr, salen: ::socklen_t, |