1
2
3
4
5
6
7
8
9
10 #include <sys/param.h>
11 #include <sys/systm.h>
12 #include <sys/signal.h>
13 #include <sys/mount.h>
14 #include <sys/poll.h>
15 #include <sys/syscallargs.h>
16 #include <compat/sunos/sunos.h>
17 #include <compat/sunos/sunos_syscallargs.h>
18
19 #define s(type) sizeof(type)
20
21 struct sysent sunos_sysent[] = {
22 { 0, 0,
23 sys_nosys },
24 { 1, s(struct sys_exit_args),
25 sys_exit },
26 { 0, 0,
27 sys_fork },
28 { 3, s(struct sys_read_args),
29 sys_read },
30 { 3, s(struct sys_write_args),
31 sys_write },
32 { 3, s(struct sunos_sys_open_args),
33 sunos_sys_open },
34 { 1, s(struct sys_close_args),
35 sys_close },
36 { 4, s(struct sunos_sys_wait4_args),
37 sunos_sys_wait4 },
38 { 2, s(struct sunos_sys_creat_args),
39 sunos_sys_creat },
40 { 2, s(struct sys_link_args),
41 sys_link },
42 { 1, s(struct sys_unlink_args),
43 sys_unlink },
44 { 2, s(struct sunos_sys_execv_args),
45 sunos_sys_execv },
46 { 1, s(struct sys_chdir_args),
47 sys_chdir },
48 { 0, 0,
49 sys_nosys },
50 { 3, s(struct sunos_sys_mknod_args),
51 sunos_sys_mknod },
52 { 2, s(struct sys_chmod_args),
53 sys_chmod },
54 { 3, s(struct sys_lchown_args),
55 sys_lchown },
56 { 1, s(struct sys_obreak_args),
57 sys_obreak },
58 { 0, 0,
59 sys_nosys },
60 { 3, s(struct compat_43_sys_lseek_args),
61 compat_43_sys_lseek },
62 { 0, 0,
63 sys_getpid },
64 { 0, 0,
65 sys_nosys },
66 { 0, 0,
67 sys_nosys },
68 { 1, s(struct sys_setuid_args),
69 sys_setuid },
70 { 0, 0,
71 sys_getuid },
72 { 1, s(struct sunos_sys_ostime_args),
73 sunos_sys_ostime },
74 #ifdef PTRACE
75 { 5, s(struct sunos_sys_ptrace_args),
76 sunos_sys_ptrace },
77 #else
78 { 0, 0,
79 sys_nosys },
80 #endif
81 { 0, 0,
82 sys_nosys },
83 { 0, 0,
84 sys_nosys },
85 { 0, 0,
86 sys_nosys },
87 { 0, 0,
88 sys_nosys },
89 { 0, 0,
90 sys_nosys },
91 { 0, 0,
92 sys_nosys },
93 { 2, s(struct sunos_sys_access_args),
94 sunos_sys_access },
95 { 0, 0,
96 sys_nosys },
97 { 0, 0,
98 sys_nosys },
99 { 0, 0,
100 sys_sync },
101 { 2, s(struct sys_kill_args),
102 sys_kill },
103 { 2, s(struct sunos_sys_stat_args),
104 sunos_sys_stat },
105 { 0, 0,
106 sys_nosys },
107 { 2, s(struct sunos_sys_lstat_args),
108 sunos_sys_lstat },
109 { 1, s(struct sys_dup_args),
110 sys_dup },
111 { 0, 0,
112 sys_opipe },
113 { 1, s(struct sunos_sys_otimes_args),
114 sunos_sys_otimes },
115 { 4, s(struct sys_profil_args),
116 sys_profil },
117 { 0, 0,
118 sys_nosys },
119 { 1, s(struct sys_setgid_args),
120 sys_setgid },
121 { 0, 0,
122 sys_getgid },
123 { 0, 0,
124 sys_nosys },
125 { 0, 0,
126 sys_nosys },
127 { 0, 0,
128 sys_nosys },
129 #ifdef ACCOUNTING
130 { 1, s(struct sys_acct_args),
131 sys_acct },
132 #else
133 { 0, 0,
134 sys_nosys },
135 #endif
136 { 0, 0,
137 sys_nosys },
138 { 4, s(struct sunos_sys_mctl_args),
139 sunos_sys_mctl },
140 { 3, s(struct sunos_sys_ioctl_args),
141 sunos_sys_ioctl },
142 { 2, s(struct sunos_sys_reboot_args),
143 sunos_sys_reboot },
144 { 0, 0,
145 sys_nosys },
146 { 2, s(struct sys_symlink_args),
147 sys_symlink },
148 { 3, s(struct sys_readlink_args),
149 sys_readlink },
150 { 3, s(struct sunos_sys_execve_args),
151 sunos_sys_execve },
152 { 1, s(struct sys_umask_args),
153 sys_umask },
154 { 1, s(struct sys_chroot_args),
155 sys_chroot },
156 { 2, s(struct compat_43_sys_fstat_args),
157 compat_43_sys_fstat },
158 { 0, 0,
159 sys_nosys },
160 { 0, 0,
161 compat_43_sys_getpagesize },
162 { 3, s(struct sys_msync_args),
163 sys_msync },
164 { 0, 0,
165 sys_vfork },
166 { 0, 0,
167 sys_nosys },
168 { 0, 0,
169 sys_nosys },
170 { 1, s(struct sys_sbrk_args),
171 sys_sbrk },
172 { 1, s(struct sys_sstk_args),
173 sys_sstk },
174 { 6, s(struct sunos_sys_mmap_args),
175 sunos_sys_mmap },
176 { 1, s(struct sys_ovadvise_args),
177 sys_ovadvise },
178 { 2, s(struct sys_munmap_args),
179 sys_munmap },
180 { 3, s(struct sys_mprotect_args),
181 sys_mprotect },
182 { 3, s(struct sys_madvise_args),
183 sys_madvise },
184 { 0, 0,
185 sunos_sys_vhangup },
186 { 0, 0,
187 sys_nosys },
188 { 3, s(struct sys_mincore_args),
189 sys_mincore },
190 { 2, s(struct sys_getgroups_args),
191 sys_getgroups },
192 { 2, s(struct sys_setgroups_args),
193 sys_setgroups },
194 { 0, 0,
195 sys_getpgrp },
196 { 2, s(struct sunos_sys_setpgrp_args),
197 sunos_sys_setpgrp },
198 { 3, s(struct sys_setitimer_args),
199 sys_setitimer },
200 { 0, 0,
201 sys_nosys },
202 { 1, s(struct compat_25_sys_swapon_args),
203 compat_25_sys_swapon },
204 { 2, s(struct sys_getitimer_args),
205 sys_getitimer },
206 { 2, s(struct compat_43_sys_gethostname_args),
207 compat_43_sys_gethostname },
208 { 2, s(struct compat_43_sys_sethostname_args),
209 compat_43_sys_sethostname },
210 { 0, 0,
211 compat_43_sys_getdtablesize },
212 { 2, s(struct sys_dup2_args),
213 sys_dup2 },
214 { 0, 0,
215 sys_nosys },
216 { 3, s(struct sunos_sys_fcntl_args),
217 sunos_sys_fcntl },
218 { 5, s(struct sys_select_args),
219 sys_select },
220 { 0, 0,
221 sys_nosys },
222 { 1, s(struct sys_fsync_args),
223 sys_fsync },
224 { 3, s(struct sys_setpriority_args),
225 sys_setpriority },
226 { 3, s(struct sys_socket_args),
227 sys_socket },
228 { 3, s(struct sys_connect_args),
229 sys_connect },
230 { 3, s(struct compat_43_sys_accept_args),
231 compat_43_sys_accept },
232 { 2, s(struct sys_getpriority_args),
233 sys_getpriority },
234 { 4, s(struct compat_43_sys_send_args),
235 compat_43_sys_send },
236 { 4, s(struct compat_43_sys_recv_args),
237 compat_43_sys_recv },
238 { 0, 0,
239 sys_nosys },
240 { 3, s(struct sys_bind_args),
241 sys_bind },
242 { 5, s(struct sunos_sys_setsockopt_args),
243 sunos_sys_setsockopt },
244 { 2, s(struct sys_listen_args),
245 sys_listen },
246 { 0, 0,
247 sys_nosys },
248 { 3, s(struct sunos_sys_sigvec_args),
249 sunos_sys_sigvec },
250 { 1, s(struct compat_43_sys_sigblock_args),
251 compat_43_sys_sigblock },
252 { 1, s(struct compat_43_sys_sigsetmask_args),
253 compat_43_sys_sigsetmask },
254 { 1, s(struct sys_sigsuspend_args),
255 sys_sigsuspend },
256 { 2, s(struct compat_43_sys_sigstack_args),
257 compat_43_sys_sigstack },
258 { 3, s(struct compat_43_sys_recvmsg_args),
259 compat_43_sys_recvmsg },
260 { 3, s(struct compat_43_sys_sendmsg_args),
261 compat_43_sys_sendmsg },
262 { 0, 0,
263 sys_nosys },
264 { 2, s(struct sys_gettimeofday_args),
265 sys_gettimeofday },
266 { 2, s(struct sys_getrusage_args),
267 sys_getrusage },
268 { 5, s(struct sys_getsockopt_args),
269 sys_getsockopt },
270 { 0, 0,
271 sys_nosys },
272 { 3, s(struct sys_readv_args),
273 sys_readv },
274 { 3, s(struct sys_writev_args),
275 sys_writev },
276 { 2, s(struct sys_settimeofday_args),
277 sys_settimeofday },
278 { 3, s(struct sys_fchown_args),
279 sys_fchown },
280 { 2, s(struct sys_fchmod_args),
281 sys_fchmod },
282 { 6, s(struct compat_43_sys_recvfrom_args),
283 compat_43_sys_recvfrom },
284 { 2, s(struct sys_setreuid_args),
285 sys_setreuid },
286 { 2, s(struct sys_setregid_args),
287 sys_setregid },
288 { 2, s(struct sys_rename_args),
289 sys_rename },
290 { 2, s(struct compat_43_sys_truncate_args),
291 compat_43_sys_truncate },
292 { 2, s(struct compat_43_sys_ftruncate_args),
293 compat_43_sys_ftruncate },
294 { 2, s(struct sys_flock_args),
295 sys_flock },
296 { 0, 0,
297 sys_nosys },
298 { 6, s(struct sys_sendto_args),
299 sys_sendto },
300 { 2, s(struct sys_shutdown_args),
301 sys_shutdown },
302 { 4, s(struct sys_socketpair_args),
303 sys_socketpair },
304 { 2, s(struct sys_mkdir_args),
305 sys_mkdir },
306 { 1, s(struct sys_rmdir_args),
307 sys_rmdir },
308 { 2, s(struct sys_utimes_args),
309 sys_utimes },
310 { 1, s(struct sunos_sys_sigreturn_args),
311 sunos_sys_sigreturn },
312 { 2, s(struct sys_adjtime_args),
313 sys_adjtime },
314 { 3, s(struct compat_43_sys_getpeername_args),
315 compat_43_sys_getpeername },
316 { 0, 0,
317 compat_43_sys_gethostid },
318 { 0, 0,
319 sys_nosys },
320 { 2, s(struct sunos_sys_getrlimit_args),
321 sunos_sys_getrlimit },
322 { 2, s(struct sunos_sys_setrlimit_args),
323 sunos_sys_setrlimit },
324 { 2, s(struct compat_43_sys_killpg_args),
325 compat_43_sys_killpg },
326 { 0, 0,
327 sys_nosys },
328 { 0, 0,
329 sys_nosys },
330 { 0, 0,
331 sys_nosys },
332 { 3, s(struct compat_43_sys_getsockname_args),
333 compat_43_sys_getsockname },
334 { 0, 0,
335 sys_nosys },
336 { 0, 0,
337 sys_nosys },
338 { 3, s(struct sys_poll_args),
339 sys_poll },
340 { 0, 0,
341 sys_nosys },
342 #ifdef NFSSERVER
343 { 1, s(struct sunos_sys_nfssvc_args),
344 sunos_sys_nfssvc },
345 #else
346 { 0, 0,
347 sys_nosys },
348 #endif
349 { 4, s(struct sys_getdirentries_args),
350 sys_getdirentries },
351 { 2, s(struct sunos_sys_statfs_args),
352 sunos_sys_statfs },
353 { 2, s(struct sunos_sys_fstatfs_args),
354 sunos_sys_fstatfs },
355 { 1, s(struct sunos_sys_unmount_args),
356 sunos_sys_unmount },
357 #ifdef NFSCLIENT
358 { 0, 0,
359 async_daemon },
360 { 2, s(struct sys_getfh_args),
361 sys_getfh },
362 #else
363 { 0, 0,
364 sys_nosys },
365 { 0, 0,
366 sys_nosys },
367 #endif
368 { 2, s(struct compat_09_sys_getdomainname_args),
369 compat_09_sys_getdomainname },
370 { 2, s(struct compat_09_sys_setdomainname_args),
371 compat_09_sys_setdomainname },
372 { 0, 0,
373 sys_nosys },
374 { 4, s(struct sunos_sys_quotactl_args),
375 sunos_sys_quotactl },
376 { 2, s(struct sunos_sys_exportfs_args),
377 sunos_sys_exportfs },
378 { 4, s(struct sunos_sys_mount_args),
379 sunos_sys_mount },
380 { 2, s(struct sunos_sys_ustat_args),
381 sunos_sys_ustat },
382 #ifdef SYSVSEM
383 { 5, s(struct compat_10_sys_semsys_args),
384 compat_10_sys_semsys },
385 #else
386 { 0, 0,
387 sys_nosys },
388 #endif
389 #ifdef SYSVMSG
390 { 6, s(struct compat_10_sys_msgsys_args),
391 compat_10_sys_msgsys },
392 #else
393 { 0, 0,
394 sys_nosys },
395 #endif
396 #ifdef SYSVSHM
397 { 4, s(struct compat_10_sys_shmsys_args),
398 compat_10_sys_shmsys },
399 #else
400 { 0, 0,
401 sys_nosys },
402 #endif
403 { 1, s(struct sunos_sys_auditsys_args),
404 sunos_sys_auditsys },
405 { 0, 0,
406 sys_nosys },
407 { 3, s(struct sunos_sys_getdents_args),
408 sunos_sys_getdents },
409 { 0, 0,
410 sys_setsid },
411 { 1, s(struct sys_fchdir_args),
412 sys_fchdir },
413 { 1, s(struct sunos_sys_fchroot_args),
414 sunos_sys_fchroot },
415 { 0, 0,
416 sys_nosys },
417 { 0, 0,
418 sys_nosys },
419 { 0, 0,
420 sys_nosys },
421 { 0, 0,
422 sys_nosys },
423 { 0, 0,
424 sys_nosys },
425 { 1, s(struct sunos_sys_sigpending_args),
426 sunos_sys_sigpending },
427 { 0, 0,
428 sys_nosys },
429 { 2, s(struct sys_setpgid_args),
430 sys_setpgid },
431 { 2, s(struct sys_pathconf_args),
432 sys_pathconf },
433 { 2, s(struct sys_fpathconf_args),
434 sys_fpathconf },
435 { 1, s(struct sunos_sys_sysconf_args),
436 sunos_sys_sysconf },
437 { 1, s(struct sunos_sys_uname_args),
438 sunos_sys_uname },
439 };
440