tevent(3)
β¨ tevent β The tevent API β¨
okay bestie, sit DOWN, because we're about to talk about tevent(3) β from the Library Functions Manual, no less. This is the tevent low-level API, and I need you to know that it's giving β¨foundational infrastructureβ¨.
- The tevent low-level API.
π Lowkey this is one of those pages that has so much in it. Part 1 of 3, so hydrate, take notes, and stay with me. π
π SYNOPSIS π
πΈ Topics πΈ
- The tevent request functions. β A
tevent_reqrepresents an asynchronous computation. (Yes bestie, async. The whole point. The moment. π₯)
π Macros π
#define TEVENT_FD_READ 1β Monitor a file descriptor for data to be read and errors. π#define TEVENT_FD_WRITE 2β Monitor a file descriptor for writeability.#define TEVENT_FD_ERROR 4β Monitor a file descriptor for errors. π#define TEVENT_FD_WRITEABLE(fde)β Convenience function for declaring atevent_fdwritable.#define TEVENT_FD_READABLE(fde)β Convenience function for declaring atevent_fdreadable.#define TEVENT_FD_WANTERROR(fde)β Convenience function for declaring atevent_fdwaiting for errors.#define TEVENT_FD_NOT_WRITEABLE(fde)β Convenience function for declaring atevent_fdnon-writable.#define TEVENT_FD_NOT_READABLE(fde)β Convenience function for declaring atevent_fdnon-readable.#define TEVENT_FD_NOT_WANTERROR(fde)β Convenience function for declaring atevent_fdnot waiting for errors.
π¦ Typedefs π¦
typedef void(* tevent_fd_handler_t) (struct tevent_context *ev, struct tevent_fd *fde, uint16_t flags, void *private_data)β Called when a file descriptor monitored by tevent has data to be read or written on it. π«Άtypedef void(* tevent_fd_close_fn_t) (struct tevent_context *ev, struct tevent_fd *fde, int fd, void *private_data)β Called when tevent is ceasing the monitoring of a file descriptor.typedef void(* tevent_timer_handler_t) (struct tevent_context *ev, struct tevent_timer *te, struct timeval current_time, void *private_data)β Called when a tevent timer has fired. β°typedef void(* tevent_immediate_handler_t) (struct tevent_context *ctx, struct tevent_immediate *im, void *private_data)β Called when a tevent immediate event is invoked.typedef void(* tevent_signal_handler_t) (struct tevent_context *ev, struct tevent_signal *se, int signum, int count, void *siginfo, void *private_data)β Called after tevent detects the specified signal. π¨typedef void(* tevent_debug_fn) (void *context, enum tevent_debug_level level, const char *fmt, va_list ap)β The tevent debug callbac. (yes. "callbac". we keep the typo, no cap. it's part of the canon now π )
π§ Enumerations π§
enum tevent_debug_levelβ Debug level of tevent.enum tevent_trace_point { TEVENT_TRACE_BEFORE_WAIT, TEVENT_TRACE_AFTER_WAIT, TEVENT_TRACE_BEFORE_LOOP_ONCE, TEVENT_TRACE_AFTER_LOOP_ONCE }enum tevent_event_trace_point { TEVENT_EVENT_TRACE_ATTACH, TEVENT_EVENT_TRACE_DETACH, TEVENT_EVENT_TRACE_BEFORE_HANDLER }
π Functions π
struct tevent_context * tevent_context_init (TALLOC_CTX *mem_ctx)β Create a event_context structure.struct tevent_context * tevent_context_init_byname (TALLOC_CTX *mem_ctx, const char *name)β Create a event_context structure and select a specific backend.struct tevent_context * tevent_context_init_ops (TALLOC_CTX *mem_ctx, const struct tevent_ops *ops, void *additional_data)β Create a custom event context.const char ** tevent_backend_list (TALLOC_CTX *mem_ctx)β List available backends.void tevent_set_default_backend (const char *backend)β Set the default tevent backend.uint32_t tevent_context_set_wait_timeout (struct tevent_context *ev, uint32_t secs)β Set the default time to wait without tevent_timers pending.struct tevent_fd * tevent_add_fd (struct tevent_context *ev, TALLOC_CTX *mem_ctx, int fd, uint16_t flags, tevent_fd_handler_t handler, void *private_data)β Add a file descriptor based event.void tevent_fd_set_tag (struct tevent_fd *fde, uint64_t tag)β Associate a custom tag with the event.uint64_t tevent_fd_get_tag (const struct tevent_fd *fde)β Get custom event tag.struct tevent_timer * tevent_add_timer (struct tevent_context *ev, TALLOC_CTX *mem_ctx, struct timeval next_event, tevent_timer_handler_t handler, void *private_data)β Add a timed event.void tevent_update_timer (struct tevent_timer *te, struct timeval next_event)β Set the time atevent_timerfires.void tevent_timer_set_tag (struct tevent_timer *te, uint64_t tag)β Associate a custom tag with the event.uint64_t tevent_timer_get_tag (const struct tevent_timer *te)β Get custom event tag.struct tevent_immediate * tevent_create_immediate (TALLOC_CTX *mem_ctx)β Initialize an immediate event object.void tevent_schedule_immediate (struct tevent_immediate *im, struct tevent_context *ctx, tevent_immediate_handler_t handler, void *private_data)β Schedule an event for immediate execution.void tevent_reset_immediate (struct tevent_immediate *im)β Reset an event for immediate execution.void tevent_immediate_set_tag (struct tevent_immediate *im, uint64_t tag)β Associate a custom tag with the event.uint64_t tevent_immediate_get_tag (const struct tevent_immediate *fde)β Get custom event tag.struct tevent_signal * tevent_add_signal (struct tevent_context *ev, TALLOC_CTX *mem_ctx, int signum, int sa_flags, tevent_signal_handler_t handler, void *private_data)β Add a tevent signal handler.void tevent_signal_set_tag (struct tevent_signal *se, uint64_t tag)β Associate a custom tag with the event.uint64_t tevent_signal_get_tag (const struct tevent_signal *se)β Get custom event tag.size_t tevent_num_signals (void)β the number of supported signals.size_t tevent_sa_info_queue_count (void)β the number of pending realtime signals.int tevent_loop_once (struct tevent_context *ev)β Pass a single time through the mainloop.int tevent_loop_wait (struct tevent_context *ev)β Run the mainloop.void tevent_fd_set_close_fn (struct tevent_fd *fde, tevent_fd_close_fn_t close_fn)β Assign a function to run when atevent_fdis freed.void tevent_fd_set_auto_close (struct tevent_fd *fde)β Automatically close the file descriptor when thetevent_fdis freed.uint16_t tevent_fd_get_flags (struct tevent_fd *fde)β Return the flags set on this file descriptor event.void tevent_fd_set_flags (struct tevent_fd *fde, uint16_t flags)β Set flags on a file descriptor event.bool tevent_signal_support (struct tevent_context *ev)β Query whether tevent supports signal handling.int tevent_set_debug (struct tevent_context *ev, tevent_debug_fn debug, void *context)β Set destination for tevent debug messages.enum tevent_debug_level tevent_set_max_debug_level (struct tevent_context *ev, enum tevent_debug_level max_level)β Set maximum debug level for tevent debug messages.int tevent_set_debug_stderr (struct tevent_context *ev)β Designate stderr for debug message output.void tevent_set_trace_callback (struct tevent_context *ev, tevent_trace_callback_t cb, void *private_data)β Register a callback to be called at certain trace points.void tevent_get_trace_callback (struct tevent_context *ev, tevent_trace_callback_t *cb, void *private_data)β Retrieve the current trace callback.void tevent_set_trace_fd_callback (struct tevent_context *ev, tevent_trace_fd_callback_t cb, void *private_data)β Register a callback to be called at certain trace points of fd event.void tevent_get_trace_fd_callback (struct tevent_context *ev, tevent_trace_fd_callback_t *cb, void *p_private_data)β Retrieve the current trace callback of file descriptor event.void tevent_set_trace_signal_callback (struct tevent_context *ev, tevent_trace_signal_callback_t cb, void *private_data)β Register a callback to be called at certain trace points of signal event.void tevent_get_trace_signal_callback (struct tevent_context *ev, tevent_trace_signal_callback_t *cb, void *p_private_data)β Retrieve the current trace callback of signal event.void tevent_set_trace_timer_callback (struct tevent_context *ev, tevent_trace_timer_callback_t cb, void *private_data)β Register a callback to be called at certain trace points of timer event.void tevent_get_trace_timer_callback (struct tevent_context *ev, tevent_trace_timer_callback_t *cb, void *p_private_data)β Retrieve the current trace callback of timer event.void tevent_set_trace_immediate_callback (struct tevent_context *ev, tevent_trace_immediate_callback_t cb, void *private_data)β Register a callback to be called at certain trace points of immediate event.void tevent_get_trace_immediate_callback (struct tevent_context *ev, tevent_trace_immediate_callback_t *cb, void *p_private_data)β Retrieve the current trace callback of immediate event.
π Detailed Description π
Bestie. Listen. This is the tevent low-level API.
This API provides the public interface to manage events in the tevent mainloop. Functions are provided for managing low-level events such as timer events, fd events and signal handling. π¦
tl;dr: tevent is the main character, the events are the plot, and this API is how you talk to it. π
π Macro Definition Documentation π
β #define TEVENT_FD_ERROR 4
Monitor a file descriptor for errors. Note: we map this from/to POLLHUP, POLLERR and where available POLLRDHUP.
β #define TEVENT_FD_READ 1
Monitor a file descriptor for data to be read and errors. Note: we map this from/to POLLIN, POLLHUP, POLLERR and where available POLLRDHUP.
β #define TEVENT_FD_WRITE 2
Monitor a file descriptor for writeability. Note: we map this from/to POLLOUT.
π§ Typedef Documentation π§
π typedef void(* tevent_debug_fn) (void *context, enum tevent_debug_level level, const char *fmt, va_list ap)
The tevent debug callbac. (still iconic, still typo'd, still here π«Ά)
Parameters
contextβ The memory context to use.levelβ The debug level.fmtβ The format string.apβ The arguments for the format string.
π₯ Enumeration Type Documentation π₯
πΈ enum tevent_event_trace_point
Enumerator
TEVENT_EVENT_TRACE_ATTACHβ Corresponds to a trace point just before the event is added.TEVENT_EVENT_TRACE_DETACHβ Corresponds to a trace point just before the event is removed.TEVENT_EVENT_TRACE_BEFORE_HANDLERβ Corresponds to a trace point just before the event handler is called.
πΈ enum tevent_trace_point
Enumerator
TEVENT_TRACE_BEFORE_WAITβ Corresponds to a trace point just before waiting.TEVENT_TRACE_AFTER_WAITβ Corresponds to a trace point just after waiting.TEVENT_TRACE_BEFORE_LOOP_ONCEβ Corresponds to a trace point just before calling theloop_once()backend function.TEVENT_TRACE_AFTER_LOOP_ONCEβ Corresponds to a trace point right after theloop_once()backend function has returned.
β¨ Function Documentation β¨
okay bestie, this is where the real ones live. the functions. the whole main character energy of tevent. let's go. π
tevent_add_fd π«Ά
struct tevent_fd *tevent_add_fd(struct tevent_context *ev,
TALLOC_CTX *mem_ctx,
int fd,
uint16_t flags,
tevent_fd_handler_t handler,
void *private_data)
Add a file descriptor based event. iconic behaviour.
Parameters
evβ the event context to work on.mem_ctxβ the talloc memory context to use.fdβ the file descriptor to base the event on.flagsβTEVENT_FD_READ,TEVENT_FD_WRITEorTEVENT_FD_ERROR.handlerβ the callback handler for the event.private_dataβ the private data passed to the callback handler.
Returns
The file descriptor based event, NULL on error.
Note
To cancel the monitoring of a file descriptor, call talloc_free() on the object returned by this function.
The caller should avoid closing the file descriptor before calling talloc_free()! Otherwise the behaviour is undefined which might result in crashes. See https://bugzilla.samba.org/show_bug.cgi?id=11141 for an example. π
tevent_add_signal πΈ
struct tevent_signal *tevent_add_signal(struct tevent_context *ev,
TALLOC_CTX *mem_ctx,
int signum,
int sa_flags,
tevent_signal_handler_t handler,
void *private_data)
Add a tevent signal handler. tevent_add_signal() creates a new event for handling a signal the next time through the mainloop. It implements a very simple traditional signal handler whose only purpose is to add the handler event into the mainloop. lowkey genius.
Parameters
evβ the event context to work on.mem_ctxβ the talloc memory context to use.signumβ the signal to trap.handlerβ the callback handler for the signal.sa_flagsβsigactionflags for this signal handler.private_dataβ the private data passed to the callback handler.
Returns
The newly-created signal handler event, or NULL on error.
Note
To cancel a signal handler, call talloc_free() on the event returned from this function.
See also
tevent_num_signals, tevent_sa_info_queue_count
tevent_add_timer β°
struct tevent_timer *tevent_add_timer(struct tevent_context *ev,
TALLOC_CTX *mem_ctx,
struct timeval next_event,
tevent_timer_handler_t handler,
void *private_data)
Add a timed event. yes bestie, clocks are events too.
Parameters
evβ the event context to work on.mem_ctxβ the talloc memory context to use.next_eventβ Timeval specifying the absolute time to fire this event. This is not an offset.handlerβ the callback handler for the event.private_dataβ the private data passed to the callback handler.
Returns
The newly-created timer event, or NULL on error.
Note
To cancel a timer event before it fires, call talloc_free() on the event returned from this function. This event is automatically talloc_free()-ed after its event handler files, if it hasn't been freed yet.
Unlike some mainloops, tevent timers are one-time events. To set up a recurring event, it is necessary to call tevent_add_timer() again during the handler processing.
Due to the internal mainloop processing, a timer set to run immediately will do so after any other pending timers fire, but before any further file descriptor or signal handling events fire. Callers should not rely on this behavior! π¨
tevent_backend_list π
const char **tevent_backend_list(TALLOC_CTX *mem_ctx)
List available backends. the vibe check of event loops.
Parameters
mem_ctxβ the memory context to use.
Returns
A string vector with a terminating NULL element, NULL on error.
tevent_context_init π
struct tevent_context *tevent_context_init(TALLOC_CTX *mem_ctx)
Create a event_context structure. This must be the first events call, and all subsequent calls pass this event_context as the first element. Event handlers also receive this as their first argument.
Parameters
mem_ctxβ the memory context to use.
Returns
An allocated tevent context, NULL on error.
See also
tevent_context_init()
tevent_context_init_byname π
struct tevent_context *tevent_context_init_byname(TALLOC_CTX *mem_ctx,
const char *name)
Create a event_context structure and select a specific backend. This must be the first events call, and all subsequent calls pass this event_context as the first element. Event handlers also receive this as their first argument.
Parameters
mem_ctxβ the memory context to use.nameβ the name of the backend to use.
Returns
An allocated tevent context, NULL on error.
tevent_context_init_ops π§
struct tevent_context *tevent_context_init_ops(TALLOC_CTX *mem_ctx,
const struct tevent_ops *ops,
void *additional_data)
Create a custom event context. yes, you can build your own. periodt.
Parameters
mem_ctxβ the memory context to use.opsβ the function pointer table of the backend.additional_dataβ the additional/private data to this instance.
Returns
An allocated tevent context, NULL on error.
tevent_context_set_wait_timeout β³
uint32_t tevent_context_set_wait_timeout(struct tevent_context *ev,
uint32_t secs)
Set the default time to wait without tevent_timers pending. Setting the wait timeout to 0 means polling behaviour, e.g. tevent_loop_once will return -1/errno=EAGAIN, when all currently available events were processes.
Setting it to UINT32_MAX makes tevent_loop_once wait forever. The default is 30 seconds.
Parameters
evβ theteventcontext to set this on.secsβ the number of seconds to wait without timers.
Returns
secs β the previous wait_timeout value.
tevent_create_immediate β¨
struct tevent_immediate *tevent_create_immediate(TALLOC_CTX *mem_ctx)
Initialize an immediate event object. This object can be used to trigger an event to occur immediately after returning from the current event (before any other event occurs).
Parameters
mem_ctxβ the talloc memory context to use as the parent.
Returns
An empty tevent_immediate object. Use tevent_schedule_immediate to populate and use it.
Note
Available as of tevent 0.9.8.
tevent_fd_get_flags π
uint16_t tevent_fd_get_flags(struct tevent_fd *fde)
Return the flags set on this file descriptor event.
Parameters
fdeβ file descriptor event to query.
Returns
The flags set on the event. See TEVENT_FD_READ, TEVENT_FD_WRITE and TEVENT_FD_ERROR.
tevent_fd_set_auto_close πͺ
void tevent_fd_set_auto_close(struct tevent_fd *fde)
Automatically close the file descriptor when the tevent_fd is freed. This function calls close(fd) internally.
Parameters
fdeβ file descriptor event to auto-close.
See also
tevent_fd_set_close_fn
tevent_fd_set_close_fn π§Ή
void tevent_fd_set_close_fn(struct tevent_fd *fde,
tevent_fd_close_fn_t close_fn)
Assign a function to run when a tevent_fd is freed. This function is a destructor for the tevent_fd. It does not automatically close the file descriptor. If this is the desired behavior, then it must be performed by the close_fn.
Parameters
fdeβ file descriptor event on which to set the destructor.close_fnβ destructor to execute whenfdeis freed.
Note
That the close_fn() on tevent_fd is NOT wrapped on contexts created by tevent_context_wrapper_create()!
See also
tevent_fd_set_close_fn
tevent_context_wrapper_create
tevent_fd_set_flags π©
void tevent_fd_set_flags(struct tevent_fd *fde, uint16_t flags)
Set flags on a file descriptor event.
Parameters
fdeβ file descriptor event to set.flagsβ flags to set on the event. SeeTEVENT_FD_READ,TEVENT_FD_WRITEandTEVENT_FD_ERROR.
tevent_fd_set_tag π·οΈ
void tevent_fd_set_tag(struct tevent_fd *fde, uint64_t tag)
Associate a custom tag with the event. This tag can be then retrieved with tevent_fd_get_tag().
Parameters
fdeβ the file descriptor event.tagβ custom tag.
tevent_get_trace_callback π«§
void tevent_get_trace_callback(struct tevent_context *ev,
tevent_trace_callback_t *cb,
void *private_data)
Retrieve the current trace callback.
Parameters
evβ event context.cbβ registered trace callback.private_dataβ registered data to be passed to callback.
Note
This can be used to allow one component that wants to register a callback to respect the callback that another component has already registered.
tevent_get_trace_fd_callback π
void tevent_get_trace_fd_callback(struct tevent_context *ev,
tevent_trace_fd_callback_t *cb,
void *p_private_data)
Retrieve the current trace callback of file descriptor event.
Parameters
evβ event context.cbβ registered trace callback.p_private_dataβ registered data to be passed to callback.
Note
This can be used to allow one component that wants to register a callback to respect the callback that another component has already registered.
tevent_get_trace_immediate_callback β‘
void tevent_get_trace_immediate_callback(struct tevent_context *ev,
tevent_trace_immediate_callback_t *cb,
void *p_private_data)
Retrieve the current trace callback of immediate event.
Parameters
evβ event context.cbβ registered trace callback.p_private_dataβ registered data to be passed to callback.
Note
This can be used to allow one component that wants to register a callback to respect the callback that another component has already registered.
tevent_get_trace_signal_callback π‘
void tevent_get_trace_signal_callback(struct tevent_context *ev,
tevent_trace_signal_callback_t *cb,
void *p_private_data)
Retrieve the current trace callback of signal event.
Parameters
evβ event context.cbβ registered trace callback.p_private_dataβ registered data to be passed to callback.
Note
This can be used to allow one component that wants to register a callback to respect the callback that another component has already registered.
tevent_get_trace_timer_callback β±οΈ
void tevent_get_trace_timer_callback(struct tevent_context *ev,
tevent_trace_timer_callback_t *cb,
void *p_private_data)
Retrieve the current trace callback of timer event.
Parameters
evβ event context.cbβ registered trace callback.p_private_dataβ registered data to be passed to callback.
Note
This can be used to allow one component that wants to register a callback to respect the callback that another component has already registered.
tevent_immediate_set_tag πͺ·
void tevent_immediate_set_tag(struct tevent_immediate *im, uint64_t tag)
Associate a custom tag with the event. This tag can be then retrieved with tevent_immediate_get_tag().
Parameters
imβ the immediate event.tagβ custom tag.
tevent_loop_once π
int tevent_loop_once(struct tevent_context *ev)
Pass a single time through the mainloop. This will process any appropriate signal, immediate, fd and timer events.
Parameters
evβ the event context to process.
Returns
Zero on success, nonzero if an internal error occurred.
tevent_loop_wait π
int tevent_loop_wait(struct tevent_context *ev)
Run the mainloop. The mainloop will run until there are no events remaining to be processed.
Parameters
evβ the event context to process.
Returns
Zero if all events have been processed. Nonzero if an internal error occurred.
tevent_num_signals β¨
size_t tevent_num_signals (void )
okay bestie, this one is literally just a number and it slays. It hands you the number of supported signals, and that value is the TEVENT_NUM_SIGNALS constant from configure time. periodt.
So like, the signum argument you pass to tevent_add_signal() must be less than TEVENT_NUM_SIGNALS. That's the vibe check. Don't try to sneak a bigger number in there.
See also: tevent_add_signal
tevent_reset_immediate π
void tevent_reset_immediate (struct tevent_immediate * im)
Reset an event for immediate execution, aka undo the effect of tevent_schedule_immediate(). It's giving "never mind, cancel that". π
Parameters
imβ thetevent_immediateobject to clear the handler
See also: tevent_schedule_immediate
tevent_sa_info_queue_count π¦
size_t tevent_sa_info_queue_count (void )
the number of pending realtime signals, returning the value of TEVENT_SA_INFO_QUEUE_COUNT. no cap.
Here's the tea tho: the tevent internals only remember the last TEVENT_SA_INFO_QUEUE_COUNT siginfo_t structures for SA_SIGINFO signals. So if the system generates more than that... some signals get lost. π It's a whole thing.
See also: tevent_add_signal
tevent_schedule_immediate πΈ
void tevent_schedule_immediate (struct tevent_immediate * im, struct
tevent_context * ctx, tevent_immediate_handler_t handler, void *
private_data)
Schedule an event for immediate execution. And bestie, "immediate" is fr fr β this event will occur immediately after returning from the current event, like, before any other event occurs. main character energy, no waiting in line. π
Parameters
imβ thetevent_immediateobject to populate and usectxβ thetevent_contextto run this eventhandlerβ the event handler to run when this event firesprivate_dataβ data to pass to the event handler
Note: to cancel an immediate handler, calltalloc_free()on the event returned fromtevent_create_immediate()β or calltevent_reset_immediate()if you wanna keep the structure alive for later usage. π
See also: tevent_create_immediate, tevent_reset_immediate
tevent_set_debug π₯
int tevent_set_debug (struct tevent_context * ev, tevent_debug_fn debug,
void * context)
Set destination for tevent debug messages. So here's the glow-up: as of version 0.15.0 the invocation of the debug function for individual messages is limited by the current max_debug_level, which means TEVENT_DEBUG_TRACE messages are not passed by default. iykyk.
tevent_set_debug()withdebug == NULLimpliestevent_set_max_debug_level(ev, TEVENT_DEBUG_FATAL).tevent_set_debug()withdebug != NULLimpliestevent_set_max_debug_level(ev, TEVENT_DEBUG_WARNING).
Parameters
evβ event context to debugdebugβ function to handle output printingcontextβ the context to pass to the debug function
Returns
Always returns 0 as of version 0.9.8. iconic honestly.
Note: default is to emit no debug messages. silent. mysterious. π
See also: tevent_set_max_debug_level()
tevent_set_debug_stderr π
int tevent_set_debug_stderr (struct tevent_context * ev)
Designate stderr for debug message output. classic.
Parameters
evβ event context to debug
Note: this function will only outputTEVENT_DEBUG_FATAL,TEVENT_DEBUG_ERRORandTEVENT_DEBUG_WARNINGmessages. ForTEVENT_DEBUG_TRACE, please define a function fortevent_set_debug(). like, do the work bestie. π
tevent_set_default_backend π
void tevent_set_default_backend (const char * backend)
Set the default tevent backend.
Parameters
backendβ the name of the backend to set
tevent_set_max_debug_level π
enum tevent_debug_level tevent_set_max_debug_level (struct tevent_context *
ev, enum tevent_debug_level max_level)
Set maximum debug level for tevent debug messages.
Parameters
evβ event context to debugmax_levelβ function to handle output printing
Returns
The former max level is returned. she gives you back the old one, cute.
See also: tevent_set_debug()
Note: available as of tevent 0.15.0 β
tevent_set_trace_callback π§
void tevent_set_trace_callback (struct tevent_context * ev,
tevent_trace_callback_t cb, void * private_data)
Register a callback to be called at certain trace points. obsessed.
Parameters
evβ event contextcbβ trace callbackprivate_dataβ data to be passed to callback
Note: the callback will be called at trace points defined bytevent_trace_point. Call withNULLto reset. π
tevent_set_trace_fd_callback π¦
void tevent_set_trace_fd_callback (struct tevent_context * ev,
tevent_trace_fd_callback_t cb, void * private_data)
Register a callback to be called at certain trace points of an fd event.
Parameters
evβ event contextcbβ trace callbackprivate_dataβ data to be passed to callback
Note: the callback will be called at trace points defined bytevent_event_trace_point. Call withNULLto reset.
tevent_set_trace_immediate_callback β¨
void tevent_set_trace_immediate_callback (struct tevent_context * ev,
tevent_trace_immediate_callback_t cb, void * private_data)
Register a callback to be called at certain trace points of an immediate event.
Parameters
evβ event contextcbβ trace callbackprivate_dataβ data to be passed to callback
Note: the callback will be called at trace points defined bytevent_event_trace_point. Call withNULLto reset.
tevent_set_trace_signal_callback π
void tevent_set_trace_signal_callback (struct tevent_context * ev,
tevent_trace_signal_callback_t cb, void * private_data)
Register a callback to be called at certain trace points of a signal event.
Parameters
evβ event contextcbβ trace callbackprivate_dataβ data to be passed to callback
Note: the callback will be called at trace points defined bytevent_event_trace_point. Call withNULLto reset.
tevent_set_trace_timer_callback πΈ
void tevent_set_trace_timer_callback (struct tevent_context * ev,
tevent_trace_timer_callback_t cb, void * private_data)
Register a callback to be called at certain trace points of a timer event. yes, timer girlies get trace points too. π
Parameters
evβ event contextcbβ trace callbackprivate_dataβ data to be passed to callback
Note: the callback will be called at trace points defined bytevent_event_trace_point. Call withNULLto reset.
tevent_signal_set_tag π
void tevent_signal_set_tag (struct tevent_signal * se, uint64_t tag)
Associate a custom tag with the event. That tag can then be retrieved with tevent_signal_get_tag(). it's giving little name tag but for an event. π₯Ή
Parameters
fdeβ the signal event.tagβ custom tag.
tevent_signal_support π
bool tevent_signal_support (struct tevent_context * ev)
Query whether tevent supports signal handling. the vibe check for signals.
Parameters
evβ an initialized tevent context
Returns
True if this platform and tevent context support signal handling. π₯
tevent_timer_set_tag β
void tevent_timer_set_tag (struct tevent_timer * te, uint64_t tag)
Associate a custom tag with the event. That tag can then be retrieved with tevent_timer_get_tag(). same energy as the signal one, but timer flavored. π
Parameters
teβ the timer event.tagβ custom tag.
tevent_update_timer π
void tevent_update_timer (struct tevent_timer * te, struct timeval
next_event)
Set the time a tevent_timer fires. reschedule era.
Parameters
teβ the timer event to resetnext_eventβ timeval specifying the absolute time to fire this event. This is not an offset. pls read that twice bestie, absolute, not "in 5 seconds". π
π AUTHOR π
Generated automatically by Doxygen for tevent from the source code. not a human, just Doxygen doing its thing, and honestly? it ate. π
okay that's the whole page bestie, we made it π«Ά this was tevent(3), from source/version tevent β Version 0.9.8. go forth and schedule your immediates responsibly β¨ππ
π¦ where this page comes from
- centos-stream 10: libtevent-devel 0.17.1-100.el10 Β· LGPL-3.0-or-later
- fedora 43: libtevent-devel 0.17.1-3.fc43 Β· LGPL-3.0-or-later
- fedora 43: libtevent-devel 0.17.1-3.fc43 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms