2 * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 static const struct_sysent syscallent[] = {
45 #include "syscallent.h"
48 typedef const char *pstr_t;
49 static const pstr_t ksyslist[] = {
59 for (i = 0; i < ARRAY_SIZE(ksyslist); ++i) {
62 if (i >= ARRAY_SIZE(syscallent) || !syscallent[i].sys_name) {
63 fprintf(stderr, "warning: \"%s\" syscall #%u"
64 " is missing in syscallent.h\n",
68 #ifdef SYS_socket_nsubcalls
69 if (i >= SYS_socket_subcall &&
70 i < SYS_socket_subcall + SYS_socket_nsubcalls) {
71 fprintf(stderr, "error: \"%s\" syscall #%u"
72 " is a socket subcall in syscallent.h\n",
78 #ifdef SYS_ipc_nsubcalls
79 if (i >= SYS_ipc_subcall &&
80 i < SYS_ipc_subcall + SYS_ipc_nsubcalls) {
81 fprintf(stderr, "error: \"%s\" syscall #%u"
82 " is an ipc subcall in syscallent.h\n",
88 if (strcmp(ksyslist[i], syscallent[i].sys_name)) {
89 fprintf(stderr, "error: \"%s\" syscall #%u"
90 " is \"%s\" in syscallent.h\n",
91 ksyslist[i], i, syscallent[i].sys_name);
97 for (i = 0; i < ARRAY_SIZE(syscallent); ++i) {
98 if (!syscallent[i].sys_name
99 #ifdef SYS_socket_nsubcalls
100 || (i >= SYS_socket_subcall &&
101 i < SYS_socket_subcall + SYS_socket_nsubcalls)
103 #ifdef SYS_ipc_nsubcalls
104 || (i >= SYS_ipc_subcall &&
105 i < SYS_ipc_subcall + SYS_ipc_nsubcalls)
107 #ifdef ARM_FIRST_SHUFFLED_SYSCALL
108 || (i >= ARM_FIRST_SHUFFLED_SYSCALL &&
109 i <= ARM_FIRST_SHUFFLED_SYSCALL +
110 ARM_LAST_SPECIAL_SYSCALL + 1)
114 if (i >= ARRAY_SIZE(ksyslist) || !ksyslist[i]) {
115 fprintf(stderr, "note: unknown syscall #%u"
116 " is \"%s\" in syscallent.h\n",
117 i, syscallent[i].sys_name);