1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-04 13:51:24 +03:00

varlink: add API for determining number of current connections

This commit is contained in:
Lennart Poettering 2019-11-27 13:04:33 +01:00
parent d98580e438
commit c4f601f205
2 changed files with 8 additions and 0 deletions

View File

@ -2460,6 +2460,12 @@ int varlink_server_set_connections_max(VarlinkServer *s, unsigned m) {
return 0;
}
unsigned varlink_server_current_connections(VarlinkServer *s) {
assert_return(s, UINT_MAX);
return s->n_connections;
}
int varlink_server_set_description(VarlinkServer *s, const char *description) {
assert_return(s, -EINVAL);

View File

@ -150,6 +150,8 @@ unsigned varlink_server_connections_per_uid_max(VarlinkServer *s);
int varlink_server_set_connections_per_uid_max(VarlinkServer *s, unsigned m);
int varlink_server_set_connections_max(VarlinkServer *s, unsigned m);
unsigned varlink_server_current_connections(VarlinkServer *s);
int varlink_server_set_description(VarlinkServer *s, const char *description);
DEFINE_TRIVIAL_CLEANUP_FUNC(Varlink *, varlink_unref);