| 1 |
'\" t |
| 2 |
.TH "SD_BUS_GET_CURRENT_HANDLER" "3" "" "systemd 261~rc3" "sd_bus_get_current_handler" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
sd_bus_get_current_handler, sd_bus_get_current_message, sd_bus_get_current_slot, sd_bus_get_current_userdata \- Query information of the callback a bus object is currently running |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.sp |
| 26 |
.ft B |
| 27 |
.nf |
| 28 |
#include <systemd/sd\-bus\&.h> |
| 29 |
.fi |
| 30 |
.ft |
| 31 |
.HP \w'typedef\ int\ (*sd_bus_message_handler_t)('u |
| 32 |
.BI "typedef int (*sd_bus_message_handler_t)(sd_bus_message\ *" "m" ", void\ *" "userdata" ", sd_bus_error\ *" "ret_error" ");" |
| 33 |
.HP \w'sd_bus_message_handler_t\ sd_bus_get_current_handler('u |
| 34 |
.BI "sd_bus_message_handler_t sd_bus_get_current_handler(sd_bus\ *" "bus" ");" |
| 35 |
.HP \w'sd_bus_message*\ sd_bus_get_current_message('u |
| 36 |
.BI "sd_bus_message* sd_bus_get_current_message(sd_bus\ *" "bus" ");" |
| 37 |
.HP \w'sd_bus_slot*\ sd_bus_get_current_slot('u |
| 38 |
.BI "sd_bus_slot* sd_bus_get_current_slot(sd_bus\ *" "bus" ");" |
| 39 |
.HP \w'void*\ sd_bus_get_current_userdata('u |
| 40 |
.BI "void* sd_bus_get_current_userdata(sd_bus\ *" "bus" ");" |
| 41 |
.SH "DESCRIPTION" |
| 42 |
.PP |
| 43 |
Whenever sd\-bus is about to invoke a user\-supplied callback function, it stores the current callback, D\-Bus message, slot and userdata pointer and allows these to be queried via |
| 44 |
\fBsd_bus_get_current_handler()\fR, |
| 45 |
\fBsd_bus_get_current_message()\fR, |
| 46 |
\fBsd_bus_get_current_slot()\fR |
| 47 |
and |
| 48 |
\fBsd_bus_get_current_userdata()\fR, respectively\&. If |
| 49 |
\fIbus\fR |
| 50 |
cannot be resolved or if execution does not reside in a user\-supplied callback of |
| 51 |
\fIbus\fR, these functions return |
| 52 |
\fBNULL\fR\&. |
| 53 |
.SH "RETURN VALUE" |
| 54 |
.PP |
| 55 |
On success, these functions return the requested object\&. On failure, they return |
| 56 |
\fBNULL\fR\&. |
| 57 |
.SH "NOTES" |
| 58 |
.PP |
| 59 |
Functions described here are available as a shared library, which can be compiled against and linked to with the |
| 60 |
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1) |
| 61 |
file\&. |
| 62 |
.PP |
| 63 |
The code described here uses |
| 64 |
\fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call |
| 65 |
\fBsetenv\fR(3) |
| 66 |
from a parallel thread\&. It is recommended to only do calls to |
| 67 |
\fBsetenv()\fR |
| 68 |
from an early phase of the program when no other threads have been started\&. |
| 69 |
.SH "HISTORY" |
| 70 |
.PP |
| 71 |
\fBsd_bus_get_current_handler()\fR, |
| 72 |
\fBsd_bus_get_current_message()\fR, |
| 73 |
\fBsd_bus_get_current_slot()\fR, and |
| 74 |
\fBsd_bus_get_current_userdata()\fR |
| 75 |
were added in version 221\&. |
| 76 |
.SH "SEE ALSO" |
| 77 |
.PP |
| 78 |
\fBsystemd\fR(1), \fBsd-bus\fR(3) |