1 /* Machine independent support for SVR4 /proc (process file system) for GDB.
2 Copyright 1999 Free Software Foundation, Inc.
3 Written by Michael Snyder at Cygnus Solutions.
4 Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software Foundation,
20 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 * Pretty-print "events of interest".
25 * This module includes pretty-print routines for:
26 * faults (hardware exceptions):
27 * signals (software interrupts):
30 * FIXME: At present, the syscall translation table must be initialized,
31 * which is not true of the other translation tables.
36 #if defined (NEW_PROC_API)
37 #define _STRUCTURED_PROC 1
41 #include <sys/types.h>
42 #include <sys/procfs.h>
43 #include <sys/syscall.h>
44 #include <sys/fault.h>
46 /* Much of the information used in the /proc interface, particularly for
47 printing status information, is kept as tables of structures of the
48 following form. These tables can be used to map numeric values to
49 their symbolic names and to a string that describes their specific use. */
52 int value; /* The numeric value */
53 char *name; /* The equivalent symbolic value */
54 char *desc; /* Short description of value */
58 * pretty print syscalls
61 /* Ugh -- Unixware and Solaris spell these differently! */
64 #define SYS_lwp_create SYS_lwpcreate
68 #define SYS_lwp_exit SYS_lwpexit
72 #define SYS_lwp_wait SYS_lwpwait
76 #define SYS_lwp_self SYS_lwpself
80 #define SYS_lwp_info SYS_lwpinfo
84 #define SYS_lwp_private SYS_lwpprivate
88 #define SYS_lwp_kill SYS_lwpkill
92 #define SYS_lwp_suspend SYS_lwpsuspend
95 #ifdef SYS_lwpcontinue
96 #define SYS_lwp_continue SYS_lwpcontinue
100 /* Syscall translation table. */
102 #define MAX_SYSCALLS 262 /* pretty arbitrary */
103 static char * syscall_table[MAX_SYSCALLS];
106 init_syscall_table (void)
108 #if defined (SYS_BSD_getime)
109 syscall_table[SYS_BSD_getime] = "BSD_getime";
111 #if defined (SYS_BSDgetpgrp)
112 syscall_table[SYS_BSDgetpgrp] = "BSDgetpgrp";
114 #if defined (SYS_BSDsetpgrp)
115 syscall_table[SYS_BSDsetpgrp] = "BSDsetpgrp";
117 #if defined (SYS_acancel)
118 syscall_table[SYS_acancel] = "acancel";
120 #if defined (SYS_accept)
121 syscall_table[SYS_accept] = "accept";
123 #if defined (SYS_access)
124 syscall_table[SYS_access] = "access";
126 #if defined (SYS_acct)
127 syscall_table[SYS_acct] = "acct";
129 #if defined (SYS_acl)
130 syscall_table[SYS_acl] = "acl";
132 #if defined (SYS_aclipc)
133 syscall_table[SYS_aclipc] = "aclipc";
135 #if defined (SYS_adjtime)
136 syscall_table[SYS_adjtime] = "adjtime";
138 #if defined (SYS_afs_syscall)
139 syscall_table[SYS_afs_syscall] = "afs_syscall";
141 #if defined (SYS_alarm)
142 syscall_table[SYS_alarm] = "alarm";
144 #if defined (SYS_alt_plock)
145 syscall_table[SYS_alt_plock] = "alt_plock";
147 #if defined (SYS_alt_sigpending)
148 syscall_table[SYS_alt_sigpending] = "alt_sigpending";
150 #if defined (SYS_async)
151 syscall_table[SYS_async] = "async";
153 #if defined (SYS_async_daemon)
154 syscall_table[SYS_async_daemon] = "async_daemon";
156 #if defined (SYS_audcntl)
157 syscall_table[SYS_audcntl] = "audcntl";
159 #if defined (SYS_audgen)
160 syscall_table[SYS_audgen] = "audgen";
162 #if defined (SYS_auditbuf)
163 syscall_table[SYS_auditbuf] = "auditbuf";
165 #if defined (SYS_auditctl)
166 syscall_table[SYS_auditctl] = "auditctl";
168 #if defined (SYS_auditdmp)
169 syscall_table[SYS_auditdmp] = "auditdmp";
171 #if defined (SYS_auditevt)
172 syscall_table[SYS_auditevt] = "auditevt";
174 #if defined (SYS_auditlog)
175 syscall_table[SYS_auditlog] = "auditlog";
177 #if defined (SYS_auditsys)
178 syscall_table[SYS_auditsys] = "auditsys";
180 #if defined (SYS_bind)
181 syscall_table[SYS_bind] = "bind";
183 #if defined (SYS_block)
184 syscall_table[SYS_block] = "block";
186 #if defined (SYS_brk)
187 syscall_table[SYS_brk] = "brk";
189 #if defined (SYS_cachectl)
190 syscall_table[SYS_cachectl] = "cachectl";
192 #if defined (SYS_cacheflush)
193 syscall_table[SYS_cacheflush] = "cacheflush";
195 #if defined (SYS_cancelblock)
196 syscall_table[SYS_cancelblock] = "cancelblock";
198 #if defined (SYS_cg_bind)
199 syscall_table[SYS_cg_bind] = "cg_bind";
201 #if defined (SYS_cg_current)
202 syscall_table[SYS_cg_current] = "cg_current";
204 #if defined (SYS_cg_ids)
205 syscall_table[SYS_cg_ids] = "cg_ids";
207 #if defined (SYS_cg_info)
208 syscall_table[SYS_cg_info] = "cg_info";
210 #if defined (SYS_cg_memloc)
211 syscall_table[SYS_cg_memloc] = "cg_memloc";
213 #if defined (SYS_cg_processors)
214 syscall_table[SYS_cg_processors] = "cg_processors";
216 #if defined (SYS_chdir)
217 syscall_table[SYS_chdir] = "chdir";
219 #if defined (SYS_chflags)
220 syscall_table[SYS_chflags] = "chflags";
222 #if defined (SYS_chmod)
223 syscall_table[SYS_chmod] = "chmod";
225 #if defined (SYS_chown)
226 syscall_table[SYS_chown] = "chown";
228 #if defined (SYS_chroot)
229 syscall_table[SYS_chroot] = "chroot";
231 #if defined (SYS_clocal)
232 syscall_table[SYS_clocal] = "clocal";
234 #if defined (SYS_clock_getres)
235 syscall_table[SYS_clock_getres] = "clock_getres";
237 #if defined (SYS_clock_gettime)
238 syscall_table[SYS_clock_gettime] = "clock_gettime";
240 #if defined (SYS_clock_settime)
241 syscall_table[SYS_clock_settime] = "clock_settime";
243 #if defined (SYS_close)
244 syscall_table[SYS_close] = "close";
246 #if defined (SYS_connect)
247 syscall_table[SYS_connect] = "connect";
249 #if defined (SYS_context)
250 syscall_table[SYS_context] = "context";
252 #if defined (SYS_creat)
253 syscall_table[SYS_creat] = "creat";
255 #if defined (SYS_creat64)
256 syscall_table[SYS_creat64] = "creat64";
258 #if defined (SYS_devstat)
259 syscall_table[SYS_devstat] = "devstat";
261 #if defined (SYS_dmi)
262 syscall_table[SYS_dmi] = "dmi";
264 #if defined (SYS_door)
265 syscall_table[SYS_door] = "door";
267 #if defined (SYS_dshmsys)
268 syscall_table[SYS_dshmsys] = "dshmsys";
270 #if defined (SYS_dup)
271 syscall_table[SYS_dup] = "dup";
273 #if defined (SYS_dup2)
274 syscall_table[SYS_dup2] = "dup2";
276 #if defined (SYS_evsys)
277 syscall_table[SYS_evsys] = "evsys";
279 #if defined (SYS_evtrapret)
280 syscall_table[SYS_evtrapret] = "evtrapret";
282 #if defined (SYS_exec)
283 syscall_table[SYS_exec] = "exec";
285 #if defined (SYS_exec_with_loader)
286 syscall_table[SYS_exec_with_loader] = "exec_with_loader";
288 #if defined (SYS_execv)
289 syscall_table[SYS_execv] = "execv";
291 #if defined (SYS_execve)
292 syscall_table[SYS_execve] = "execve";
294 #if defined (SYS_exit)
295 syscall_table[SYS_exit] = "exit";
297 #if defined (SYS_exportfs)
298 syscall_table[SYS_exportfs] = "exportfs";
300 #if defined (SYS_facl)
301 syscall_table[SYS_facl] = "facl";
303 #if defined (SYS_fchdir)
304 syscall_table[SYS_fchdir] = "fchdir";
306 #if defined (SYS_fchflags)
307 syscall_table[SYS_fchflags] = "fchflags";
309 #if defined (SYS_fchmod)
310 syscall_table[SYS_fchmod] = "fchmod";
312 #if defined (SYS_fchown)
313 syscall_table[SYS_fchown] = "fchown";
315 #if defined (SYS_fchroot)
316 syscall_table[SYS_fchroot] = "fchroot";
318 #if defined (SYS_fcntl)
319 syscall_table[SYS_fcntl] = "fcntl";
321 #if defined (SYS_fdatasync)
322 syscall_table[SYS_fdatasync] = "fdatasync";
324 #if defined (SYS_fdevstat)
325 syscall_table[SYS_fdevstat] = "fdevstat";
327 #if defined (SYS_fdsync)
328 syscall_table[SYS_fdsync] = "fdsync";
330 #if defined (SYS_filepriv)
331 syscall_table[SYS_filepriv] = "filepriv";
333 #if defined (SYS_flock)
334 syscall_table[SYS_flock] = "flock";
336 #if defined (SYS_flvlfile)
337 syscall_table[SYS_flvlfile] = "flvlfile";
339 #if defined (SYS_fork)
340 syscall_table[SYS_fork] = "fork";
342 #if defined (SYS_fork1)
343 syscall_table[SYS_fork1] = "fork1";
345 #if defined (SYS_forkall)
346 syscall_table[SYS_forkall] = "forkall";
348 #if defined (SYS_fpathconf)
349 syscall_table[SYS_fpathconf] = "fpathconf";
351 #if defined (SYS_fstat)
352 syscall_table[SYS_fstat] = "fstat";
354 #if defined (SYS_fstat64)
355 syscall_table[SYS_fstat64] = "fstat64";
357 #if defined (SYS_fstatfs)
358 syscall_table[SYS_fstatfs] = "fstatfs";
360 #if defined (SYS_fstatvfs)
361 syscall_table[SYS_fstatvfs] = "fstatvfs";
363 #if defined (SYS_fstatvfs64)
364 syscall_table[SYS_fstatvfs64] = "fstatvfs64";
366 #if defined (SYS_fsync)
367 syscall_table[SYS_fsync] = "fsync";
369 #if defined (SYS_ftruncate)
370 syscall_table[SYS_ftruncate] = "ftruncate";
372 #if defined (SYS_ftruncate64)
373 syscall_table[SYS_ftruncate64] = "ftruncate64";
375 #if defined (SYS_fuser)
376 syscall_table[SYS_fuser] = "fuser";
378 #if defined (SYS_fxstat)
379 syscall_table[SYS_fxstat] = "fxstat";
381 #if defined (SYS_get_sysinfo)
382 syscall_table[SYS_get_sysinfo] = "get_sysinfo";
384 #if defined (SYS_getaddressconf)
385 syscall_table[SYS_getaddressconf] = "getaddressconf";
387 #if defined (SYS_getcontext)
388 syscall_table[SYS_getcontext] = "getcontext";
390 #if defined (SYS_getdents)
391 syscall_table[SYS_getdents] = "getdents";
393 #if defined (SYS_getdents64)
394 syscall_table[SYS_getdents64] = "getdents64";
396 #if defined (SYS_getdirentries)
397 syscall_table[SYS_getdirentries] = "getdirentries";
399 #if defined (SYS_getdomainname)
400 syscall_table[SYS_getdomainname] = "getdomainname";
402 #if defined (SYS_getdtablesize)
403 syscall_table[SYS_getdtablesize] = "getdtablesize";
405 #if defined (SYS_getfh)
406 syscall_table[SYS_getfh] = "getfh";
408 #if defined (SYS_getfsstat)
409 syscall_table[SYS_getfsstat] = "getfsstat";
411 #if defined (SYS_getgid)
412 syscall_table[SYS_getgid] = "getgid";
414 #if defined (SYS_getgroups)
415 syscall_table[SYS_getgroups] = "getgroups";
417 #if defined (SYS_gethostid)
418 syscall_table[SYS_gethostid] = "gethostid";
420 #if defined (SYS_gethostname)
421 syscall_table[SYS_gethostname] = "gethostname";
423 #if defined (SYS_getitimer)
424 syscall_table[SYS_getitimer] = "getitimer";
426 #if defined (SYS_getksym)
427 syscall_table[SYS_getksym] = "getksym";
429 #if defined (SYS_getlogin)
430 syscall_table[SYS_getlogin] = "getlogin";
432 #if defined (SYS_getmnt)
433 syscall_table[SYS_getmnt] = "getmnt";
435 #if defined (SYS_getmsg)
436 syscall_table[SYS_getmsg] = "getmsg";
438 #if defined (SYS_getpagesize)
439 syscall_table[SYS_getpagesize] = "getpagesize";
441 #if defined (SYS_getpeername)
442 syscall_table[SYS_getpeername] = "getpeername";
444 #if defined (SYS_getpgid)
445 syscall_table[SYS_getpgid] = "getpgid";
447 #if defined (SYS_getpgrp)
448 syscall_table[SYS_getpgrp] = "getpgrp";
450 #if defined (SYS_getpid)
451 syscall_table[SYS_getpid] = "getpid";
453 #if defined (SYS_getpmsg)
454 syscall_table[SYS_getpmsg] = "getpmsg";
456 #if defined (SYS_getpriority)
457 syscall_table[SYS_getpriority] = "getpriority";
459 #if defined (SYS_getrlimit)
460 syscall_table[SYS_getrlimit] = "getrlimit";
462 #if defined (SYS_getrlimit64)
463 syscall_table[SYS_getrlimit64] = "getrlimit64";
465 #if defined (SYS_getrusage)
466 syscall_table[SYS_getrusage] = "getrusage";
468 #if defined (SYS_getsid)
469 syscall_table[SYS_getsid] = "getsid";
471 #if defined (SYS_getsockname)
472 syscall_table[SYS_getsockname] = "getsockname";
474 #if defined (SYS_getsockopt)
475 syscall_table[SYS_getsockopt] = "getsockopt";
477 #if defined (SYS_gettimeofday)
478 syscall_table[SYS_gettimeofday] = "gettimeofday";
480 #if defined (SYS_getuid)
481 syscall_table[SYS_getuid] = "getuid";
483 #if defined (SYS_gtty)
484 syscall_table[SYS_gtty] = "gtty";
486 #if defined (SYS_hrtsys)
487 syscall_table[SYS_hrtsys] = "hrtsys";
489 #if defined (SYS_inst_sync)
490 syscall_table[SYS_inst_sync] = "inst_sync";
492 #if defined (SYS_install_utrap)
493 syscall_table[SYS_install_utrap] = "install_utrap";
495 #if defined (SYS_invlpg)
496 syscall_table[SYS_invlpg] = "invlpg";
498 #if defined (SYS_ioctl)
499 syscall_table[SYS_ioctl] = "ioctl";
501 #if defined (SYS_kaio)
502 syscall_table[SYS_kaio] = "kaio";
504 #if defined (SYS_keyctl)
505 syscall_table[SYS_keyctl] = "keyctl";
507 #if defined (SYS_kill)
508 syscall_table[SYS_kill] = "kill";
510 #if defined (SYS_killpg)
511 syscall_table[SYS_killpg] = "killpg";
513 #if defined (SYS_kloadcall)
514 syscall_table[SYS_kloadcall] = "kloadcall";
516 #if defined (SYS_kmodcall)
517 syscall_table[SYS_kmodcall] = "kmodcall";
519 #if defined (SYS_ksigaction)
520 syscall_table[SYS_ksigaction] = "ksigaction";
522 #if defined (SYS_ksigprocmask)
523 syscall_table[SYS_ksigprocmask] = "ksigprocmask";
525 #if defined (SYS_ksigqueue)
526 syscall_table[SYS_ksigqueue] = "ksigqueue";
528 #if defined (SYS_lchown)
529 syscall_table[SYS_lchown] = "lchown";
531 #if defined (SYS_link)
532 syscall_table[SYS_link] = "link";
534 #if defined (SYS_listen)
535 syscall_table[SYS_listen] = "listen";
537 #if defined (SYS_llseek)
538 syscall_table[SYS_llseek] = "llseek";
540 #if defined (SYS_lseek)
541 syscall_table[SYS_lseek] = "lseek";
543 #if defined (SYS_lseek64)
544 syscall_table[SYS_lseek64] = "lseek64";
546 #if defined (SYS_lstat)
547 syscall_table[SYS_lstat] = "lstat";
549 #if defined (SYS_lstat64)
550 syscall_table[SYS_lstat64] = "lstat64";
552 #if defined (SYS_lvldom)
553 syscall_table[SYS_lvldom] = "lvldom";
555 #if defined (SYS_lvlequal)
556 syscall_table[SYS_lvlequal] = "lvlequal";
558 #if defined (SYS_lvlfile)
559 syscall_table[SYS_lvlfile] = "lvlfile";
561 #if defined (SYS_lvlipc)
562 syscall_table[SYS_lvlipc] = "lvlipc";
564 #if defined (SYS_lvlproc)
565 syscall_table[SYS_lvlproc] = "lvlproc";
567 #if defined (SYS_lvlvfs)
568 syscall_table[SYS_lvlvfs] = "lvlvfs";
570 #if defined (SYS_lwp_alarm)
571 syscall_table[SYS_lwp_alarm] = "lwp_alarm";
573 #if defined (SYS_lwp_cond_broadcast)
574 syscall_table[SYS_lwp_cond_broadcast] = "lwp_cond_broadcast";
576 #if defined (SYS_lwp_cond_signal)
577 syscall_table[SYS_lwp_cond_signal] = "lwp_cond_signal";
579 #if defined (SYS_lwp_cond_wait)
580 syscall_table[SYS_lwp_cond_wait] = "lwp_cond_wait";
582 #if defined (SYS_lwp_continue)
583 syscall_table[SYS_lwp_continue] = "lwp_continue";
585 #if defined (SYS_lwp_create)
586 syscall_table[SYS_lwp_create] = "lwp_create";
588 #if defined (SYS_lwp_exit)
589 syscall_table[SYS_lwp_exit] = "lwp_exit";
591 #if defined (SYS_lwp_getprivate)
592 syscall_table[SYS_lwp_getprivate] = "lwp_getprivate";
594 #if defined (SYS_lwp_info)
595 syscall_table[SYS_lwp_info] = "lwp_info";
597 #if defined (SYS_lwp_kill)
598 syscall_table[SYS_lwp_kill] = "lwp_kill";
600 #if defined (SYS_lwp_mutex_init)
601 syscall_table[SYS_lwp_mutex_init] = "lwp_mutex_init";
603 #if defined (SYS_lwp_mutex_lock)
604 syscall_table[SYS_lwp_mutex_lock] = "lwp_mutex_lock";
606 #if defined (SYS_lwp_mutex_trylock)
607 syscall_table[SYS_lwp_mutex_trylock] = "lwp_mutex_trylock";
609 #if defined (SYS_lwp_mutex_unlock)
610 syscall_table[SYS_lwp_mutex_unlock] = "lwp_mutex_unlock";
612 #if defined (SYS_lwp_private)
613 syscall_table[SYS_lwp_private] = "lwp_private";
615 #if defined (SYS_lwp_self)
616 syscall_table[SYS_lwp_self] = "lwp_self";
618 #if defined (SYS_lwp_sema_post)
619 syscall_table[SYS_lwp_sema_post] = "lwp_sema_post";
621 #if defined (SYS_lwp_sema_trywait)
622 syscall_table[SYS_lwp_sema_trywait] = "lwp_sema_trywait";
624 #if defined (SYS_lwp_sema_wait)
625 syscall_table[SYS_lwp_sema_wait] = "lwp_sema_wait";
627 #if defined (SYS_lwp_setprivate)
628 syscall_table[SYS_lwp_setprivate] = "lwp_setprivate";
630 #if defined (SYS_lwp_sigredirect)
631 syscall_table[SYS_lwp_sigredirect] = "lwp_sigredirect";
633 #if defined (SYS_lwp_suspend)
634 syscall_table[SYS_lwp_suspend] = "lwp_suspend";
636 #if defined (SYS_lwp_wait)
637 syscall_table[SYS_lwp_wait] = "lwp_wait";
639 #if defined (SYS_lxstat)
640 syscall_table[SYS_lxstat] = "lxstat";
642 #if defined (SYS_madvise)
643 syscall_table[SYS_madvise] = "madvise";
645 #if defined (SYS_memcntl)
646 syscall_table[SYS_memcntl] = "memcntl";
648 #if defined (SYS_mincore)
649 syscall_table[SYS_mincore] = "mincore";
651 #if defined (SYS_mincore)
652 syscall_table[SYS_mincore] = "mincore";
654 #if defined (SYS_mkdir)
655 syscall_table[SYS_mkdir] = "mkdir";
657 #if defined (SYS_mkmld)
658 syscall_table[SYS_mkmld] = "mkmld";
660 #if defined (SYS_mknod)
661 syscall_table[SYS_mknod] = "mknod";
663 #if defined (SYS_mldmode)
664 syscall_table[SYS_mldmode] = "mldmode";
666 #if defined (SYS_mmap)
667 syscall_table[SYS_mmap] = "mmap";
669 #if defined (SYS_mmap64)
670 syscall_table[SYS_mmap64] = "mmap64";
672 #if defined (SYS_modadm)
673 syscall_table[SYS_modadm] = "modadm";
675 #if defined (SYS_modctl)
676 syscall_table[SYS_modctl] = "modctl";
678 #if defined (SYS_modload)
679 syscall_table[SYS_modload] = "modload";
681 #if defined (SYS_modpath)
682 syscall_table[SYS_modpath] = "modpath";
684 #if defined (SYS_modstat)
685 syscall_table[SYS_modstat] = "modstat";
687 #if defined (SYS_moduload)
688 syscall_table[SYS_moduload] = "moduload";
690 #if defined (SYS_mount)
691 syscall_table[SYS_mount] = "mount";
693 #if defined (SYS_mprotect)
694 syscall_table[SYS_mprotect] = "mprotect";
696 #if defined (SYS_mremap)
697 syscall_table[SYS_mremap] = "mremap";
699 #if defined (SYS_msfs_syscall)
700 syscall_table[SYS_msfs_syscall] = "msfs_syscall";
702 #if defined (SYS_msgctl)
703 syscall_table[SYS_msgctl] = "msgctl";
705 #if defined (SYS_msgget)
706 syscall_table[SYS_msgget] = "msgget";
708 #if defined (SYS_msgrcv)
709 syscall_table[SYS_msgrcv] = "msgrcv";
711 #if defined (SYS_msgsnd)
712 syscall_table[SYS_msgsnd] = "msgsnd";
714 #if defined (SYS_msgsys)
715 syscall_table[SYS_msgsys] = "msgsys";
717 #if defined (SYS_msleep)
718 syscall_table[SYS_msleep] = "msleep";
720 #if defined (SYS_msync)
721 syscall_table[SYS_msync] = "msync";
723 #if defined (SYS_munmap)
724 syscall_table[SYS_munmap] = "munmap";
726 #if defined (SYS_mvalid)
727 syscall_table[SYS_mvalid] = "mvalid";
729 #if defined (SYS_mwakeup)
730 syscall_table[SYS_mwakeup] = "mwakeup";
732 #if defined (SYS_naccept)
733 syscall_table[SYS_naccept] = "naccept";
735 #if defined (SYS_nanosleep)
736 syscall_table[SYS_nanosleep] = "nanosleep";
738 #if defined (SYS_nfssvc)
739 syscall_table[SYS_nfssvc] = "nfssvc";
741 #if defined (SYS_nfssys)
742 syscall_table[SYS_nfssys] = "nfssys";
744 #if defined (SYS_ngetpeername)
745 syscall_table[SYS_ngetpeername] = "ngetpeername";
747 #if defined (SYS_ngetsockname)
748 syscall_table[SYS_ngetsockname] = "ngetsockname";
750 #if defined (SYS_nice)
751 syscall_table[SYS_nice] = "nice";
753 #if defined (SYS_nrecvfrom)
754 syscall_table[SYS_nrecvfrom] = "nrecvfrom";
756 #if defined (SYS_nrecvmsg)
757 syscall_table[SYS_nrecvmsg] = "nrecvmsg";
759 #if defined (SYS_nsendmsg)
760 syscall_table[SYS_nsendmsg] = "nsendmsg";
762 #if defined (SYS_ntp_adjtime)
763 syscall_table[SYS_ntp_adjtime] = "ntp_adjtime";
765 #if defined (SYS_ntp_gettime)
766 syscall_table[SYS_ntp_gettime] = "ntp_gettime";
768 #if defined (SYS_nuname)
769 syscall_table[SYS_nuname] = "nuname";
771 #if defined (SYS_obreak)
772 syscall_table[SYS_obreak] = "obreak";
774 #if defined (SYS_old_accept)
775 syscall_table[SYS_old_accept] = "old_accept";
777 #if defined (SYS_old_fstat)
778 syscall_table[SYS_old_fstat] = "old_fstat";
780 #if defined (SYS_old_getpeername)
781 syscall_table[SYS_old_getpeername] = "old_getpeername";
783 #if defined (SYS_old_getpgrp)
784 syscall_table[SYS_old_getpgrp] = "old_getpgrp";
786 #if defined (SYS_old_getsockname)
787 syscall_table[SYS_old_getsockname] = "old_getsockname";
789 #if defined (SYS_old_killpg)
790 syscall_table[SYS_old_killpg] = "old_killpg";
792 #if defined (SYS_old_lstat)
793 syscall_table[SYS_old_lstat] = "old_lstat";
795 #if defined (SYS_old_recv)
796 syscall_table[SYS_old_recv] = "old_recv";
798 #if defined (SYS_old_recvfrom)
799 syscall_table[SYS_old_recvfrom] = "old_recvfrom";
801 #if defined (SYS_old_recvmsg)
802 syscall_table[SYS_old_recvmsg] = "old_recvmsg";
804 #if defined (SYS_old_send)
805 syscall_table[SYS_old_send] = "old_send";
807 #if defined (SYS_old_sendmsg)
808 syscall_table[SYS_old_sendmsg] = "old_sendmsg";
810 #if defined (SYS_old_sigblock)
811 syscall_table[SYS_old_sigblock] = "old_sigblock";
813 #if defined (SYS_old_sigsetmask)
814 syscall_table[SYS_old_sigsetmask] = "old_sigsetmask";
816 #if defined (SYS_old_sigvec)
817 syscall_table[SYS_old_sigvec] = "old_sigvec";
819 #if defined (SYS_old_stat)
820 syscall_table[SYS_old_stat] = "old_stat";
822 #if defined (SYS_old_vhangup)
823 syscall_table[SYS_old_vhangup] = "old_vhangup";
825 #if defined (SYS_old_wait)
826 syscall_table[SYS_old_wait] = "old_wait";
828 #if defined (SYS_oldquota)
829 syscall_table[SYS_oldquota] = "oldquota";
831 #if defined (SYS_online)
832 syscall_table[SYS_online] = "online";
834 #if defined (SYS_open)
835 syscall_table[SYS_open] = "open";
837 #if defined (SYS_open64)
838 syscall_table[SYS_open64] = "open64";
840 #if defined (SYS_ovadvise)
841 syscall_table[SYS_ovadvise] = "ovadvise";
843 #if defined (SYS_p_online)
844 syscall_table[SYS_p_online] = "p_online";
846 #if defined (SYS_pagelock)
847 syscall_table[SYS_pagelock] = "pagelock";
849 #if defined (SYS_pathconf)
850 syscall_table[SYS_pathconf] = "pathconf";
852 #if defined (SYS_pause)
853 syscall_table[SYS_pause] = "pause";
855 #if defined (SYS_pgrpsys)
856 syscall_table[SYS_pgrpsys] = "pgrpsys";
858 #if defined (SYS_pid_block)
859 syscall_table[SYS_pid_block] = "pid_block";
861 #if defined (SYS_pid_unblock)
862 syscall_table[SYS_pid_unblock] = "pid_unblock";
864 #if defined (SYS_pipe)
865 syscall_table[SYS_pipe] = "pipe";
867 #if defined (SYS_plock)
868 syscall_table[SYS_plock] = "plock";
870 #if defined (SYS_poll)
871 syscall_table[SYS_poll] = "poll";
873 #if defined (SYS_prctl)
874 syscall_table[SYS_prctl] = "prctl";
876 #if defined (SYS_pread)
877 syscall_table[SYS_pread] = "pread";
879 #if defined (SYS_pread64)
880 syscall_table[SYS_pread64] = "pread64";
882 #if defined (SYS_pread64)
883 syscall_table[SYS_pread64] = "pread64";
885 #if defined (SYS_prepblock)
886 syscall_table[SYS_prepblock] = "prepblock";
888 #if defined (SYS_priocntl)
889 syscall_table[SYS_priocntl] = "priocntl";
891 #if defined (SYS_priocntllst)
892 syscall_table[SYS_priocntllst] = "priocntllst";
894 #if defined (SYS_priocntlset)
895 syscall_table[SYS_priocntlset] = "priocntlset";
897 #if defined (SYS_priocntlsys)
898 syscall_table[SYS_priocntlsys] = "priocntlsys";
900 #if defined (SYS_procblk)
901 syscall_table[SYS_procblk] = "procblk";
903 #if defined (SYS_processor_bind)
904 syscall_table[SYS_processor_bind] = "processor_bind";
906 #if defined (SYS_processor_exbind)
907 syscall_table[SYS_processor_exbind] = "processor_exbind";
909 #if defined (SYS_processor_info)
910 syscall_table[SYS_processor_info] = "processor_info";
912 #if defined (SYS_procpriv)
913 syscall_table[SYS_procpriv] = "procpriv";
915 #if defined (SYS_profil)
916 syscall_table[SYS_profil] = "profil";
918 #if defined (SYS_proplist_syscall)
919 syscall_table[SYS_proplist_syscall] = "proplist_syscall";
921 #if defined (SYS_pset)
922 syscall_table[SYS_pset] = "pset";
924 #if defined (SYS_ptrace)
925 syscall_table[SYS_ptrace] = "ptrace";
927 #if defined (SYS_putmsg)
928 syscall_table[SYS_putmsg] = "putmsg";
930 #if defined (SYS_putpmsg)
931 syscall_table[SYS_putpmsg] = "putpmsg";
933 #if defined (SYS_pwrite)
934 syscall_table[SYS_pwrite] = "pwrite";
936 #if defined (SYS_pwrite64)
937 syscall_table[SYS_pwrite64] = "pwrite64";
939 #if defined (SYS_quotactl)
940 syscall_table[SYS_quotactl] = "quotactl";
942 #if defined (SYS_rdblock)
943 syscall_table[SYS_rdblock] = "rdblock";
945 #if defined (SYS_read)
946 syscall_table[SYS_read] = "read";
948 #if defined (SYS_readlink)
949 syscall_table[SYS_readlink] = "readlink";
951 #if defined (SYS_readv)
952 syscall_table[SYS_readv] = "readv";
954 #if defined (SYS_reboot)
955 syscall_table[SYS_reboot] = "reboot";
957 #if defined (SYS_recv)
958 syscall_table[SYS_recv] = "recv";
960 #if defined (SYS_recvfrom)
961 syscall_table[SYS_recvfrom] = "recvfrom";
963 #if defined (SYS_recvmsg)
964 syscall_table[SYS_recvmsg] = "recvmsg";
966 #if defined (SYS_rename)
967 syscall_table[SYS_rename] = "rename";
969 #if defined (SYS_resolvepath)
970 syscall_table[SYS_resolvepath] = "resolvepath";
972 #if defined (SYS_revoke)
973 syscall_table[SYS_revoke] = "revoke";
975 #if defined (SYS_rfsys)
976 syscall_table[SYS_rfsys] = "rfsys";
978 #if defined (SYS_rmdir)
979 syscall_table[SYS_rmdir] = "rmdir";
981 #if defined (SYS_rpcsys)
982 syscall_table[SYS_rpcsys] = "rpcsys";
984 #if defined (SYS_sbrk)
985 syscall_table[SYS_sbrk] = "sbrk";
987 #if defined (SYS_schedctl)
988 syscall_table[SYS_schedctl] = "schedctl";
990 #if defined (SYS_secadvise)
991 syscall_table[SYS_secadvise] = "secadvise";
993 #if defined (SYS_secsys)
994 syscall_table[SYS_secsys] = "secsys";
996 #if defined (SYS_security)
997 syscall_table[SYS_security] = "security";
999 #if defined (SYS_select)
1000 syscall_table[SYS_select] = "select";
1002 #if defined (SYS_semctl)
1003 syscall_table[SYS_semctl] = "semctl";
1005 #if defined (SYS_semget)
1006 syscall_table[SYS_semget] = "semget";
1008 #if defined (SYS_semop)
1009 syscall_table[SYS_semop] = "semop";
1011 #if defined (SYS_semsys)
1012 syscall_table[SYS_semsys] = "semsys";
1014 #if defined (SYS_send)
1015 syscall_table[SYS_send] = "send";
1017 #if defined (SYS_sendmsg)
1018 syscall_table[SYS_sendmsg] = "sendmsg";
1020 #if defined (SYS_sendto)
1021 syscall_table[SYS_sendto] = "sendto";
1023 #if defined (SYS_set_program_attributes)
1024 syscall_table[SYS_set_program_attributes] = "set_program_attributes";
1026 #if defined (SYS_set_speculative)
1027 syscall_table[SYS_set_speculative] = "set_speculative";
1029 #if defined (SYS_set_sysinfo)
1030 syscall_table[SYS_set_sysinfo] = "set_sysinfo";
1032 #if defined (SYS_setcontext)
1033 syscall_table[SYS_setcontext] = "setcontext";
1035 #if defined (SYS_setdomainname)
1036 syscall_table[SYS_setdomainname] = "setdomainname";
1038 #if defined (SYS_setegid)
1039 syscall_table[SYS_setegid] = "setegid";
1041 #if defined (SYS_seteuid)
1042 syscall_table[SYS_seteuid] = "seteuid";
1044 #if defined (SYS_setgid)
1045 syscall_table[SYS_setgid] = "setgid";
1047 #if defined (SYS_setgroups)
1048 syscall_table[SYS_setgroups] = "setgroups";
1050 #if defined (SYS_sethostid)
1051 syscall_table[SYS_sethostid] = "sethostid";
1053 #if defined (SYS_sethostname)
1054 syscall_table[SYS_sethostname] = "sethostname";
1056 #if defined (SYS_setitimer)
1057 syscall_table[SYS_setitimer] = "setitimer";
1059 #if defined (SYS_setlogin)
1060 syscall_table[SYS_setlogin] = "setlogin";
1062 #if defined (SYS_setpgid)
1063 syscall_table[SYS_setpgid] = "setpgid";
1065 #if defined (SYS_setpgrp)
1066 syscall_table[SYS_setpgrp] = "setpgrp";
1068 #if defined (SYS_setpriority)
1069 syscall_table[SYS_setpriority] = "setpriority";
1071 #if defined (SYS_setregid)
1072 syscall_table[SYS_setregid] = "setregid";
1074 #if defined (SYS_setreuid)
1075 syscall_table[SYS_setreuid] = "setreuid";
1077 #if defined (SYS_setrlimit)
1078 syscall_table[SYS_setrlimit] = "setrlimit";
1080 #if defined (SYS_setrlimit64)
1081 syscall_table[SYS_setrlimit64] = "setrlimit64";
1083 #if defined (SYS_setsid)
1084 syscall_table[SYS_setsid] = "setsid";
1086 #if defined (SYS_setsockopt)
1087 syscall_table[SYS_setsockopt] = "setsockopt";
1089 #if defined (SYS_settimeofday)
1090 syscall_table[SYS_settimeofday] = "settimeofday";
1092 #if defined (SYS_setuid)
1093 syscall_table[SYS_setuid] = "setuid";
1095 #if defined (SYS_sgi)
1096 syscall_table[SYS_sgi] = "sgi";
1098 #if defined (SYS_sgifastpath)
1099 syscall_table[SYS_sgifastpath] = "sgifastpath";
1101 #if defined (SYS_sgikopt)
1102 syscall_table[SYS_sgikopt] = "sgikopt";
1104 #if defined (SYS_sginap)
1105 syscall_table[SYS_sginap] = "sginap";
1107 #if defined (SYS_shmat)
1108 syscall_table[SYS_shmat] = "shmat";
1110 #if defined (SYS_shmctl)
1111 syscall_table[SYS_shmctl] = "shmctl";
1113 #if defined (SYS_shmdt)
1114 syscall_table[SYS_shmdt] = "shmdt";
1116 #if defined (SYS_shmget)
1117 syscall_table[SYS_shmget] = "shmget";
1119 #if defined (SYS_shmsys)
1120 syscall_table[SYS_shmsys] = "shmsys";
1122 #if defined (SYS_shutdown)
1123 syscall_table[SYS_shutdown] = "shutdown";
1125 #if defined (SYS_sigaction)
1126 syscall_table[SYS_sigaction] = "sigaction";
1128 #if defined (SYS_sigaltstack)
1129 syscall_table[SYS_sigaltstack] = "sigaltstack";
1131 #if defined (SYS_sigaltstack)
1132 syscall_table[SYS_sigaltstack] = "sigaltstack";
1134 #if defined (SYS_sigblock)
1135 syscall_table[SYS_sigblock] = "sigblock";
1137 #if defined (SYS_signal)
1138 syscall_table[SYS_signal] = "signal";
1140 #if defined (SYS_signotify)
1141 syscall_table[SYS_signotify] = "signotify";
1143 #if defined (SYS_signotifywait)
1144 syscall_table[SYS_signotifywait] = "signotifywait";
1146 #if defined (SYS_sigpending)
1147 syscall_table[SYS_sigpending] = "sigpending";
1149 #if defined (SYS_sigpoll)
1150 syscall_table[SYS_sigpoll] = "sigpoll";
1152 #if defined (SYS_sigprocmask)
1153 syscall_table[SYS_sigprocmask] = "sigprocmask";
1155 #if defined (SYS_sigqueue)
1156 syscall_table[SYS_sigqueue] = "sigqueue";
1158 #if defined (SYS_sigreturn)
1159 syscall_table[SYS_sigreturn] = "sigreturn";
1161 #if defined (SYS_sigsendset)
1162 syscall_table[SYS_sigsendset] = "sigsendset";
1164 #if defined (SYS_sigsendsys)
1165 syscall_table[SYS_sigsendsys] = "sigsendsys";
1167 #if defined (SYS_sigsetmask)
1168 syscall_table[SYS_sigsetmask] = "sigsetmask";
1170 #if defined (SYS_sigstack)
1171 syscall_table[SYS_sigstack] = "sigstack";
1173 #if defined (SYS_sigsuspend)
1174 syscall_table[SYS_sigsuspend] = "sigsuspend";
1176 #if defined (SYS_sigvec)
1177 syscall_table[SYS_sigvec] = "sigvec";
1179 #if defined (SYS_sigwait)
1180 syscall_table[SYS_sigwait] = "sigwait";
1182 #if defined (SYS_sigwaitprim)
1183 syscall_table[SYS_sigwaitprim] = "sigwaitprim";
1185 #if defined (SYS_sleep)
1186 syscall_table[SYS_sleep] = "sleep";
1188 #if defined (SYS_so_socket)
1189 syscall_table[SYS_so_socket] = "so_socket";
1191 #if defined (SYS_so_socketpair)
1192 syscall_table[SYS_so_socketpair] = "so_socketpair";
1194 #if defined (SYS_sockconfig)
1195 syscall_table[SYS_sockconfig] = "sockconfig";
1197 #if defined (SYS_socket)
1198 syscall_table[SYS_socket] = "socket";
1200 #if defined (SYS_socketpair)
1201 syscall_table[SYS_socketpair] = "socketpair";
1203 #if defined (SYS_sproc)
1204 syscall_table[SYS_sproc] = "sproc";
1206 #if defined (SYS_sprocsp)
1207 syscall_table[SYS_sprocsp] = "sprocsp";
1209 #if defined (SYS_sstk)
1210 syscall_table[SYS_sstk] = "sstk";
1212 #if defined (SYS_stat)
1213 syscall_table[SYS_stat] = "stat";
1215 #if defined (SYS_stat64)
1216 syscall_table[SYS_stat64] = "stat64";
1218 #if defined (SYS_statfs)
1219 syscall_table[SYS_statfs] = "statfs";
1221 #if defined (SYS_statvfs)
1222 syscall_table[SYS_statvfs] = "statvfs";
1224 #if defined (SYS_statvfs64)
1225 syscall_table[SYS_statvfs64] = "statvfs64";
1227 #if defined (SYS_stime)
1228 syscall_table[SYS_stime] = "stime";
1230 #if defined (SYS_stty)
1231 syscall_table[SYS_stty] = "stty";
1233 #if defined (SYS_subsys_info)
1234 syscall_table[SYS_subsys_info] = "subsys_info";
1236 #if defined (SYS_swapctl)
1237 syscall_table[SYS_swapctl] = "swapctl";
1239 #if defined (SYS_swapon)
1240 syscall_table[SYS_swapon] = "swapon";
1242 #if defined (SYS_symlink)
1243 syscall_table[SYS_symlink] = "symlink";
1245 #if defined (SYS_sync)
1246 syscall_table[SYS_sync] = "sync";
1248 #if defined (SYS_sys3b)
1249 syscall_table[SYS_sys3b] = "sys3b";
1251 #if defined (SYS_syscall)
1252 syscall_table[SYS_syscall] = "syscall";
1254 #if defined (SYS_sysconfig)
1255 syscall_table[SYS_sysconfig] = "sysconfig";
1257 #if defined (SYS_sysfs)
1258 syscall_table[SYS_sysfs] = "sysfs";
1260 #if defined (SYS_sysi86)
1261 syscall_table[SYS_sysi86] = "sysi86";
1263 #if defined (SYS_sysinfo)
1264 syscall_table[SYS_sysinfo] = "sysinfo";
1266 #if defined (SYS_sysmips)
1267 syscall_table[SYS_sysmips] = "sysmips";
1269 #if defined (SYS_syssun)
1270 syscall_table[SYS_syssun] = "syssun";
1272 #if defined (SYS_systeminfo)
1273 syscall_table[SYS_systeminfo] = "systeminfo";
1275 #if defined (SYS_table)
1276 syscall_table[SYS_table] = "table";
1278 #if defined (SYS_time)
1279 syscall_table[SYS_time] = "time";
1281 #if defined (SYS_timedwait)
1282 syscall_table[SYS_timedwait] = "timedwait";
1284 #if defined (SYS_timer_create)
1285 syscall_table[SYS_timer_create] = "timer_create";
1287 #if defined (SYS_timer_delete)
1288 syscall_table[SYS_timer_delete] = "timer_delete";
1290 #if defined (SYS_timer_getoverrun)
1291 syscall_table[SYS_timer_getoverrun] = "timer_getoverrun";
1293 #if defined (SYS_timer_gettime)
1294 syscall_table[SYS_timer_gettime] = "timer_gettime";
1296 #if defined (SYS_timer_settime)
1297 syscall_table[SYS_timer_settime] = "timer_settime";
1299 #if defined (SYS_times)
1300 syscall_table[SYS_times] = "times";
1302 #if defined (SYS_truncate)
1303 syscall_table[SYS_truncate] = "truncate";
1305 #if defined (SYS_truncate64)
1306 syscall_table[SYS_truncate64] = "truncate64";
1308 #if defined (SYS_tsolsys)
1309 syscall_table[SYS_tsolsys] = "tsolsys";
1311 #if defined (SYS_uadmin)
1312 syscall_table[SYS_uadmin] = "uadmin";
1314 #if defined (SYS_ulimit)
1315 syscall_table[SYS_ulimit] = "ulimit";
1317 #if defined (SYS_umask)
1318 syscall_table[SYS_umask] = "umask";
1320 #if defined (SYS_umount)
1321 syscall_table[SYS_umount] = "umount";
1323 #if defined (SYS_uname)
1324 syscall_table[SYS_uname] = "uname";
1326 #if defined (SYS_unblock)
1327 syscall_table[SYS_unblock] = "unblock";
1329 #if defined (SYS_unlink)
1330 syscall_table[SYS_unlink] = "unlink";
1332 #if defined (SYS_unmount)
1333 syscall_table[SYS_unmount] = "unmount";
1335 #if defined (SYS_usleep_thread)
1336 syscall_table[SYS_usleep_thread] = "usleep_thread";
1338 #if defined (SYS_uswitch)
1339 syscall_table[SYS_uswitch] = "uswitch";
1341 #if defined (SYS_utc_adjtime)
1342 syscall_table[SYS_utc_adjtime] = "utc_adjtime";
1344 #if defined (SYS_utc_gettime)
1345 syscall_table[SYS_utc_gettime] = "utc_gettime";
1347 #if defined (SYS_utime)
1348 syscall_table[SYS_utime] = "utime";
1350 #if defined (SYS_utimes)
1351 syscall_table[SYS_utimes] = "utimes";
1353 #if defined (SYS_utssys)
1354 syscall_table[SYS_utssys] = "utssys";
1356 #if defined (SYS_vfork)
1357 syscall_table[SYS_vfork] = "vfork";
1359 #if defined (SYS_vhangup)
1360 syscall_table[SYS_vhangup] = "vhangup";
1362 #if defined (SYS_vtrace)
1363 syscall_table[SYS_vtrace] = "vtrace";
1365 #if defined (SYS_wait)
1366 syscall_table[SYS_wait] = "wait";
1368 #if defined (SYS_waitid)
1369 syscall_table[SYS_waitid] = "waitid";
1371 #if defined (SYS_waitsys)
1372 syscall_table[SYS_waitsys] = "waitsys";
1374 #if defined (SYS_write)
1375 syscall_table[SYS_write] = "write";
1377 #if defined (SYS_writev)
1378 syscall_table[SYS_writev] = "writev";
1380 #if defined (SYS_xenix)
1381 syscall_table[SYS_xenix] = "xenix";
1383 #if defined (SYS_xmknod)
1384 syscall_table[SYS_xmknod] = "xmknod";
1386 #if defined (SYS_xstat)
1387 syscall_table[SYS_xstat] = "xstat";
1389 #if defined (SYS_yield)
1390 syscall_table[SYS_yield] = "yield";
1395 * Prettyprint a single syscall by number.
1399 proc_prettyfprint_syscall (file, num, verbose)
1404 if (syscall_table[num])
1405 fprintf (file, "SYS_%s ", syscall_table[num]);
1407 fprintf (file, "<Unknown syscall %d> ", num);
1411 proc_prettyprint_syscall (num, verbose)
1415 proc_prettyfprint_syscall (stdout, num, verbose);
1419 * Prettyprint all of the syscalls in a sysset_t set.
1423 proc_prettyfprint_syscalls (file, sysset, verbose)
1430 for (i = 0; i < MAX_SYSCALLS; i++)
1431 if (prismember (sysset, i))
1433 proc_prettyfprint_syscall (file, i, verbose);
1435 fprintf (file, "\n");
1439 proc_prettyprint_syscalls (sysset, verbose)
1443 proc_prettyfprint_syscalls (stdout, sysset, verbose);
1446 /* FIXME: add real-time signals */
1448 static struct trans signal_table[] =
1450 { 0, "<no signal>", "no signal" },
1452 { SIGHUP, "SIGHUP", "Hangup" },
1455 { SIGINT, "SIGINT", "Interrupt (rubout)" },
1458 { SIGQUIT, "SIGQUIT", "Quit (ASCII FS)" },
1461 { SIGILL, "SIGILL", "Illegal instruction" }, /* not reset when caught */
1464 { SIGTRAP, "SIGTRAP", "Trace trap" }, /* not reset when caught */
1467 { SIGABRT, "SIGABRT", "used by abort()" }, /* replaces SIGIOT */
1470 { SIGIOT, "SIGIOT", "IOT instruction" },
1473 { SIGEMT, "SIGEMT", "EMT instruction" },
1476 { SIGFPE, "SIGFPE", "Floating point exception" },
1479 { SIGKILL, "SIGKILL", "Kill" }, /* Solaris: cannot be caught/ignored */
1482 { SIGBUS, "SIGBUS", "Bus error" },
1485 { SIGSEGV, "SIGSEGV", "Segmentation violation" },
1488 { SIGSYS, "SIGSYS", "Bad argument to system call" },
1491 { SIGPIPE, "SIGPIPE", "Write to pipe with no one to read it" },
1494 { SIGALRM, "SIGALRM", "Alarm clock" },
1497 { SIGTERM, "SIGTERM", "Software termination signal from kill" },
1500 { SIGUSR1, "SIGUSR1", "User defined signal 1" },
1503 { SIGUSR2, "SIGUSR2", "User defined signal 2" },
1506 { SIGCHLD, "SIGCHLD", "Child status changed" }, /* Posix version */
1509 { SIGCLD, "SIGCLD", "Child status changed" }, /* Solaris version */
1512 { SIGPWR, "SIGPWR", "Power-fail restart" },
1515 { SIGWINCH, "SIGWINCH", "Window size change" },
1518 { SIGURG, "SIGURG", "Urgent socket condition" },
1521 { SIGPOLL, "SIGPOLL", "Pollable event" },
1524 { SIGIO, "SIGIO", "Socket I/O possible" }, /* alias for SIGPOLL */
1527 { SIGSTOP, "SIGSTOP", "Stop, not from tty" }, /* cannot be caught or ignored */
1530 { SIGTSTP, "SIGTSTP", "User stop from tty" },
1533 { SIGCONT, "SIGCONT", "Stopped process has been continued" },
1536 { SIGTTIN, "SIGTTIN", "Background tty read attempted" },
1539 { SIGTTOU, "SIGTTOU", "Background tty write attempted" },
1542 { SIGVTALRM, "SIGVTALRM", "Virtual timer expired" },
1545 { SIGPROF, "SIGPROF", "Profiling timer expired" },
1548 { SIGXCPU, "SIGXCPU", "Exceeded CPU limit" },
1551 { SIGXFSZ, "SIGXFSZ", "Exceeded file size limit" },
1554 { SIGWAITING, "SIGWAITING", "Process's LWPs are blocked" },
1557 { SIGLWP, "SIGLWP", "Used by thread library" },
1560 { SIGFREEZE, "SIGFREEZE", "Used by CPR" },
1563 { SIGTHAW, "SIGTHAW", "Used by CPR" },
1566 { SIGCANCEL, "SIGCANCEL", "Used by libthread" },
1569 { SIGLOST, "SIGLOST", "Resource lost" },
1572 { SIG32, "SIG32", "Reserved for kernel usage (Irix)" },
1575 { SIGPTINTR, "SIGPTINTR", "Posix 1003.1b" },
1578 { SIGTRESCHED, "SIGTRESCHED", "Posix 1003.1b" },
1581 { SIGINFO, "SIGINFO", "Information request" },
1584 { SIGRESV, "SIGRESV", "Reserved by Digital for future use" },
1587 { SIGAIO, "SIGAIO", "Asynchronous I/O signal" },
1592 * Prettyprint a single signal by number.
1593 * Accepts a signal number and finds it in the signal table,
1594 * then pretty-prints it.
1598 proc_prettyfprint_signal (file, signo, verbose)
1605 for (i = 0; i < sizeof (signal_table) / sizeof (signal_table[0]); i++)
1606 if (signo == signal_table[i].value)
1608 fprintf (file, "%s", signal_table[i].name);
1610 fprintf (file, ": %s\n", signal_table[i].desc);
1612 fprintf (file, " ");
1615 fprintf (file, "Unknown signal %d%c", signo, verbose ? '\n' : ' ');
1619 proc_prettyprint_signal (signo, verbose)
1623 proc_prettyfprint_signal (stdout, signo, verbose);
1627 * Prettyprint all of the signals in a sigset_t set.
1629 * This function loops over all signal numbers from 0 to NSIG,
1630 * uses them as indexes for prismember, and prints them pretty.
1632 * It does not loop over the signal table, as is done with the
1633 * fault table, because the signal table may contain aliases.
1634 * If it did, both aliases would be printed.
1638 proc_prettyfprint_signalset (file, sigset, verbose)
1645 for (i = 0; i < NSIG; i++)
1646 if (prismember (sigset, i))
1647 proc_prettyfprint_signal (file, i, verbose);
1650 fprintf (file, "\n");
1654 proc_prettyprint_signalset (sigset, verbose)
1658 proc_prettyfprint_signalset (stdout, sigset, verbose);
1661 /* Hardware fault translation table. */
1663 static struct trans fault_table[] =
1665 #if defined (FLTILL)
1666 { FLTILL, "FLTILL", "Illegal instruction" },
1668 #if defined (FLTPRIV)
1669 { FLTPRIV, "FLTPRIV", "Privileged instruction" },
1671 #if defined (FLTBPT)
1672 { FLTBPT, "FLTBPT", "Breakpoint trap" },
1674 #if defined (FLTTRACE)
1675 { FLTTRACE, "FLTTRACE", "Trace trap" },
1677 #if defined (FLTACCESS)
1678 { FLTACCESS, "FLTACCESS", "Memory access fault" },
1680 #if defined (FLTBOUNDS)
1681 { FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation" },
1683 #if defined (FLTIOVF)
1684 { FLTIOVF, "FLTIOVF", "Integer overflow" },
1686 #if defined (FLTIZDIV)
1687 { FLTIZDIV, "FLTIZDIV", "Integer zero divide" },
1689 #if defined (FLTFPE)
1690 { FLTFPE, "FLTFPE", "Floating-point exception" },
1692 #if defined (FLTSTACK)
1693 { FLTSTACK, "FLTSTACK", "Unrecoverable stack fault" },
1695 #if defined (FLTPAGE)
1696 { FLTPAGE, "FLTPAGE", "Recoverable page fault" },
1698 #if defined (FLTPCINVAL)
1699 { FLTPCINVAL, "FLTPCINVAL", "Invalid PC exception" },
1701 #if defined (FLTWATCH)
1702 { FLTWATCH, "FLTWATCH", "User watchpoint" },
1704 #if defined (FLTKWATCH)
1705 { FLTKWATCH, "FLTKWATCH", "Kernel watchpoint" },
1707 #if defined (FLTSCWATCH)
1708 { FLTSCWATCH, "FLTSCWATCH", "Hit a store conditional on a watched page" },
1713 * Work horse. Accepts an index into the fault table, prints it pretty.
1717 prettyfprint_faulttable_entry (file, i, verbose)
1722 fprintf (file, "%s", fault_table[i].name);
1724 fprintf (file, ": %s\n", fault_table[i].desc);
1726 fprintf (file, " ");
1730 * Prettyprint a hardware fault by number.
1734 proc_prettyfprint_fault (file, faultno, verbose)
1741 for (i = 0; i < sizeof (fault_table) / sizeof (fault_table[0]); i++)
1742 if (faultno == fault_table[i].value)
1744 prettyfprint_faulttable_entry (file, i, verbose);
1748 fprintf (file, "Unknown hardware fault %d%c",
1749 faultno, verbose ? '\n' : ' ');
1753 proc_prettyprint_fault (faultno, verbose)
1757 proc_prettyfprint_fault (stdout, faultno, verbose);
1761 * Prettyprint all the faults in a fltset_t set.
1763 * This function loops thru the fault table,
1764 * using the value field as the index to prismember.
1765 * The fault table had better not contain aliases,
1766 * for if it does they will both be printed.
1770 proc_prettyfprint_faultset (file, fltset, verbose)
1777 for (i = 0; i < sizeof (fault_table) / sizeof (fault_table[0]); i++)
1778 if (prismember (fltset, fault_table[i].value))
1779 prettyfprint_faulttable_entry (file, i, verbose);
1782 fprintf (file, "\n");
1786 proc_prettyprint_faultset (fltset, verbose)
1790 proc_prettyfprint_faultset (stdout, fltset, verbose);
1794 * Todo: actions, holds...
1798 proc_prettyprint_actionset (struct sigaction *actions, int verbose)
1803 _initialize_proc_events ()
1805 init_syscall_table ();