PatchworkOS
dbbdc99
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:301
atnotify_func_t
uint64_t(* atnotify_func_t)(char *note)
User space atnotify() handler function type.
Definition
proc.h:309
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:303
ATNOTIFY_ADD
@ ATNOTIFY_ADD
Definition
proc.h:302
NULL
#define NULL
Pointer error value.
Definition
NULL.h:25
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 Thu Mar 5 2026 15:27:55 for PatchworkOS by
1.9.8