add fmemopen, open_memstream, and open_wmemstream for POSIX.1-2008

Skip test on aarch64 due to https://github.com/rust-lang/libc/issues/1765
This commit is contained in:
Jed Brown 2020-08-06 22:57:08 -06:00
parent c9ff3e9b4e
commit 3f9f49aacd
2 changed files with 15 additions and 1 deletions

3
libc-test/build.rs Normal file → Executable file
View File

@ -1592,7 +1592,8 @@ fn test_android(target: &str) {
// https://github.com/rust-lang/libc/issues/1765
"lockf" | "preadv64" | "pwritev64" | "openpty" | "forkpty"
| "login_tty" | "getifaddrs" | "freeifaddrs" | "sethostname"
| "getgrgid_r" | "getgrnam_r" | "sigtimedwait"
| "getgrgid_r" | "getgrnam_r" | "sigtimedwait" | "fmemopen"
| "open_memstream" | "open_wmemstream"
if aarch64 =>
{
true

View File

@ -419,6 +419,19 @@ extern "C" {
mode: *const c_char,
file: *mut FILE,
) -> *mut FILE;
pub fn fmemopen(
buf: *mut c_void,
size: size_t,
mode: *const c_char,
) -> *mut FILE;
pub fn open_memstream(
ptr: *mut *mut c_char,
sizeloc: *mut size_t,
) -> *mut FILE;
pub fn open_wmemstream(
ptr: *mut *mut wchar_t,
sizeloc: *mut size_t,
) -> *mut FILE;
pub fn fflush(file: *mut FILE) -> c_int;
pub fn fclose(file: *mut FILE) -> c_int;
pub fn remove(filename: *const c_char) -> c_int;