X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.h;h=720e5f1bc0a408f097fe1d586b5bbb26dda9bcce;hb=d3ba4d04f6c5d22ba97ea81cdca2e2acd04dfec1;hp=6981d21d7aad6371fafda10f2ae7a68616ccaa7d;hpb=12f249b209d7fa31e3a9d53315e47a2342463e0f;p=collectd.git diff --git a/src/daemon/common.h b/src/daemon/common.h index 6981d21d..720e5f1b 100644 --- a/src/daemon/common.h +++ b/src/daemon/common.h @@ -29,6 +29,7 @@ #define COMMON_H #include "collectd.h" + #include "plugin.h" #if HAVE_PWD_H @@ -360,6 +361,9 @@ int value_to_rate (gauge_t *ret_rate, value_t value, int ds_type, cdtime_t t, * (in the range [1-65535]). Returns less than zero on error. */ int service_name_to_port_number (const char *service_name); +/* Sets various, non-default, socket options */ +void set_sock_opts (int sockfd); + /** Parse a string to a derive_t value. Returns zero on success or non-zero on * failure. If failure is returned, ret_value is not touched. */ int strtoderive (const char *string, derive_t *ret_value); @@ -371,4 +375,12 @@ int strtogauge (const char *string, gauge_t *ret_value); int strarray_add (char ***ret_array, size_t *ret_array_len, char const *str); void strarray_free (char **array, size_t array_len); +#ifdef HAVE_SYS_CAPABILITY_H +/** Check if the current process benefits from the capability passed in + * argument. Returns zero if it does, less than zero if it doesn't or on error. + * See capabilities(7) for the list of possible capabilities. + * */ +int check_capability (int capability); +#endif /* HAVE_SYS_CAPABILITY_H */ + #endif /* COMMON_H */