···11+/*22+ * Copyright 2015, Michael Ellerman, IBM Corp.33+ *44+ * This program is free software; you can redistribute it and/or55+ * modify it under the terms of the GNU General Public License66+ * as published by the Free Software Foundation; either version77+ * 2 of the License, or (at your option) any later version.88+ *99+ * This test simply tests that certain syscalls are implemented. It doesn't1010+ * actually exercise their logic in any way.1111+ */1212+1313+#define _GNU_SOURCE1414+#include <errno.h>1515+#include <stdio.h>1616+#include <unistd.h>1717+#include <sys/syscall.h>1818+1919+#include "utils.h"2020+2121+2222+#define DO_TEST(_name, _num) \2323+static int test_##_name(void) \2424+{ \2525+ int rc; \2626+ printf("Testing " #_name); \2727+ errno = 0; \2828+ rc = syscall(_num, -1, 0, 0, 0, 0, 0); \2929+ printf("\treturned %d, errno %d\n", rc, errno); \3030+ return errno == ENOSYS; \3131+}3232+3333+#include "ipc.h"3434+#undef DO_TEST3535+3636+static int ipc_unmuxed(void)3737+{3838+ int tests_done = 0;3939+4040+#define DO_TEST(_name, _num) \4141+ FAIL_IF(test_##_name()); \4242+ tests_done++;4343+4444+#include "ipc.h"4545+#undef DO_TEST4646+4747+ /*4848+ * If we ran no tests then it means none of the syscall numbers were4949+ * defined, possibly because we were built against old headers. But it5050+ * means we didn't really test anything, so instead of passing mark it5151+ * as a skip to give the user a clue.5252+ */5353+ SKIP_IF(tests_done == 0);5454+5555+ return 0;5656+}5757+5858+int main(void)5959+{6060+ return test_harness(ipc_unmuxed, "ipc_unmuxed");6161+}