Skip to content

Commit

Permalink
Auto merge of #3376 - 0xcaff:martin/pthread_once, r=JohnTitor
Browse files Browse the repository at this point in the history
Add pthread_once

Close #3157
  • Loading branch information
bors committed Oct 8, 2023
2 parents 64db432 + 7d40148 commit c6a07e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -1926,6 +1926,7 @@ PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
PTHREAD_STACK_MIN
PTHREAD_ONCE_INIT
PTRACE_ATTACH
PTRACE_CONT
PTRACE_DETACH
Expand Down Expand Up @@ -3373,6 +3374,8 @@ pthread_barrier_wait
pthread_barrier_destroy
pthread_barrierattr_t
pthread_barrier_t
pthread_once
pthread_once_t
ptrace
ptsname_r
pwrite64
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -14,6 +14,7 @@ pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = ::c_longlong;
pub type pthread_key_t = ::c_uint;
pub type pthread_once_t = ::c_int;
pub type pthread_spinlock_t = ::c_int;

pub type __u8 = ::c_uchar;
Expand Down Expand Up @@ -1903,6 +1904,7 @@ align_const! {
size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
};
}
pub const PTHREAD_ONCE_INIT: pthread_once_t = 0;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
Expand Down Expand Up @@ -4849,6 +4851,8 @@ extern "C" {
longindex: *mut ::c_int,
) -> ::c_int;

pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int;

pub fn copy_file_range(
fd_in: ::c_int,
off_in: *mut ::off64_t,
Expand Down

0 comments on commit c6a07e6

Please sign in to comment.