<funcprototype>
<funcdef>int <function>sd_event_source_get_child_pid</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>pid_t *<parameter>pid</parameter></paramdef>
+ <paramdef>pid_t *<parameter>ret</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_io_events</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>uint32_t *<parameter>events</parameter></paramdef>
+ <paramdef>uint32_t *<parameter>ret</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_io_revents</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>uint32_t *<parameter>revents</parameter></paramdef>
+ <paramdef>uint32_t *<parameter>ret</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_time</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>uint64_t *<parameter>usec</parameter></paramdef>
+ <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_time_accuracy</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>uint64_t *<parameter>usec</parameter></paramdef>
+ <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcprototype>
<funcdef>int <function>sd_event_source_get_time_clock</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>clockid_t *<parameter>clock</parameter></paramdef>
+ <paramdef>clockid_t *<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcprototype>
<funcdef>int <function>sd_event_get_exit_code</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
- <paramdef>int *<parameter>code</parameter></paramdef>
+ <paramdef>int *<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
otherwise no further operation is executed.</para>
<para><function>sd_event_get_exit_code()</function> may be used to query the exit code passed to an
- earlier call of <function>sd_event_exit()</function>. The return parameter <parameter>code</parameter>
+ earlier call of <function>sd_event_exit()</function>. The return parameter <parameter>ret</parameter>
may be set to <constant>NULL</constant>, in order to simply check if <function>sd_event_exit()</function>
has been called before (as <function>sd_event_get_exit_code()</function> fails with
<constant>-ENODATA</constant> if that's not the case, see below).</para>
<funcprototype>
<funcdef>int <function>sd_event_get_tid</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
- <paramdef>pid_t *<parameter>tid</parameter></paramdef>
+ <paramdef>pid_t *<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcdef>int <function>sd_event_now</function></funcdef>
<paramdef>sd_event *<parameter>event</parameter></paramdef>
<paramdef>clockid_t <parameter>clock</parameter></paramdef>
- <paramdef>uint64_t *<parameter>usec</parameter></paramdef>
+ <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<constant>CLOCK_BOOTTIME_ALARM</constant>), see
<citerefentry project='man-pages'><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for more information on the various clocks. The retrieved
- timestamp is stored in the <parameter>usec</parameter> parameter,
+ timestamp is stored in the <parameter>ret</parameter> parameter,
in μs since the clock's epoch. If this function is invoked before
the first event loop iteration, the current time is returned, as
reported by <function>clock_gettime()</function>. To distinguish
<title>Return Value</title>
<para>If the first event loop iteration has not run yet <function>sd_event_now()</function> writes
- current time to <parameter>usec</parameter> and returns a positive return value. Otherwise, it will
- write the requested timestamp to <parameter>usec</parameter> and return 0. On failure, the call returns a
+ current time to <parameter>ret</parameter> and returns a positive return value. Otherwise, it will
+ write the requested timestamp to <parameter>ret</parameter> and return 0. On failure, the call returns a
negative errno-style error code.</para>
<refsect2>
<funcprototype>
<funcdef>int <function>sd_event_source_get_description</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>const char **<parameter>description</parameter></paramdef>
+ <paramdef>const char **<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para><function>sd_event_source_get_description()</function> may
be used to query the current descriptive name assigned to the
event source object <parameter>source</parameter>. It returns a
- pointer to the current name in <parameter>description</parameter>,
+ pointer to the current name in <parameter>ret</parameter>,
stored in memory internal to the event source. The memory is
invalidated when the event source is destroyed or the descriptive
name is changed.</para>
<funcprototype>
<funcdef>int <function>sd_event_source_get_enabled</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
- <paramdef>int *<parameter>enabled</parameter></paramdef>
+ <paramdef>int *<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para><function>sd_event_source_get_enabled()</function> may be used to query whether the event source
object <parameter>source</parameter> is currently enabled or not. If both the
- <parameter>source</parameter> and the output parameter <parameter>enabled</parameter> are
+ <parameter>source</parameter> and the output parameter <parameter>ret</parameter> are
<constant>NULL</constant>, this function returns false. Otherwise, <parameter>source</parameter> must be
a valid pointer to an <structname>sd_event_source</structname> object. If the output parameter
- <parameter>enabled</parameter> is not <constant>NULL</constant>, it is set to the enablement state (one
+ <parameter>ret</parameter> is not <constant>NULL</constant>, it is set to the enablement state (one
of <constant>SD_EVENT_ON</constant>, <constant>SD_EVENT_OFF</constant>,
<constant>SD_EVENT_ONESHOT</constant>). The function also returns true if the event source is not
disabled.</para>
return free_and_strdup(&s->description, description);
}
-_public_ int sd_event_source_get_description(sd_event_source *s, const char **description) {
+_public_ int sd_event_source_get_description(sd_event_source *s, const char **ret) {
assert_return(s, -EINVAL);
- assert_return(description, -EINVAL);
+ assert_return(ret, -EINVAL);
if (!s->description)
return -ENXIO;
- *description = s->description;
+ *ret = s->description;
return 0;
}
return 0;
}
-_public_ int sd_event_source_get_io_events(sd_event_source *s, uint32_t* events) {
+_public_ int sd_event_source_get_io_events(sd_event_source *s, uint32_t *ret) {
assert_return(s, -EINVAL);
- assert_return(events, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(s->type == SOURCE_IO, -EDOM);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *events = s->io.events;
+ *ret = s->io.events;
return 0;
}
return 0;
}
-_public_ int sd_event_source_get_io_revents(sd_event_source *s, uint32_t* revents) {
+_public_ int sd_event_source_get_io_revents(sd_event_source *s, uint32_t *ret) {
assert_return(s, -EINVAL);
- assert_return(revents, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(s->type == SOURCE_IO, -EDOM);
assert_return(s->pending, -ENODATA);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *revents = s->io.revents;
+ *ret = s->io.revents;
return 0;
}
return s->signal.sig;
}
-_public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *priority) {
+_public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *ret) {
assert_return(s, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *priority = s->priority;
+ *ret = s->priority;
return 0;
}
return 0;
}
-_public_ int sd_event_source_get_time(sd_event_source *s, uint64_t *usec) {
+_public_ int sd_event_source_get_time(sd_event_source *s, uint64_t *ret) {
assert_return(s, -EINVAL);
- assert_return(usec, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(EVENT_SOURCE_IS_TIME(s->type), -EDOM);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *usec = s->time.next;
+ *ret = s->time.next;
return 0;
}
return sd_event_source_set_time(s, usec);
}
-_public_ int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *usec) {
+_public_ int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *ret) {
assert_return(s, -EINVAL);
- assert_return(usec, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(EVENT_SOURCE_IS_TIME(s->type), -EDOM);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *usec = s->time.accuracy;
+ *ret = s->time.accuracy;
return 0;
}
return 0;
}
-_public_ int sd_event_source_get_time_clock(sd_event_source *s, clockid_t *clock) {
+_public_ int sd_event_source_get_time_clock(sd_event_source *s, clockid_t *ret) {
assert_return(s, -EINVAL);
- assert_return(clock, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(EVENT_SOURCE_IS_TIME(s->type), -EDOM);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *clock = event_source_type_to_clock(s->type);
+ *ret = event_source_type_to_clock(s->type);
return 0;
}
-_public_ int sd_event_source_get_child_pid(sd_event_source *s, pid_t *pid) {
+_public_ int sd_event_source_get_child_pid(sd_event_source *s, pid_t *ret) {
assert_return(s, -EINVAL);
- assert_return(pid, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(s->type == SOURCE_CHILD, -EDOM);
assert_return(!event_origin_changed(s->event), -ECHILD);
- *pid = s->child.pid;
+ *ret = s->child.pid;
return 0;
}
return e->state;
}
-_public_ int sd_event_get_exit_code(sd_event *e, int *code) {
+_public_ int sd_event_get_exit_code(sd_event *e, int *ret) {
assert_return(e, -EINVAL);
assert_return(e = event_resolve(e), -ENOPKG);
assert_return(!event_origin_changed(e), -ECHILD);
if (!e->exit_requested)
return -ENODATA;
- if (code)
- *code = e->exit_code;
+ if (ret)
+ *ret = e->exit_code;
return 0;
}
return 0;
}
-_public_ int sd_event_now(sd_event *e, clockid_t clock, uint64_t *usec) {
+_public_ int sd_event_now(sd_event *e, clockid_t clock, uint64_t *ret) {
assert_return(e, -EINVAL);
assert_return(e = event_resolve(e), -ENOPKG);
- assert_return(usec, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(!event_origin_changed(e), -ECHILD);
if (!TRIPLE_TIMESTAMP_HAS_CLOCK(clock))
if (!triple_timestamp_is_set(&e->timestamp)) {
/* Implicitly fall back to now() if we never ran before and thus have no cached time. */
- *usec = now(clock);
+ *ret = now(clock);
return 1;
}
- *usec = triple_timestamp_by_clock(&e->timestamp, clock);
+ *ret = triple_timestamp_by_clock(&e->timestamp, clock);
return 0;
}
return 1;
}
-_public_ int sd_event_get_tid(sd_event *e, pid_t *tid) {
+_public_ int sd_event_get_tid(sd_event *e, pid_t *ret) {
assert_return(e, -EINVAL);
assert_return(e = event_resolve(e), -ENOPKG);
- assert_return(tid, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(!event_origin_changed(e), -ECHILD);
- if (e->tid != 0) {
- *tid = e->tid;
- return 0;
- }
+ if (e->tid == 0)
+ return -ENXIO;
- return -ENXIO;
+ *ret = e->tid;
+ return 0;
}
_public_ int sd_event_set_watchdog(sd_event *e, int b) {
int sd_event_loop(sd_event *e);
int sd_event_exit(sd_event *e, int code);
-int sd_event_now(sd_event *e, clockid_t clock, uint64_t *usec);
+int sd_event_now(sd_event *e, clockid_t clock, uint64_t *ret);
int sd_event_get_fd(sd_event *e);
int sd_event_get_state(sd_event *e);
-int sd_event_get_tid(sd_event *e, pid_t *tid);
-int sd_event_get_exit_code(sd_event *e, int *code);
+int sd_event_get_tid(sd_event *e, pid_t *ret);
+int sd_event_get_exit_code(sd_event *e, int *ret);
int sd_event_set_watchdog(sd_event *e, int b);
int sd_event_get_watchdog(sd_event *e);
int sd_event_get_iteration(sd_event *e, uint64_t *ret);
void* sd_event_source_set_userdata(sd_event_source *s, void *userdata);
int sd_event_source_set_description(sd_event_source *s, const char *description);
-int sd_event_source_get_description(sd_event_source *s, const char **description);
+int sd_event_source_get_description(sd_event_source *s, const char **ret);
int sd_event_source_set_prepare(sd_event_source *s, sd_event_handler_t callback);
int sd_event_source_get_pending(sd_event_source *s);
-int sd_event_source_get_priority(sd_event_source *s, int64_t *priority);
+int sd_event_source_get_priority(sd_event_source *s, int64_t *ret);
int sd_event_source_set_priority(sd_event_source *s, int64_t priority);
-int sd_event_source_get_enabled(sd_event_source *s, int *enabled);
+int sd_event_source_get_enabled(sd_event_source *s, int *ret);
int sd_event_source_set_enabled(sd_event_source *s, int enabled);
int sd_event_source_get_io_fd(sd_event_source *s);
int sd_event_source_set_io_fd(sd_event_source *s, int fd);
int sd_event_source_get_io_fd_own(sd_event_source *s);
int sd_event_source_set_io_fd_own(sd_event_source *s, int own);
-int sd_event_source_get_io_events(sd_event_source *s, uint32_t* events);
+int sd_event_source_get_io_events(sd_event_source *s, uint32_t *ret);
int sd_event_source_set_io_events(sd_event_source *s, uint32_t events);
-int sd_event_source_get_io_revents(sd_event_source *s, uint32_t* revents);
-int sd_event_source_get_time(sd_event_source *s, uint64_t *usec);
+int sd_event_source_get_io_revents(sd_event_source *s, uint32_t *ret);
+int sd_event_source_get_time(sd_event_source *s, uint64_t *ret);
int sd_event_source_set_time(sd_event_source *s, uint64_t usec);
int sd_event_source_set_time_relative(sd_event_source *s, uint64_t usec);
-int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *usec);
+int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *ret);
int sd_event_source_set_time_accuracy(sd_event_source *s, uint64_t usec);
-int sd_event_source_get_time_clock(sd_event_source *s, clockid_t *clock);
+int sd_event_source_get_time_clock(sd_event_source *s, clockid_t *ret);
int sd_event_source_get_signal(sd_event_source *s);
-int sd_event_source_get_child_pid(sd_event_source *s, pid_t *pid);
+int sd_event_source_get_child_pid(sd_event_source *s, pid_t *ret);
int sd_event_source_get_child_pidfd(sd_event_source *s);
int sd_event_source_get_child_pidfd_own(sd_event_source *s);
int sd_event_source_set_child_pidfd_own(sd_event_source *s, int own);