-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add some time functions on glibc and musl #2957
Conversation
r? @Amanieu (rust-highfive has picked a reviewer for you, use r? to override) |
While in general we provide bindings to most functions even if they're not advisable to call, is there a specific reason you need No objections if you really do need |
Yes, their static return value can be overwritten, which is not safe. I don't have any specific reason to add them, since the reentrant functions provide the same functionality. I added them for the reason that not all platforms have such reentrant successors, so exposing them may keep some kind of consistency between those systems. But they should be considered obsolete, will remove them:) |
Thanks! @bors r+ |
add some time functions on glibc and musl #### man pages * [asctime/ctime man page](https://man7.org/linux/man-pages/man3/ctime.3.html) * [strftime](https://man7.org/linux/man-pages/man3/strftime.3.html) * [strptime](https://man7.org/linux/man-pages/man3/strptime.3.html) I didn't add `ctime()/ctime_r()` on musl because they involve the `time_t` type, which elicits [a deprecation wraning](#1956). Is it fine to add these two functions on `musl`, they will have the same definitions as the `glibc` ones: ```rust pub fn ctime(timep: *const time_t) -> *mut ::c_char; pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char; ``` If it's ok, I will add them:)
💥 Test timed out |
@bors retry |
add some time functions on glibc and musl #### man pages * [asctime/ctime man page](https://man7.org/linux/man-pages/man3/ctime.3.html) * [strftime](https://man7.org/linux/man-pages/man3/strftime.3.html) * [strptime](https://man7.org/linux/man-pages/man3/strptime.3.html) I didn't add `ctime()/ctime_r()` on musl because they involve the `time_t` type, which elicits [a deprecation wraning](#1956). Is it fine to add these two functions on `musl`, they will have the same definitions as the `glibc` ones: ```rust pub fn ctime(timep: *const time_t) -> *mut ::c_char; pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char; ``` If it's ok, I will add them:)
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
1 similar comment
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
man pages
I didn't add
ctime()/ctime_r()
on musl because they involve thetime_t
type, which elicits a deprecation wraning.Is it fine to add these two functions on
musl
, they will have the same definitions as theglibc
ones:If it's ok, I will add them:)