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

Add pthread_once #3376

Merged
merged 1 commit into from Oct 8, 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/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