Skip to content

Commit

Permalink
Auto merge of #3288 - devnexen:android_pthread_atr_inherited, r=JohnT…
Browse files Browse the repository at this point in the history
…itor

android adding few more pthread api calls.
  • Loading branch information
bors committed Sep 23, 2023
2 parents 6bfea27 + 7a3357a commit c393de3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit c393de3

Please sign in to comment.