chiark / gitweb /
Prep v234: Apply missing upstream fixes in src/basic (1/6)
[elogind.git] / src / basic / process-util.h
index 6a41db18485c9910ee872758fc24577acaf3e39a..171e871896529d82a29f55d7f83b0e9ff2a83aff 100644 (file)
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/resource.h>
 #include <sys/types.h>
 
-#include "formats-util.h"
+#include "format-util.h"
+//#include "ioprio.h"
 #include "macro.h"
 
 #define procfs_file_alloca(pid, field)                                  \
@@ -66,7 +68,7 @@ void sigkill_waitp(pid_t *pid);
 
 int kill_and_sigcont(pid_t pid, int sig);
 
-void rename_process(const char name[8]);
+int rename_process(const char name[]);
 #endif // 0
 int is_kernel_thread(pid_t pid);
 
@@ -114,6 +116,18 @@ void valgrind_summary_hack(void);
 
 int pid_compare_func(const void *a, const void *b);
 
+#if 0 /// UNNEEDED by elogind
 static inline bool nice_is_valid(int n) {
         return n >= PRIO_MIN && n < PRIO_MAX;
 }
+
+static inline bool ioprio_class_is_valid(int i) {
+        return IN_SET(i, IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE);
+}
+
+static inline bool ioprio_priority_is_valid(int i) {
+        return i >= 0 && i < IOPRIO_BE_NR;
+}
+
+int ioprio_parse_priority(const char *s, int *ret);
+#endif // 0