basic: introduce *_to_string_with_check() functions
They are used in later commits.
This commit is contained in:
@@ -137,6 +137,13 @@ static inline bool pid_is_valid(pid_t p) {
|
||||
return p > 0;
|
||||
}
|
||||
|
||||
static inline int sched_policy_to_string_alloc_with_check(int n, char **s) {
|
||||
if (!sched_policy_is_valid(n))
|
||||
return -EINVAL;
|
||||
|
||||
return sched_policy_to_string_alloc(n, s);
|
||||
}
|
||||
|
||||
int ioprio_parse_priority(const char *s, int *ret);
|
||||
|
||||
pid_t getpid_cached(void);
|
||||
|
||||
Reference in New Issue
Block a user