Skip to content

Enable strftime, mkostemp[s] on Redox #4629

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libc-test/semver/redox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ lockf
login_tty
madvise
memalign
mkostemp
mkostemps
nice
open_memstream
open_wmemstream
Expand All @@ -240,6 +242,7 @@ sigtimedwait
sigwait
strcasecmp
strcasestr
strftime
strlcat
strlcpy
strncasecmp
Expand Down
8 changes: 8 additions & 0 deletions src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,8 @@ extern "C" {
tokens: *const *mut c_char,
valuep: *mut *mut c_char,
) -> c_int;
pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int;
pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int;
pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void;

// string.h
Expand Down Expand Up @@ -1276,6 +1278,12 @@ extern "C" {
// time.h
pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int;
pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
pub fn strftime(
s: *mut c_char,
max: size_t,
format: *const c_char,
tm: *const crate::tm,
) -> size_t;

// utmp.h
pub fn login_tty(fd: c_int) -> c_int;
Expand Down
Loading