PatchworkOS
19e446b
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
thrd_current.c
Go to the documentation of this file.
1
#include <
stdatomic.h
>
2
#include <
stdbool.h
>
3
#include <
stdio.h
>
4
#include <
sys/proc.h
>
5
#include <
threads.h
>
6
7
#include "
user/common/syscalls.h
"
8
#include "
user/common/threading.h
"
9
10
thrd_t
thrd_current
(
void
)
11
{
12
thrd_t
thr = (
thrd_t
){.
id
=
gettid
()};
13
return
thr;
14
}
gettid
tid_t gettid(void)
System call to retrieve the current tid.
Definition
gettid.c:6
proc.h
stdatomic.h
stdbool.h
stdio.h
thrd_t
Definition
threads.h:38
thrd_t::id
tid_t id
Definition
threads.h:39
syscalls.h
thrd_current
thrd_t thrd_current(void)
Definition
thrd_current.c:10
threading.h
threads.h
src
libstd
user
functions
thread
thrd_current.c
Generated on Sat Jan 24 2026 10:59:25 for PatchworkOS by
1.9.8