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       Functions described here are available as a shared library, which can
38       be compiled against and linked to with the libsystemd pkg-config(1)
39       file.
40
41       The code described here uses getenv(3), which is declared to be not
42       multi-thread-safe. This means that the code calling the functions
43       described here must not call setenv(3) from a parallel thread. It is
44       recommended to only do calls to setenv() from an early phase of the
45       program when no other threads have been started.
46

SEE ALSO

48       sd-event(3), sd_event_add_io(3), sd_event_add_time(3),
49       sd_event_add_signal(3), sd_event_add_child(3), sd_event_add_inotify(3),
50       sd_event_add_defer(3), sd_event_source_set_description(3)
51
52
53
54systemd 254                                    SD_EVENT_SOURCE_SET_USERDATA(3)
Impressum