process-util: introduce procfs_file_get_field() wrapper
which combines procfs_file_alloca() and get_proc_field()
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "assert-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-util.h"
|
||||
#include "macro.h"
|
||||
#include "pidref.h"
|
||||
@@ -33,6 +34,10 @@
|
||||
(const char*) _r_; \
|
||||
})
|
||||
|
||||
static inline int procfs_file_get_field(pid_t pid, const char *name, const char *key, char **ret) {
|
||||
return get_proc_field(procfs_file_alloca(pid, name), key, ret);
|
||||
}
|
||||
|
||||
typedef enum ProcessCmdlineFlags {
|
||||
PROCESS_CMDLINE_COMM_FALLBACK = 1 << 0,
|
||||
PROCESS_CMDLINE_USE_LOCALE = 1 << 1,
|
||||
|
||||
Reference in New Issue
Block a user