Lines Matching refs:sa
37 posix_spawnattr_t sa; in TEST() local
38 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
39 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
43 posix_spawnattr_t sa; in TEST() local
44 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
45 ASSERT_EQ(EINVAL, posix_spawnattr_setflags(&sa, ~0)); in TEST()
46 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
50 posix_spawnattr_t sa; in TEST() local
51 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
53 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, POSIX_SPAWN_RESETIDS)); in TEST()
55 ASSERT_EQ(0, posix_spawnattr_getflags(&sa, &flags)); in TEST()
61 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, all_flags)); in TEST()
62 ASSERT_EQ(0, posix_spawnattr_getflags(&sa, &flags)); in TEST()
65 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
69 posix_spawnattr_t sa; in TEST() local
70 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
72 ASSERT_EQ(0, posix_spawnattr_setpgroup(&sa, 123)); in TEST()
74 ASSERT_EQ(0, posix_spawnattr_getpgroup(&sa, &g)); in TEST()
77 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
81 posix_spawnattr_t sa; in TEST() local
82 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
85 ASSERT_EQ(0, posix_spawnattr_getsigmask(&sa, &sigs)); in TEST()
91 ASSERT_EQ(0, posix_spawnattr_setsigmask(&sa, &just_SIGALRM)); in TEST()
93 ASSERT_EQ(0, posix_spawnattr_getsigmask(&sa, &sigs)); in TEST()
96 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
100 posix_spawnattr_t sa; in TEST() local
101 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
104 ASSERT_EQ(0, posix_spawnattr_getsigmask64(&sa, &sigs)); in TEST()
110 ASSERT_EQ(0, posix_spawnattr_setsigmask64(&sa, &just_SIGRTMIN)); in TEST()
112 ASSERT_EQ(0, posix_spawnattr_getsigmask64(&sa, &sigs)); in TEST()
115 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
119 posix_spawnattr_t sa; in TEST() local
120 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
123 ASSERT_EQ(0, posix_spawnattr_getsigdefault(&sa, &sigs)); in TEST()
129 ASSERT_EQ(0, posix_spawnattr_setsigdefault(&sa, &just_SIGALRM)); in TEST()
131 ASSERT_EQ(0, posix_spawnattr_getsigdefault(&sa, &sigs)); in TEST()
134 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
138 posix_spawnattr_t sa; in TEST() local
139 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
142 ASSERT_EQ(0, posix_spawnattr_getsigdefault64(&sa, &sigs)); in TEST()
148 ASSERT_EQ(0, posix_spawnattr_setsigdefault64(&sa, &just_SIGRTMIN)); in TEST()
150 ASSERT_EQ(0, posix_spawnattr_getsigdefault64(&sa, &sigs)); in TEST()
153 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
157 posix_spawnattr_t sa; in TEST() local
158 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
161 ASSERT_EQ(0, posix_spawnattr_getschedparam(&sa, &sp)); in TEST()
165 ASSERT_EQ(0, posix_spawnattr_setschedparam(&sa, &sp123)); in TEST()
167 ASSERT_EQ(0, posix_spawnattr_getschedparam(&sa, &sp)); in TEST()
170 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
174 posix_spawnattr_t sa; in TEST() local
175 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
178 ASSERT_EQ(0, posix_spawnattr_getschedpolicy(&sa, &p)); in TEST()
181 ASSERT_EQ(0, posix_spawnattr_setschedpolicy(&sa, SCHED_FIFO)); in TEST()
183 ASSERT_EQ(0, posix_spawnattr_getschedpolicy(&sa, &p)); in TEST()
186 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
266 static void CatFileToString(posix_spawnattr_t* sa, const char* path, std::string* content) { in CatFileToString() argument
279 ASSERT_EQ(0, posix_spawnp(&pid, eth.GetArg0(), &fa, sa, eth.GetArgs(), nullptr)); in CatFileToString()
295 static void GetChildStat(posix_spawnattr_t* sa, ProcStat* ps) { in GetChildStat() argument
297 CatFileToString(sa, "/proc/self/stat", &content); in GetChildStat()
310 static void GetChildStatus(posix_spawnattr_t* sa, ProcStatus* ps) { in GetChildStatus() argument
312 CatFileToString(sa, "/proc/self/status", &content); in GetChildStatus()
327 posix_spawnattr_t sa; in TEST() local
328 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
329 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, 0)); in TEST()
332 GetChildStat(&sa, &ps); in TEST()
334 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
340 posix_spawnattr_t sa; in TEST() local
341 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
342 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, POSIX_SPAWN_SETSID)); in TEST()
345 GetChildStat(&sa, &ps); in TEST()
347 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
353 posix_spawnattr_t sa; in TEST() local
354 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
355 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, 0)); in TEST()
358 GetChildStat(&sa, &ps); in TEST()
360 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
366 posix_spawnattr_t sa; in TEST() local
367 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
368 ASSERT_EQ(0, posix_spawnattr_setpgroup(&sa, 0)); in TEST()
369 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, POSIX_SPAWN_SETPGROUP)); in TEST()
372 GetChildStat(&sa, &ps); in TEST()
376 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
386 posix_spawnattr_t sa; in TEST() local
387 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
393 ASSERT_EQ(0, posix_spawnattr_setsigmask(&sa, &just_SIGALRM)); in TEST()
394 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, POSIX_SPAWN_SETSIGMASK)); in TEST()
398 GetChildStatus(&sa, &ps); in TEST()
408 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
416 posix_spawnattr_t sa; in TEST() local
417 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
424 ASSERT_EQ(0, posix_spawnattr_setsigdefault(&sa, &just_SIGALRM)); in TEST()
425 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, POSIX_SPAWN_SETSIGDEF)); in TEST()
429 GetChildStatus(&sa, &ps); in TEST()
440 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()