Skip to content

Commit 9e0e943

Browse files
committed
some time functions on glibc and musl
1 parent 88b2ed2 commit 9e0e943

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

libc-test/semver/linux-gnu.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -653,4 +653,10 @@ utmpname
653653
utmpx
654654
utmpxname
655655
euidaccess
656-
eaccess
656+
eaccess
657+
asctime
658+
asctime_r
659+
ctime
660+
ctime_r
661+
strftime
662+
strptime

libc-test/semver/linux-musl.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ pwritev64
4949
reallocarray
5050
timex
5151
euidaccess
52-
eaccess
52+
eaccess
53+
asctime
54+
asctime_r
55+
strftime
56+
strptime

src/unix/linux_like/linux/gnu/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,19 @@ extern "C" {
13351335

13361336
pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
13371337
pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
1338+
1339+
pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
1340+
pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
1341+
pub fn ctime(timep: *const time_t) -> *mut ::c_char;
1342+
pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char;
1343+
1344+
pub fn strftime(
1345+
s: *mut ::c_char,
1346+
max: ::size_t,
1347+
format: *const ::c_char,
1348+
tm: *const ::tm,
1349+
) -> ::size_t;
1350+
pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
13381351
}
13391352

13401353
extern "C" {

src/unix/linux_like/linux/musl/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,17 @@ extern "C" {
757757

758758
pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
759759
pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
760+
761+
pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
762+
pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
763+
764+
pub fn strftime(
765+
s: *mut ::c_char,
766+
max: ::size_t,
767+
format: *const ::c_char,
768+
tm: *const ::tm,
769+
) -> ::size_t;
770+
pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
760771
}
761772

762773
cfg_if! {

0 commit comments

Comments
 (0)