Skip to content

Commit c6a07e6

Browse files
committed
Auto merge of #3376 - 0xcaff:martin/pthread_once, r=JohnTitor
Add pthread_once Close #3157
2 parents 64db432 + 7d40148 commit c6a07e6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libc-test/semver/linux.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,7 @@ PTHREAD_PRIO_PROTECT
19261926
PTHREAD_PROCESS_PRIVATE
19271927
PTHREAD_PROCESS_SHARED
19281928
PTHREAD_STACK_MIN
1929+
PTHREAD_ONCE_INIT
19291930
PTRACE_ATTACH
19301931
PTRACE_CONT
19311932
PTRACE_DETACH
@@ -3373,6 +3374,8 @@ pthread_barrier_wait
33733374
pthread_barrier_destroy
33743375
pthread_barrierattr_t
33753376
pthread_barrier_t
3377+
pthread_once
3378+
pthread_once_t
33763379
ptrace
33773380
ptsname_r
33783381
pwrite64

src/unix/linux_like/linux/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub type nl_item = ::c_int;
1414
pub type idtype_t = ::c_uint;
1515
pub type loff_t = ::c_longlong;
1616
pub type pthread_key_t = ::c_uint;
17+
pub type pthread_once_t = ::c_int;
1718
pub type pthread_spinlock_t = ::c_int;
1819

1920
pub type __u8 = ::c_uchar;
@@ -1903,6 +1904,7 @@ align_const! {
19031904
size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
19041905
};
19051906
}
1907+
pub const PTHREAD_ONCE_INIT: pthread_once_t = 0;
19061908
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
19071909
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
19081910
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
@@ -4849,6 +4851,8 @@ extern "C" {
48494851
longindex: *mut ::c_int,
48504852
) -> ::c_int;
48514853

4854+
pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int;
4855+
48524856
pub fn copy_file_range(
48534857
fd_in: ::c_int,
48544858
off_in: *mut ::off64_t,

0 commit comments

Comments
 (0)