chiark / gitweb /
tree-wide: drop copyright headers from frequent contributors
[elogind.git] / src / test / test-process-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2
3 #include <sched.h>
4 #include <sys/mount.h>
5 #include <sys/personality.h>
6 #include <sys/prctl.h>
7 #include <sys/stat.h>
8 #include <sys/types.h>
9 #include <sys/wait.h>
10 #include <unistd.h>
11 #if HAVE_VALGRIND_VALGRIND_H
12 #include <valgrind/valgrind.h>
13 #endif
14
15 #include "alloc-util.h"
16 //#include "architecture.h"
17 #include "fd-util.h"
18 #include "log.h"
19 #include "macro.h"
20 #include "parse-util.h"
21 #include "process-util.h"
22 #include "signal-util.h"
23 #include "stdio-util.h"
24 #include "string-util.h"
25 #include "terminal-util.h"
26 #include "test-helper.h"
27 #include "util.h"
28 #include "virt.h"
29
30 static void test_get_process_comm(pid_t pid) {
31         struct stat st;
32         _cleanup_free_ char *a = NULL, *c = NULL, *d = NULL, *f = NULL, *i = NULL;
33         _cleanup_free_ char *env = NULL;
34         char path[STRLEN("/proc//comm") + DECIMAL_STR_MAX(pid_t)];
35 #if 0 /// UNNEEDED by elogind
36         pid_t e;
37         uid_t u;
38         gid_t g;
39 #endif // 0
40         dev_t h;
41         int r;
42
43         xsprintf(path, "/proc/"PID_FMT"/comm", pid);
44
45         if (stat(path, &st) == 0) {
46                 assert_se(get_process_comm(pid, &a) >= 0);
47                 log_info("PID"PID_FMT" comm: '%s'", pid, a);
48         } else
49                 log_warning("%s not exist.", path);
50
51         assert_se(get_process_cmdline(pid, 0, true, &c) >= 0);
52         log_info("PID"PID_FMT" cmdline: '%s'", pid, c);
53
54         assert_se(get_process_cmdline(pid, 8, false, &d) >= 0);
55         log_info("PID"PID_FMT" cmdline truncated to 8: '%s'", pid, d);
56
57         free(d);
58         assert_se(get_process_cmdline(pid, 1, false, &d) >= 0);
59         log_info("PID"PID_FMT" cmdline truncated to 1: '%s'", pid, d);
60
61 #if 0 /// UNNEEDED by elogind
62         assert_se(get_process_ppid(pid, &e) >= 0);
63         log_info("PID"PID_FMT" PPID: "PID_FMT, pid, e);
64         assert_se(pid == 1 ? e == 0 : e > 0);
65 #endif // 0
66
67         assert_se(is_kernel_thread(pid) == 0 || pid != 1);
68
69         r = get_process_exe(pid, &f);
70         assert_se(r >= 0 || r == -EACCES);
71         log_info("PID"PID_FMT" exe: '%s'", pid, strna(f));
72
73 #if 0 /// UNNEEDED by elogind
74         assert_se(get_process_uid(pid, &u) == 0);
75         log_info("PID"PID_FMT" UID: "UID_FMT, pid, u);
76         assert_se(u == 0 || pid != 1);
77
78         assert_se(get_process_gid(pid, &g) == 0);
79         log_info("PID"PID_FMT" GID: "GID_FMT, pid, g);
80         assert_se(g == 0 || pid != 1);
81
82         r = get_process_environ(pid, &env);
83         assert_se(r >= 0 || r == -EACCES);
84         log_info("PID"PID_FMT" strlen(environ): %zi", pid, env ? (ssize_t)strlen(env) : (ssize_t)-errno);
85 #endif // 0
86
87         if (!detect_container())
88                 assert_se(get_ctty_devnr(pid, &h) == -ENXIO || pid != 1);
89
90         (void) getenv_for_pid(pid, "PATH", &i);
91         log_info("PID"PID_FMT" $PATH: '%s'", pid, strna(i));
92 }
93
94 static void test_get_process_comm_escape_one(const char *input, const char *output) {
95         _cleanup_free_ char *n = NULL;
96
97         log_info("input: <%s> — output: <%s>", input, output);
98
99         assert_se(prctl(PR_SET_NAME, input) >= 0);
100         assert_se(get_process_comm(0, &n) >= 0);
101
102         log_info("got: <%s>", n);
103
104         assert_se(streq_ptr(n, output));
105 }
106
107 static void test_get_process_comm_escape(void) {
108         _cleanup_free_ char *saved = NULL;
109
110         assert_se(get_process_comm(0, &saved) >= 0);
111
112         test_get_process_comm_escape_one("", "");
113         test_get_process_comm_escape_one("foo", "foo");
114         test_get_process_comm_escape_one("012345678901234", "012345678901234");
115         test_get_process_comm_escape_one("0123456789012345", "012345678901234");
116         test_get_process_comm_escape_one("äöüß", "\\303\\244\\303…");
117         test_get_process_comm_escape_one("xäöüß", "x\\303\\244…");
118         test_get_process_comm_escape_one("xxäöüß", "xx\\303\\244…");
119         test_get_process_comm_escape_one("xxxäöüß", "xxx\\303\\244…");
120         test_get_process_comm_escape_one("xxxxäöüß", "xxxx\\303\\244…");
121         test_get_process_comm_escape_one("xxxxxäöüß", "xxxxx\\303…");
122
123         assert_se(prctl(PR_SET_NAME, saved) >= 0);
124 }
125
126 static void test_pid_is_unwaited(void) {
127         pid_t pid;
128
129         pid = fork();
130         assert_se(pid >= 0);
131         if (pid == 0) {
132                 _exit(EXIT_SUCCESS);
133         } else {
134                 int status;
135
136                 waitpid(pid, &status, 0);
137                 assert_se(!pid_is_unwaited(pid));
138         }
139         assert_se(pid_is_unwaited(getpid_cached()));
140         assert_se(!pid_is_unwaited(-1));
141 }
142
143 static void test_pid_is_alive(void) {
144         pid_t pid;
145
146         pid = fork();
147         assert_se(pid >= 0);
148         if (pid == 0) {
149                 _exit(EXIT_SUCCESS);
150         } else {
151                 int status;
152
153                 waitpid(pid, &status, 0);
154                 assert_se(!pid_is_alive(pid));
155         }
156         assert_se(pid_is_alive(getpid_cached()));
157         assert_se(!pid_is_alive(-1));
158 }
159
160 #if 0 /// UNNEEDED by elogind
161 static void test_personality(void) {
162
163         assert_se(personality_to_string(PER_LINUX));
164         assert_se(!personality_to_string(PERSONALITY_INVALID));
165
166         assert_se(streq(personality_to_string(PER_LINUX), architecture_to_string(native_architecture())));
167
168         assert_se(personality_from_string(personality_to_string(PER_LINUX)) == PER_LINUX);
169         assert_se(personality_from_string(architecture_to_string(native_architecture())) == PER_LINUX);
170
171 #ifdef __x86_64__
172         assert_se(streq_ptr(personality_to_string(PER_LINUX), "x86-64"));
173         assert_se(streq_ptr(personality_to_string(PER_LINUX32), "x86"));
174
175         assert_se(personality_from_string("x86-64") == PER_LINUX);
176         assert_se(personality_from_string("x86") == PER_LINUX32);
177         assert_se(personality_from_string("ia64") == PERSONALITY_INVALID);
178         assert_se(personality_from_string(NULL) == PERSONALITY_INVALID);
179
180         assert_se(personality_from_string(personality_to_string(PER_LINUX32)) == PER_LINUX32);
181 #endif
182 }
183 #endif // 0
184
185 static void test_get_process_cmdline_harder(void) {
186         char path[] = "/tmp/test-cmdlineXXXXXX";
187         _cleanup_close_ int fd = -1;
188         _cleanup_free_ char *line = NULL;
189         pid_t pid;
190
191         if (geteuid() != 0)
192                 return;
193
194 #if HAVE_VALGRIND_VALGRIND_H
195         /* valgrind patches open(/proc//cmdline)
196          * so, test_get_process_cmdline_harder fails always
197          * See https://github.com/systemd/systemd/pull/3555#issuecomment-226564908 */
198         if (RUNNING_ON_VALGRIND)
199                 return;
200 #endif
201
202         pid = fork();
203         if (pid > 0) {
204                 siginfo_t si;
205
206                 (void) wait_for_terminate(pid, &si);
207
208                 assert_se(si.si_code == CLD_EXITED);
209                 assert_se(si.si_status == 0);
210
211                 return;
212         }
213
214         assert_se(pid == 0);
215         assert_se(unshare(CLONE_NEWNS) >= 0);
216
217         assert_se(mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) >= 0);
218
219         fd = mkostemp(path, O_CLOEXEC);
220         assert_se(fd >= 0);
221
222         if (mount(path, "/proc/self/cmdline", "bind", MS_BIND, NULL) < 0) {
223                 /* This happens under selinux… Abort the test in this case. */
224                 log_warning_errno(errno, "mount(..., \"/proc/self/cmdline\", \"bind\", ...) failed: %m");
225                 assert(errno == EACCES);
226                 return;
227         }
228
229         assert_se(unlink(path) >= 0);
230
231         assert_se(prctl(PR_SET_NAME, "testa") >= 0);
232
233         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
234
235         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
236         assert_se(streq(line, "[testa]"));
237         line = mfree(line);
238
239         assert_se(get_process_cmdline(getpid_cached(), 1, true, &line) >= 0);
240         assert_se(streq(line, ""));
241         line = mfree(line);
242
243         assert_se(get_process_cmdline(getpid_cached(), 2, true, &line) >= 0);
244         assert_se(streq(line, "["));
245         line = mfree(line);
246
247         assert_se(get_process_cmdline(getpid_cached(), 3, true, &line) >= 0);
248         assert_se(streq(line, "[."));
249         line = mfree(line);
250
251         assert_se(get_process_cmdline(getpid_cached(), 4, true, &line) >= 0);
252         assert_se(streq(line, "[.."));
253         line = mfree(line);
254
255         assert_se(get_process_cmdline(getpid_cached(), 5, true, &line) >= 0);
256         assert_se(streq(line, "[..."));
257         line = mfree(line);
258
259         assert_se(get_process_cmdline(getpid_cached(), 6, true, &line) >= 0);
260         assert_se(streq(line, "[...]"));
261         line = mfree(line);
262
263         assert_se(get_process_cmdline(getpid_cached(), 7, true, &line) >= 0);
264         assert_se(streq(line, "[t...]"));
265         line = mfree(line);
266
267         assert_se(get_process_cmdline(getpid_cached(), 8, true, &line) >= 0);
268         assert_se(streq(line, "[testa]"));
269         line = mfree(line);
270
271         assert_se(write(fd, "\0\0\0\0\0\0\0\0\0", 10) == 10);
272
273         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
274
275         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
276         assert_se(streq(line, "[testa]"));
277         line = mfree(line);
278
279         assert_se(write(fd, "foo\0bar\0\0\0\0\0", 10) == 10);
280
281         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) >= 0);
282         assert_se(streq(line, "foo bar"));
283         line = mfree(line);
284
285         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
286         assert_se(streq(line, "foo bar"));
287         line = mfree(line);
288
289         assert_se(write(fd, "quux", 4) == 4);
290         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) >= 0);
291         assert_se(streq(line, "foo bar quux"));
292         line = mfree(line);
293
294         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
295         assert_se(streq(line, "foo bar quux"));
296         line = mfree(line);
297
298         assert_se(get_process_cmdline(getpid_cached(), 1, true, &line) >= 0);
299         assert_se(streq(line, ""));
300         line = mfree(line);
301
302         assert_se(get_process_cmdline(getpid_cached(), 2, true, &line) >= 0);
303         assert_se(streq(line, "."));
304         line = mfree(line);
305
306         assert_se(get_process_cmdline(getpid_cached(), 3, true, &line) >= 0);
307         assert_se(streq(line, ".."));
308         line = mfree(line);
309
310         assert_se(get_process_cmdline(getpid_cached(), 4, true, &line) >= 0);
311         assert_se(streq(line, "..."));
312         line = mfree(line);
313
314         assert_se(get_process_cmdline(getpid_cached(), 5, true, &line) >= 0);
315         assert_se(streq(line, "f..."));
316         line = mfree(line);
317
318         assert_se(get_process_cmdline(getpid_cached(), 6, true, &line) >= 0);
319         assert_se(streq(line, "fo..."));
320         line = mfree(line);
321
322         assert_se(get_process_cmdline(getpid_cached(), 7, true, &line) >= 0);
323         assert_se(streq(line, "foo..."));
324         line = mfree(line);
325
326         assert_se(get_process_cmdline(getpid_cached(), 8, true, &line) >= 0);
327         assert_se(streq(line, "foo..."));
328         line = mfree(line);
329
330         assert_se(get_process_cmdline(getpid_cached(), 9, true, &line) >= 0);
331         assert_se(streq(line, "foo b..."));
332         line = mfree(line);
333
334         assert_se(get_process_cmdline(getpid_cached(), 10, true, &line) >= 0);
335         assert_se(streq(line, "foo ba..."));
336         line = mfree(line);
337
338         assert_se(get_process_cmdline(getpid_cached(), 11, true, &line) >= 0);
339         assert_se(streq(line, "foo bar..."));
340         line = mfree(line);
341
342         assert_se(get_process_cmdline(getpid_cached(), 12, true, &line) >= 0);
343         assert_se(streq(line, "foo bar..."));
344         line = mfree(line);
345
346         assert_se(get_process_cmdline(getpid_cached(), 13, true, &line) >= 0);
347         assert_se(streq(line, "foo bar quux"));
348         line = mfree(line);
349
350         assert_se(get_process_cmdline(getpid_cached(), 14, true, &line) >= 0);
351         assert_se(streq(line, "foo bar quux"));
352         line = mfree(line);
353
354         assert_se(get_process_cmdline(getpid_cached(), 1000, true, &line) >= 0);
355         assert_se(streq(line, "foo bar quux"));
356         line = mfree(line);
357
358         assert_se(ftruncate(fd, 0) >= 0);
359         assert_se(prctl(PR_SET_NAME, "aaaa bbbb cccc") >= 0);
360
361         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
362
363         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
364         assert_se(streq(line, "[aaaa bbbb cccc]"));
365         line = mfree(line);
366
367         assert_se(get_process_cmdline(getpid_cached(), 10, true, &line) >= 0);
368         assert_se(streq(line, "[aaaa...]"));
369         line = mfree(line);
370
371         assert_se(get_process_cmdline(getpid_cached(), 11, true, &line) >= 0);
372         assert_se(streq(line, "[aaaa...]"));
373         line = mfree(line);
374
375         assert_se(get_process_cmdline(getpid_cached(), 12, true, &line) >= 0);
376         assert_se(streq(line, "[aaaa b...]"));
377         line = mfree(line);
378
379         safe_close(fd);
380         _exit(EXIT_SUCCESS);
381 }
382
383 #if 0 /// UNNEEDED by elogind
384 static void test_rename_process_now(const char *p, int ret) {
385         _cleanup_free_ char *comm = NULL, *cmdline = NULL;
386         int r;
387
388         r = rename_process(p);
389         assert_se(r == ret ||
390                   (ret == 0 && r >= 0) ||
391                   (ret > 0 && r > 0));
392
393         if (r < 0)
394                 return;
395
396 #if HAVE_VALGRIND_VALGRIND_H
397         /* see above, valgrind is weird, we can't verify what we are doing here */
398         if (RUNNING_ON_VALGRIND)
399                 return;
400 #endif
401
402         assert_se(get_process_comm(0, &comm) >= 0);
403         log_info("comm = <%s>", comm);
404         assert_se(strneq(comm, p, TASK_COMM_LEN-1));
405
406         assert_se(get_process_cmdline(0, 0, false, &cmdline) >= 0);
407         /* we cannot expect cmdline to be renamed properly without privileges */
408         if (geteuid() == 0) {
409                 log_info("cmdline = <%s>", cmdline);
410                 assert_se(strneq(p, cmdline, STRLEN("test-process-util")));
411                 assert_se(startswith(p, cmdline));
412         } else
413                 log_info("cmdline = <%s> (not verified)", cmdline);
414 }
415
416 static void test_rename_process_one(const char *p, int ret) {
417         siginfo_t si;
418         pid_t pid;
419
420         pid = fork();
421         assert_se(pid >= 0);
422
423         if (pid == 0) {
424                 /* child */
425                 test_rename_process_now(p, ret);
426                 _exit(EXIT_SUCCESS);
427         }
428
429         assert_se(wait_for_terminate(pid, &si) >= 0);
430         assert_se(si.si_code == CLD_EXITED);
431         assert_se(si.si_status == EXIT_SUCCESS);
432 }
433
434 static void test_rename_process_multi(void) {
435         pid_t pid;
436
437         pid = fork();
438         assert_se(pid >= 0);
439
440         if (pid > 0) {
441                 siginfo_t si;
442
443                 assert_se(wait_for_terminate(pid, &si) >= 0);
444                 assert_se(si.si_code == CLD_EXITED);
445                 assert_se(si.si_status == EXIT_SUCCESS);
446
447                 return;
448         }
449
450         /* child */
451         test_rename_process_now("one", 1);
452         test_rename_process_now("more", 0); /* longer than "one", hence truncated */
453         (void) setresuid(99, 99, 99); /* change uid when running privileged */
454         test_rename_process_now("time!", 0);
455         test_rename_process_now("0", 1); /* shorter than "one", should fit */
456         test_rename_process_one("", -EINVAL);
457         test_rename_process_one(NULL, -EINVAL);
458         _exit(EXIT_SUCCESS);
459 }
460
461 static void test_rename_process(void) {
462         test_rename_process_one(NULL, -EINVAL);
463         test_rename_process_one("", -EINVAL);
464         test_rename_process_one("foo", 1); /* should always fit */
465         test_rename_process_one("this is a really really long process name, followed by some more words", 0); /* unlikely to fit */
466         test_rename_process_one("1234567", 1); /* should always fit */
467         test_rename_process_multi(); /* multiple invocations and dropped privileges */
468 }
469 #endif // 0
470
471 static void test_getpid_cached(void) {
472         siginfo_t si;
473         pid_t a, b, c, d, e, f, child;
474
475         a = raw_getpid();
476         b = getpid_cached();
477         c = getpid();
478
479         assert_se(a == b && a == c);
480
481         child = fork();
482         assert_se(child >= 0);
483
484         if (child == 0) {
485                 /* In child */
486                 a = raw_getpid();
487                 b = getpid_cached();
488                 c = getpid();
489
490                 assert_se(a == b && a == c);
491                 _exit(EXIT_SUCCESS);
492         }
493
494         d = raw_getpid();
495         e = getpid_cached();
496         f = getpid();
497
498         assert_se(a == d && a == e && a == f);
499
500         assert_se(wait_for_terminate(child, &si) >= 0);
501         assert_se(si.si_status == 0);
502         assert_se(si.si_code == CLD_EXITED);
503 }
504
505 #define MEASURE_ITERATIONS (10000000LLU)
506
507 static void test_getpid_measure(void) {
508         unsigned long long i;
509         usec_t t, q;
510
511         t = now(CLOCK_MONOTONIC);
512         for (i = 0; i < MEASURE_ITERATIONS; i++)
513                 (void) getpid();
514         q = now(CLOCK_MONOTONIC) - t;
515
516         log_info(" glibc getpid(): %llu/s\n", (unsigned long long) (MEASURE_ITERATIONS*USEC_PER_SEC/q));
517
518         t = now(CLOCK_MONOTONIC);
519         for (i = 0; i < MEASURE_ITERATIONS; i++)
520                 (void) getpid_cached();
521         q = now(CLOCK_MONOTONIC) - t;
522
523         log_info("getpid_cached(): %llu/s\n", (unsigned long long) (MEASURE_ITERATIONS*USEC_PER_SEC/q));
524 }
525
526 static void test_safe_fork(void) {
527         siginfo_t status;
528         pid_t pid;
529         int r;
530
531         BLOCK_SIGNALS(SIGCHLD);
532
533         r = safe_fork("(test-child)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG|FORK_NULL_STDIO|FORK_REOPEN_LOG, &pid);
534         assert_se(r >= 0);
535
536         if (r == 0) {
537                 /* child */
538                 usleep(100 * USEC_PER_MSEC);
539
540                 _exit(88);
541         }
542
543         assert_se(wait_for_terminate(pid, &status) >= 0);
544         assert_se(status.si_code == CLD_EXITED);
545         assert_se(status.si_status == 88);
546 }
547
548 static void test_pid_to_ptr(void) {
549
550         assert_se(PTR_TO_PID(NULL) == 0);
551         assert_se(PID_TO_PTR(0) == NULL);
552
553         assert_se(PTR_TO_PID(PID_TO_PTR(1)) == 1);
554         assert_se(PTR_TO_PID(PID_TO_PTR(2)) == 2);
555         assert_se(PTR_TO_PID(PID_TO_PTR(-1)) == -1);
556         assert_se(PTR_TO_PID(PID_TO_PTR(-2)) == -2);
557
558         assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MAX)) == INT16_MAX);
559         assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MIN)) == INT16_MIN);
560
561 #if SIZEOF_PID_T >= 4
562         assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MAX)) == INT32_MAX);
563         assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MIN)) == INT32_MIN);
564 #endif
565 }
566
567 static void test_ioprio_class_from_to_string_one(const char *val, int expected) {
568         assert_se(ioprio_class_from_string(val) == expected);
569         if (expected >= 0) {
570                 _cleanup_free_ char *s = NULL;
571                 unsigned ret;
572
573                 assert_se(ioprio_class_to_string_alloc(expected, &s) == 0);
574                 /* We sometimes get a class number and sometimes a number back */
575                 assert_se(streq(s, val) ||
576                           safe_atou(val, &ret) == 0);
577         }
578 }
579
580 static void test_ioprio_class_from_to_string(void) {
581         test_ioprio_class_from_to_string_one("none", IOPRIO_CLASS_NONE);
582         test_ioprio_class_from_to_string_one("realtime", IOPRIO_CLASS_RT);
583         test_ioprio_class_from_to_string_one("best-effort", IOPRIO_CLASS_BE);
584         test_ioprio_class_from_to_string_one("idle", IOPRIO_CLASS_IDLE);
585         test_ioprio_class_from_to_string_one("0", 0);
586         test_ioprio_class_from_to_string_one("1", 1);
587         test_ioprio_class_from_to_string_one("7", 7);
588         test_ioprio_class_from_to_string_one("8", 8);
589         test_ioprio_class_from_to_string_one("9", -1);
590         test_ioprio_class_from_to_string_one("-1", -1);
591 }
592
593 int main(int argc, char *argv[]) {
594         log_set_max_level(LOG_DEBUG);
595         log_parse_environment();
596         log_open();
597
598         saved_argc = argc;
599         saved_argv = argv;
600
601         if (argc > 1) {
602                 pid_t pid = 0;
603
604                 (void) parse_pid(argv[1], &pid);
605                 test_get_process_comm(pid);
606         } else {
607                 TEST_REQ_RUNNING_SYSTEMD(test_get_process_comm(1));
608                 test_get_process_comm(getpid());
609         }
610
611         test_get_process_comm_escape();
612         test_pid_is_unwaited();
613         test_pid_is_alive();
614 #if 0 /// UNNEEDED by elogind
615         test_personality();
616 #endif // 0
617         test_get_process_cmdline_harder();
618 #if 0 /// UNNEEDED by elogind
619         test_rename_process();
620 #endif // 0
621         test_getpid_cached();
622         test_getpid_measure();
623         test_safe_fork();
624         test_pid_to_ptr();
625         test_ioprio_class_from_to_string();
626
627         return 0;
628 }