1SD_EVENT_SOURCE_SET_USERDAsTdA_(e3v)ent_source_set_useSrDd_aEtVaENT_SOURCE_SET_USERDATA(3)
2
3
4

NAME

6       sd_event_source_set_userdata, sd_event_source_get_userdata - Set or
7       retrieve user data pointer of event sources
8

SYNOPSIS

10       #include <systemd/sd-event.h>
11
12       void* sd_event_source_set_userdata(sd_event_source *source,
13                                          void *userdata);
14
15       void* sd_event_source_get_userdata(sd_event_source *source);
16

DESCRIPTION

18       sd_event_source_set_userdata() may be used to set an arbitrary user
19       data pointer for the event source object specified as source. The user
20       data pointer is usually specified when creating an event source object
21       with calls such as sd_event_add_io(3) or sd_event_add_time(3), and may
22       be updated with this call. The user data pointer is also passed to all
23       handler callback functions associated with the event source. The
24       userdata parameter specifies the new user data pointer to set, the
25       function returns the previous user data pointer. Note that NULL is a
26       valid user data pointer.
27
28       sd_event_source_get_userdata() may be used to query the current user
29       data pointer assigned to the event source object source.
30

RETURN VALUE

32       On success, sd_event_source_set_userdata() and
33       sd_event_source_get_userdata() return the previously set user data
34       pointer. On failure, they return NULL.
35

NOTES

37       These APIs are implemented as a shared library, which can be compiled
38       and linked to with the libsystemd pkg-config(1) file.
39

SEE ALSO

41       sd-event(3), sd_event_add_io(3), sd_event_add_time(3),
42       sd_event_add_signal(3), sd_event_add_child(3), sd_event_add_inotify(3),
43       sd_event_add_defer(3), sd_event_source_set_description(3)
44
45
46
47systemd 253                                    SD_EVENT_SOURCE_SET_USERDATA(3)
Impressum