PatchworkOS
966e257
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
atnotify.c
Go to the documentation of this file.
1
#include <
user/common/note.h
>
2
3
#include <
sys/proc.h
>
4
5
#include <
errno.h
>
6
7
uint64_t
atnotify
(
atnotify_func_t
func,
atnotify_t
action)
8
{
9
if
(func ==
NULL
)
10
{
11
errno
=
EINVAL
;
12
return
ERR
;
13
}
14
15
switch
(action)
16
{
17
case
ATNOTIFY_ADD
:
18
if
(
_note_handler_add
(func) ==
ERR
)
19
{
20
errno
=
ENOMEM
;
21
return
ERR
;
22
}
23
break
;
24
case
ATNOTIFY_REMOVE
:
25
_note_handler_remove
(func);
26
break
;
27
default
:
28
errno
=
EINVAL
;
29
return
ERR
;
30
}
31
32
return
0;
33
}
errno.h
EINVAL
#define EINVAL
Invalid argument.
Definition
errno.h:142
ENOMEM
#define ENOMEM
Out of memory.
Definition
errno.h:92
errno
#define errno
Error number variable.
Definition
errno.h:27
atnotify_t
atnotify_t
Action type for atnotify().
Definition
proc.h:310
atnotify_func_t
uint64_t(* atnotify_func_t)(char *note)
User space atnotify() handler function type.
Definition
proc.h:318
atnotify
uint64_t atnotify(atnotify_func_t func, atnotify_t action)
Adds or removes a handler to be called in user space when a note is received.
Definition
atnotify.c:7
ATNOTIFY_REMOVE
@ ATNOTIFY_REMOVE
Definition
proc.h:312
ATNOTIFY_ADD
@ ATNOTIFY_ADD
Definition
proc.h:311
NULL
#define NULL
Pointer error value.
Definition
NULL.h:23
ERR
#define ERR
Integer error value.
Definition
ERR.h:17
_note_handler_add
uint64_t _note_handler_add(atnotify_func_t func)
Definition
note.c:76
_note_handler_remove
void _note_handler_remove(atnotify_func_t func)
Definition
note.c:90
proc.h
note.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
src
libstd
user
functions
proc
atnotify.c
Generated on Mon Dec 15 2025 21:55:53 for PatchworkOS by
1.9.8