15 #ifdef HAVE_SYS_SYSCALL_H
16 #include <sys/syscall.h>
22 #include "swrap_fake_uid_wrapper.h"
24 static void test_swrap_syscall_uwrap(void **state)
28 (void)state; /* unused */
30 rc = syscall(__FAKE_UID_WRAPPER_SYSCALL_NO);
31 assert_int_equal(rc, __FAKE_UID_WRAPPER_SYSCALL_RC);
34 * FreeBSD raises also a signal SIGSYS, so ignore it or the cmocka
35 * exception handler will catch it.
37 signal(SIGSYS, SIG_IGN);
38 rc = syscall(__FAKE_UID_WRAPPER_SYSCALL_NO+1);
39 signal(SIGSYS, SIG_DFL);
40 assert_int_equal(rc, -1);
41 assert_int_equal(errno, ENOSYS);
47 const struct CMUnitTest swrap_tests[] = {
48 cmocka_unit_test(test_swrap_syscall_uwrap),
51 rc = cmocka_run_group_tests(swrap_tests, NULL, NULL);