Skip to content

Commit 57c58d5

Browse files
committed
Auto merge of #3288 - devnexen:android_pthread_atr_inherited, r=JohnTitor
android adding few more pthread api calls.
2 parents 30a7a9f + 727c42a commit 57c58d5

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,9 @@ fn test_android(target: &str) {
18631863
// Added in API level 28, but some tests use level 24.
18641864
"syncfs" => true,
18651865

1866+
// Added in API level 28, but some tests use level 24.
1867+
"pthread_attr_getinheritsched" | "pthread_attr_setinheritsched" => true,
1868+
18661869
_ => false,
18671870
}
18681871
});

libc-test/semver/android.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3361,8 +3361,10 @@ pthread_atfork
33613361
pthread_attr_destroy
33623362
pthread_attr_getguardsize
33633363
pthread_attr_getstack
3364+
pthread_attr_getstacksize
33643365
pthread_attr_init
33653366
pthread_attr_setdetachstate
3367+
pthread_attr_setguardsize
33663368
pthread_attr_setstacksize
33673369
pthread_attr_t
33683370
pthread_barrierattr_destroy

src/unix/linux_like/android/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,9 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
12191219
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
12201220
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
12211221

1222+
pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 0;
1223+
pub const PTHREAD_INHERIT_SCHED: ::c_int = 1;
1224+
12221225
// stdio.h
12231226
pub const RENAME_NOREPLACE: ::c_int = 1;
12241227
pub const RENAME_EXCHANGE: ::c_int = 2;
@@ -3475,6 +3478,17 @@ extern "C" {
34753478
attr: *const ::pthread_attr_t,
34763479
guardsize: *mut ::size_t,
34773480
) -> ::c_int;
3481+
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
3482+
pub fn pthread_attr_getstacksize(
3483+
attr: *const ::pthread_attr_t,
3484+
stacksize: *mut ::size_t,
3485+
) -> ::c_int;
3486+
pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stacksize: ::size_t) -> ::c_int;
3487+
pub fn pthread_attr_getinheritsched(
3488+
attr: *const ::pthread_attr_t,
3489+
flag: *mut ::c_int,
3490+
) -> ::c_int;
3491+
pub fn pthread_attr_setinheritsched(attr: *mut ::pthread_attr_t, flag: ::c_int) -> ::c_int;
34783492
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
34793493
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
34803494
pub fn pthread_condattr_getpshared(

0 commit comments

Comments
 (0)