Skip to content
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

android adding few more pthread api calls. #3288

Merged
merged 1 commit into from Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions libc-test/build.rs
Expand Up @@ -1881,6 +1881,9 @@ fn test_android(target: &str) {
// Added in API level 28, but some tests use level 24.
"syncfs" => true,

// Added in API level 28, but some tests use level 24.
"pthread_attr_getinheritsched" | "pthread_attr_setinheritsched" => true,

_ => false,
}
});
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/android.txt
Expand Up @@ -3375,8 +3375,10 @@ pthread_atfork
pthread_attr_destroy
pthread_attr_getguardsize
pthread_attr_getstack
pthread_attr_getstacksize
pthread_attr_init
pthread_attr_setdetachstate
pthread_attr_setguardsize
pthread_attr_setstacksize
pthread_attr_t
pthread_barrierattr_destroy
Expand Down
13 changes: 13 additions & 0 deletions src/unix/linux_like/android/mod.rs
Expand Up @@ -1224,6 +1224,9 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;

pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 0;
pub const PTHREAD_INHERIT_SCHED: ::c_int = 1;

// stdio.h
pub const RENAME_NOREPLACE: ::c_int = 1;
pub const RENAME_EXCHANGE: ::c_int = 2;
Expand Down Expand Up @@ -3494,6 +3497,16 @@ extern "C" {
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
pub fn pthread_attr_getstacksize(
attr: *const ::pthread_attr_t,
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_getinheritsched(
attr: *const ::pthread_attr_t,
flag: *mut ::c_int,
) -> ::c_int;
pub fn pthread_attr_setinheritsched(attr: *mut ::pthread_attr_t, flag: ::c_int) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
pub fn pthread_condattr_getpshared(
Expand Down