PatchworkOS
19e446b
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
errno.c
Go to the documentation of this file.
1
#include <
errno.h
>
2
3
#ifdef _KERNEL_
4
#include <
kernel/sched/sched.h
>
5
#include <
kernel/sched/thread.h
>
6
#else
7
#include "
user/common/threading.h
"
8
#include <
sys/proc.h
>
9
#endif
10
11
int
*
_errno_get
(
void
)
12
{
13
static
int
garbage;
14
15
#ifdef _KERNEL_
16
thread_t
* thread =
thread_current
();
17
if
(thread ==
NULL
)
18
{
19
return
&garbage;
20
}
21
22
return
&thread->
error
;
23
#else
24
return
&
_THREAD_SELF
->self->err;
25
#endif
26
}
_errno_get
int * _errno_get(void)
Definition
errno.c:11
errno.h
thread_current
static thread_t * thread_current(void)
Retrieves the currently running thread.
Definition
thread.h:126
_THREAD_SELF
#define _THREAD_SELF
Definition
threading.h:53
NULL
#define NULL
Pointer error value.
Definition
NULL.h:25
proc.h
sched.h
thread_t
Thread of execution structure.
Definition
thread.h:61
thread_t::error
errno_t error
Definition
thread.h:72
thread.h
threading.h
src
libstd
functions
errno
errno.c
Generated on Sat Jan 24 2026 10:59:25 for PatchworkOS by
1.9.8