1 /* Machine independent support for SVR4 /proc (process file system) for GDB.
2 Copyright 1999, 2000 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 #ifdef HAVE_SYS_SYSCALL_H
44 #include <sys/syscall.h>
46 #ifdef HAVE_SYS_FAULT_H
47 #include <sys/fault.h>
50 /* Much of the information used in the /proc interface, particularly for
51 printing status information, is kept as tables of structures of the
52 following form. These tables can be used to map numeric values to
53 their symbolic names and to a string that describes their specific use. */
56 int value; /* The numeric value */
57 char *name; /* The equivalent symbolic value */
58 char *desc; /* Short description of value */
62 * pretty print syscalls
65 /* Ugh -- Unixware and Solaris spell these differently! */
68 #define SYS_lwp_create SYS_lwpcreate
72 #define SYS_lwp_exit SYS_lwpexit
76 #define SYS_lwp_wait SYS_lwpwait
80 #define SYS_lwp_self SYS_lwpself
84 #define SYS_lwp_info SYS_lwpinfo
88 #define SYS_lwp_private SYS_lwpprivate
92 #define SYS_lwp_kill SYS_lwpkill
96 #define SYS_lwp_suspend SYS_lwpsuspend
99 #ifdef SYS_lwpcontinue
100 #define SYS_lwp_continue SYS_lwpcontinue
104 /* Syscall translation table. */
106 #define MAX_SYSCALLS 262 /* pretty arbitrary */
107 static char * syscall_table[MAX_SYSCALLS];
110 init_syscall_table (void)
112 #if defined (SYS_BSD_getime)
113 syscall_table[SYS_BSD_getime] = "BSD_getime";
115 #if defined (SYS_BSDgetpgrp)
116 syscall_table[SYS_BSDgetpgrp] = "BSDgetpgrp";
118 #if defined (SYS_BSDsetpgrp)
119 syscall_table[SYS_BSDsetpgrp] = "BSDsetpgrp";
121 #if defined (SYS_acancel)
122 syscall_table[SYS_acancel] = "acancel";
124 #if defined (SYS_accept)
125 syscall_table[SYS_accept] = "accept";
127 #if defined (SYS_access)
128 syscall_table[SYS_access] = "access";
130 #if defined (SYS_acct)
131 syscall_table[SYS_acct] = "acct";
133 #if defined (SYS_acl)
134 syscall_table[SYS_acl] = "acl";
136 #if defined (SYS_aclipc)
137 syscall_table[SYS_aclipc] = "aclipc";
139 #if defined (SYS_adjtime)
140 syscall_table[SYS_adjtime] = "adjtime";
142 #if defined (SYS_afs_syscall)
143 syscall_table[SYS_afs_syscall] = "afs_syscall";
145 #if defined (SYS_alarm)
146 syscall_table[SYS_alarm] = "alarm";
148 #if defined (SYS_alt_plock)
149 syscall_table[SYS_alt_plock] = "alt_plock";
151 #if defined (SYS_alt_sigpending)
152 syscall_table[SYS_alt_sigpending] = "alt_sigpending";
154 #if defined (SYS_async)
155 syscall_table[SYS_async] = "async";
157 #if defined (SYS_async_daemon)
158 syscall_table[SYS_async_daemon] = "async_daemon";
160 #if defined (SYS_audcntl)
161 syscall_table[SYS_audcntl] = "audcntl";
163 #if defined (SYS_audgen)
164 syscall_table[SYS_audgen] = "audgen";
166 #if defined (SYS_auditbuf)
167 syscall_table[SYS_auditbuf] = "auditbuf";
169 #if defined (SYS_auditctl)
170 syscall_table[SYS_auditctl] = "auditctl";
172 #if defined (SYS_auditdmp)
173 syscall_table[SYS_auditdmp] = "auditdmp";
175 #if defined (SYS_auditevt)
176 syscall_table[SYS_auditevt] = "auditevt";
178 #if defined (SYS_auditlog)
179 syscall_table[SYS_auditlog] = "auditlog";
181 #if defined (SYS_auditsys)
182 syscall_table[SYS_auditsys] = "auditsys";
184 #if defined (SYS_bind)
185 syscall_table[SYS_bind] = "bind";
187 #if defined (SYS_block)
188 syscall_table[SYS_block] = "block";
190 #if defined (SYS_brk)
191 syscall_table[SYS_brk] = "brk";
193 #if defined (SYS_cachectl)
194 syscall_table[SYS_cachectl] = "cachectl";
196 #if defined (SYS_cacheflush)
197 syscall_table[SYS_cacheflush] = "cacheflush";
199 #if defined (SYS_cancelblock)
200 syscall_table[SYS_cancelblock] = "cancelblock";
202 #if defined (SYS_cg_bind)
203 syscall_table[SYS_cg_bind] = "cg_bind";
205 #if defined (SYS_cg_current)
206 syscall_table[SYS_cg_current] = "cg_current";
208 #if defined (SYS_cg_ids)
209 syscall_table[SYS_cg_ids] = "cg_ids";
211 #if defined (SYS_cg_info)
212 syscall_table[SYS_cg_info] = "cg_info";
214 #if defined (SYS_cg_memloc)
215 syscall_table[SYS_cg_memloc] = "cg_memloc";
217 #if defined (SYS_cg_processors)
218 syscall_table[SYS_cg_processors] = "cg_processors";
220 #if defined (SYS_chdir)
221 syscall_table[SYS_chdir] = "chdir";
223 #if defined (SYS_chflags)
224 syscall_table[SYS_chflags] = "chflags";
226 #if defined (SYS_chmod)
227 syscall_table[SYS_chmod] = "chmod";
229 #if defined (SYS_chown)
230 syscall_table[SYS_chown] = "chown";
232 #if defined (SYS_chroot)
233 syscall_table[SYS_chroot] = "chroot";
235 #if defined (SYS_clocal)
236 syscall_table[SYS_clocal] = "clocal";
238 #if defined (SYS_clock_getres)
239 syscall_table[SYS_clock_getres] = "clock_getres";
241 #if defined (SYS_clock_gettime)
242 syscall_table[SYS_clock_gettime] = "clock_gettime";
244 #if defined (SYS_clock_settime)
245 syscall_table[SYS_clock_settime] = "clock_settime";
247 #if defined (SYS_close)
248 syscall_table[SYS_close] = "close";
250 #if defined (SYS_connect)
251 syscall_table[SYS_connect] = "connect";
253 #if defined (SYS_context)
254 syscall_table[SYS_context] = "context";
256 #if defined (SYS_creat)
257 syscall_table[SYS_creat] = "creat";
259 #if defined (SYS_creat64)
260 syscall_table[SYS_creat64] = "creat64";
262 #if defined (SYS_devstat)
263 syscall_table[SYS_devstat] = "devstat";
265 #if defined (SYS_dmi)
266 syscall_table[SYS_dmi] = "dmi";
268 #if defined (SYS_door)
269 syscall_table[SYS_door] = "door";
271 #if defined (SYS_dshmsys)
272 syscall_table[SYS_dshmsys] = "dshmsys";
274 #if defined (SYS_dup)
275 syscall_table[SYS_dup] = "dup";
277 #if defined (SYS_dup2)
278 syscall_table[SYS_dup2] = "dup2";
280 #if defined (SYS_evsys)
281 syscall_table[SYS_evsys] = "evsys";
283 #if defined (SYS_evtrapret)
284 syscall_table[SYS_evtrapret] = "evtrapret";
286 #if defined (SYS_exec)
287 syscall_table[SYS_exec] = "exec";
289 #if defined (SYS_exec_with_loader)
290 syscall_table[SYS_exec_with_loader] = "exec_with_loader";
292 #if defined (SYS_execv)
293 syscall_table[SYS_execv] = "execv";
295 #if defined (SYS_execve)
296 syscall_table[SYS_execve] = "execve";
298 #if defined (SYS_exit)
299 syscall_table[SYS_exit] = "exit";
301 #if defined (SYS_exportfs)
302 syscall_table[SYS_exportfs] = "exportfs";
304 #if defined (SYS_facl)
305 syscall_table[SYS_facl] = "facl";
307 #if defined (SYS_fchdir)
308 syscall_table[SYS_fchdir] = "fchdir";
310 #if defined (SYS_fchflags)
311 syscall_table[SYS_fchflags] = "fchflags";
313 #if defined (SYS_fchmod)
314 syscall_table[SYS_fchmod] = "fchmod";
316 #if defined (SYS_fchown)
317 syscall_table[SYS_fchown] = "fchown";
319 #if defined (SYS_fchroot)
320 syscall_table[SYS_fchroot] = "fchroot";
322 #if defined (SYS_fcntl)
323 syscall_table[SYS_fcntl] = "fcntl";
325 #if defined (SYS_fdatasync)
326 syscall_table[SYS_fdatasync] = "fdatasync";
328 #if defined (SYS_fdevstat)
329 syscall_table[SYS_fdevstat] = "fdevstat";
331 #if defined (SYS_fdsync)
332 syscall_table[SYS_fdsync] = "fdsync";
334 #if defined (SYS_filepriv)
335 syscall_table[SYS_filepriv] = "filepriv";
337 #if defined (SYS_flock)
338 syscall_table[SYS_flock] = "flock";
340 #if defined (SYS_flvlfile)
341 syscall_table[SYS_flvlfile] = "flvlfile";
343 #if defined (SYS_fork)
344 syscall_table[SYS_fork] = "fork";
346 #if defined (SYS_fork1)
347 syscall_table[SYS_fork1] = "fork1";
349 #if defined (SYS_forkall)
350 syscall_table[SYS_forkall] = "forkall";
352 #if defined (SYS_fpathconf)
353 syscall_table[SYS_fpathconf] = "fpathconf";
355 #if defined (SYS_fstat)
356 syscall_table[SYS_fstat] = "fstat";
358 #if defined (SYS_fstat64)
359 syscall_table[SYS_fstat64] = "fstat64";
361 #if defined (SYS_fstatfs)
362 syscall_table[SYS_fstatfs] = "fstatfs";
364 #if defined (SYS_fstatvfs)
365 syscall_table[SYS_fstatvfs] = "fstatvfs";
367 #if defined (SYS_fstatvfs64)
368 syscall_table[SYS_fstatvfs64] = "fstatvfs64";
370 #if defined (SYS_fsync)
371 syscall_table[SYS_fsync] = "fsync";
373 #if defined (SYS_ftruncate)
374 syscall_table[SYS_ftruncate] = "ftruncate";
376 #if defined (SYS_ftruncate64)
377 syscall_table[SYS_ftruncate64] = "ftruncate64";
379 #if defined (SYS_fuser)
380 syscall_table[SYS_fuser] = "fuser";
382 #if defined (SYS_fxstat)
383 syscall_table[SYS_fxstat] = "fxstat";
385 #if defined (SYS_get_sysinfo)
386 syscall_table[SYS_get_sysinfo] = "get_sysinfo";
388 #if defined (SYS_getaddressconf)
389 syscall_table[SYS_getaddressconf] = "getaddressconf";
391 #if defined (SYS_getcontext)
392 syscall_table[SYS_getcontext] = "getcontext";
394 #if defined (SYS_getdents)
395 syscall_table[SYS_getdents] = "getdents";
397 #if defined (SYS_getdents64)
398 syscall_table[SYS_getdents64] = "getdents64";
400 #if defined (SYS_getdirentries)
401 syscall_table[SYS_getdirentries] = "getdirentries";
403 #if defined (SYS_getdomainname)
404 syscall_table[SYS_getdomainname] = "getdomainname";
406 #if defined (SYS_getdtablesize)
407 syscall_table[SYS_getdtablesize] = "getdtablesize";
409 #if defined (SYS_getfh)
410 syscall_table[SYS_getfh] = "getfh";
412 #if defined (SYS_getfsstat)
413 syscall_table[SYS_getfsstat] = "getfsstat";
415 #if defined (SYS_getgid)
416 syscall_table[SYS_getgid] = "getgid";
418 #if defined (SYS_getgroups)
419 syscall_table[SYS_getgroups] = "getgroups";
421 #if defined (SYS_gethostid)
422 syscall_table[SYS_gethostid] = "gethostid";
424 #if defined (SYS_gethostname)
425 syscall_table[SYS_gethostname] = "gethostname";
427 #if defined (SYS_getitimer)
428 syscall_table[SYS_getitimer] = "getitimer";
430 #if defined (SYS_getksym)
431 syscall_table[SYS_getksym] = "getksym";
433 #if defined (SYS_getlogin)
434 syscall_table[SYS_getlogin] = "getlogin";
436 #if defined (SYS_getmnt)
437 syscall_table[SYS_getmnt] = "getmnt";
439 #if defined (SYS_getmsg)
440 syscall_table[SYS_getmsg] = "getmsg";
442 #if defined (SYS_getpagesize)
443 syscall_table[SYS_getpagesize] = "getpagesize";
445 #if defined (SYS_getpeername)
446 syscall_table[SYS_getpeername] = "getpeername";
448 #if defined (SYS_getpgid)
449 syscall_table[SYS_getpgid] = "getpgid";
451 #if defined (SYS_getpgrp)
452 syscall_table[SYS_getpgrp] = "getpgrp";
454 #if defined (SYS_getpid)
455 syscall_table[SYS_getpid] = "getpid";
457 #if defined (SYS_getpmsg)
458 syscall_table[SYS_getpmsg] = "getpmsg";
460 #if defined (SYS_getpriority)
461 syscall_table[SYS_getpriority] = "getpriority";
463 #if defined (SYS_getrlimit)
464 syscall_table[SYS_getrlimit] = "getrlimit";
466 #if defined (SYS_getrlimit64)
467 syscall_table[SYS_getrlimit64] = "getrlimit64";
469 #if defined (SYS_getrusage)
470 syscall_table[SYS_getrusage] = "getrusage";
472 #if defined (SYS_getsid)
473 syscall_table[SYS_getsid] = "getsid";
475 #if defined (SYS_getsockname)
476 syscall_table[SYS_getsockname] = "getsockname";
478 #if defined (SYS_getsockopt)
479 syscall_table[SYS_getsockopt] = "getsockopt";
481 #if defined (SYS_gettimeofday)
482 syscall_table[SYS_gettimeofday] = "gettimeofday";
484 #if defined (SYS_getuid)
485 syscall_table[SYS_getuid] = "getuid";
487 #if defined (SYS_gtty)
488 syscall_table[SYS_gtty] = "gtty";
490 #if defined (SYS_hrtsys)
491 syscall_table[SYS_hrtsys] = "hrtsys";
493 #if defined (SYS_inst_sync)
494 syscall_table[SYS_inst_sync] = "inst_sync";
496 #if defined (SYS_install_utrap)
497 syscall_table[SYS_install_utrap] = "install_utrap";
499 #if defined (SYS_invlpg)
500 syscall_table[SYS_invlpg] = "invlpg";
502 #if defined (SYS_ioctl)
503 syscall_table[SYS_ioctl] = "ioctl";
505 #if defined (SYS_kaio)
506 syscall_table[SYS_kaio] = "kaio";
508 #if defined (SYS_keyctl)
509 syscall_table[SYS_keyctl] = "keyctl";
511 #if defined (SYS_kill)
512 syscall_table[SYS_kill] = "kill";
514 #if defined (SYS_killpg)
515 syscall_table[SYS_killpg] = "killpg";
517 #if defined (SYS_kloadcall)
518 syscall_table[SYS_kloadcall] = "kloadcall";
520 #if defined (SYS_kmodcall)
521 syscall_table[SYS_kmodcall] = "kmodcall";
523 #if defined (SYS_ksigaction)
524 syscall_table[SYS_ksigaction] = "ksigaction";
526 #if defined (SYS_ksigprocmask)
527 syscall_table[SYS_ksigprocmask] = "ksigprocmask";
529 #if defined (SYS_ksigqueue)
530 syscall_table[SYS_ksigqueue] = "ksigqueue";
532 #if defined (SYS_lchown)
533 syscall_table[SYS_lchown] = "lchown";
535 #if defined (SYS_link)
536 syscall_table[SYS_link] = "link";
538 #if defined (SYS_listen)
539 syscall_table[SYS_listen] = "listen";
541 #if defined (SYS_llseek)
542 syscall_table[SYS_llseek] = "llseek";
544 #if defined (SYS_lseek)
545 syscall_table[SYS_lseek] = "lseek";
547 #if defined (SYS_lseek64)
548 syscall_table[SYS_lseek64] = "lseek64";
550 #if defined (SYS_lstat)
551 syscall_table[SYS_lstat] = "lstat";
553 #if defined (SYS_lstat64)
554 syscall_table[SYS_lstat64] = "lstat64";
556 #if defined (SYS_lvldom)
557 syscall_table[SYS_lvldom] = "lvldom";
559 #if defined (SYS_lvlequal)
560 syscall_table[SYS_lvlequal] = "lvlequal";
562 #if defined (SYS_lvlfile)
563 syscall_table[SYS_lvlfile] = "lvlfile";
565 #if defined (SYS_lvlipc)
566 syscall_table[SYS_lvlipc] = "lvlipc";
568 #if defined (SYS_lvlproc)
569 syscall_table[SYS_lvlproc] = "lvlproc";
571 #if defined (SYS_lvlvfs)
572 syscall_table[SYS_lvlvfs] = "lvlvfs";
574 #if defined (SYS_lwp_alarm)
575 syscall_table[SYS_lwp_alarm] = "lwp_alarm";
577 #if defined (SYS_lwp_cond_broadcast)
578 syscall_table[SYS_lwp_cond_broadcast] = "lwp_cond_broadcast";
580 #if defined (SYS_lwp_cond_signal)
581 syscall_table[SYS_lwp_cond_signal] = "lwp_cond_signal";
583 #if defined (SYS_lwp_cond_wait)
584 syscall_table[SYS_lwp_cond_wait] = "lwp_cond_wait";
586 #if defined (SYS_lwp_continue)
587 syscall_table[SYS_lwp_continue] = "lwp_continue";
589 #if defined (SYS_lwp_create)
590 syscall_table[SYS_lwp_create] = "lwp_create";
592 #if defined (SYS_lwp_exit)
593 syscall_table[SYS_lwp_exit] = "lwp_exit";
595 #if defined (SYS_lwp_getprivate)
596 syscall_table[SYS_lwp_getprivate] = "lwp_getprivate";
598 #if defined (SYS_lwp_info)
599 syscall_table[SYS_lwp_info] = "lwp_info";
601 #if defined (SYS_lwp_kill)
602 syscall_table[SYS_lwp_kill] = "lwp_kill";
604 #if defined (SYS_lwp_mutex_init)
605 syscall_table[SYS_lwp_mutex_init] = "lwp_mutex_init";
607 #if defined (SYS_lwp_mutex_lock)
608 syscall_table[SYS_lwp_mutex_lock] = "lwp_mutex_lock";
610 #if defined (SYS_lwp_mutex_trylock)
611 syscall_table[SYS_lwp_mutex_trylock] = "lwp_mutex_trylock";
613 #if defined (SYS_lwp_mutex_unlock)
614 syscall_table[SYS_lwp_mutex_unlock] = "lwp_mutex_unlock";
616 #if defined (SYS_lwp_private)
617 syscall_table[SYS_lwp_private] = "lwp_private";
619 #if defined (SYS_lwp_self)
620 syscall_table[SYS_lwp_self] = "lwp_self";
622 #if defined (SYS_lwp_sema_post)
623 syscall_table[SYS_lwp_sema_post] = "lwp_sema_post";
625 #if defined (SYS_lwp_sema_trywait)
626 syscall_table[SYS_lwp_sema_trywait] = "lwp_sema_trywait";
628 #if defined (SYS_lwp_sema_wait)
629 syscall_table[SYS_lwp_sema_wait] = "lwp_sema_wait";
631 #if defined (SYS_lwp_setprivate)
632 syscall_table[SYS_lwp_setprivate] = "lwp_setprivate";
634 #if defined (SYS_lwp_sigredirect)
635 syscall_table[SYS_lwp_sigredirect] = "lwp_sigredirect";
637 #if defined (SYS_lwp_suspend)
638 syscall_table[SYS_lwp_suspend] = "lwp_suspend";
640 #if defined (SYS_lwp_wait)
641 syscall_table[SYS_lwp_wait] = "lwp_wait";
643 #if defined (SYS_lxstat)
644 syscall_table[SYS_lxstat] = "lxstat";
646 #if defined (SYS_madvise)
647 syscall_table[SYS_madvise] = "madvise";
649 #if defined (SYS_memcntl)
650 syscall_table[SYS_memcntl] = "memcntl";
652 #if defined (SYS_mincore)
653 syscall_table[SYS_mincore] = "mincore";
655 #if defined (SYS_mincore)
656 syscall_table[SYS_mincore] = "mincore";
658 #if defined (SYS_mkdir)
659 syscall_table[SYS_mkdir] = "mkdir";
661 #if defined (SYS_mkmld)
662 syscall_table[SYS_mkmld] = "mkmld";
664 #if defined (SYS_mknod)
665 syscall_table[SYS_mknod] = "mknod";
667 #if defined (SYS_mldmode)
668 syscall_table[SYS_mldmode] = "mldmode";
670 #if defined (SYS_mmap)
671 syscall_table[SYS_mmap] = "mmap";
673 #if defined (SYS_mmap64)
674 syscall_table[SYS_mmap64] = "mmap64";
676 #if defined (SYS_modadm)
677 syscall_table[SYS_modadm] = "modadm";
679 #if defined (SYS_modctl)
680 syscall_table[SYS_modctl] = "modctl";
682 #if defined (SYS_modload)
683 syscall_table[SYS_modload] = "modload";
685 #if defined (SYS_modpath)
686 syscall_table[SYS_modpath] = "modpath";
688 #if defined (SYS_modstat)
689 syscall_table[SYS_modstat] = "modstat";
691 #if defined (SYS_moduload)
692 syscall_table[SYS_moduload] = "moduload";
694 #if defined (SYS_mount)
695 syscall_table[SYS_mount] = "mount";
697 #if defined (SYS_mprotect)
698 syscall_table[SYS_mprotect] = "mprotect";
700 #if defined (SYS_mremap)
701 syscall_table[SYS_mremap] = "mremap";
703 #if defined (SYS_msfs_syscall)
704 syscall_table[SYS_msfs_syscall] = "msfs_syscall";
706 #if defined (SYS_msgctl)
707 syscall_table[SYS_msgctl] = "msgctl";
709 #if defined (SYS_msgget)
710 syscall_table[SYS_msgget] = "msgget";
712 #if defined (SYS_msgrcv)
713 syscall_table[SYS_msgrcv] = "msgrcv";
715 #if defined (SYS_msgsnd)
716 syscall_table[SYS_msgsnd] = "msgsnd";
718 #if defined (SYS_msgsys)
719 syscall_table[SYS_msgsys] = "msgsys";
721 #if defined (SYS_msleep)
722 syscall_table[SYS_msleep] = "msleep";
724 #if defined (SYS_msync)
725 syscall_table[SYS_msync] = "msync";
727 #if defined (SYS_munmap)
728 syscall_table[SYS_munmap] = "munmap";
730 #if defined (SYS_mvalid)
731 syscall_table[SYS_mvalid] = "mvalid";
733 #if defined (SYS_mwakeup)
734 syscall_table[SYS_mwakeup] = "mwakeup";
736 #if defined (SYS_naccept)
737 syscall_table[SYS_naccept] = "naccept";
739 #if defined (SYS_nanosleep)
740 syscall_table[SYS_nanosleep] = "nanosleep";
742 #if defined (SYS_nfssvc)
743 syscall_table[SYS_nfssvc] = "nfssvc";
745 #if defined (SYS_nfssys)
746 syscall_table[SYS_nfssys] = "nfssys";
748 #if defined (SYS_ngetpeername)
749 syscall_table[SYS_ngetpeername] = "ngetpeername";
751 #if defined (SYS_ngetsockname)
752 syscall_table[SYS_ngetsockname] = "ngetsockname";
754 #if defined (SYS_nice)
755 syscall_table[SYS_nice] = "nice";
757 #if defined (SYS_nrecvfrom)
758 syscall_table[SYS_nrecvfrom] = "nrecvfrom";
760 #if defined (SYS_nrecvmsg)
761 syscall_table[SYS_nrecvmsg] = "nrecvmsg";
763 #if defined (SYS_nsendmsg)
764 syscall_table[SYS_nsendmsg] = "nsendmsg";
766 #if defined (SYS_ntp_adjtime)
767 syscall_table[SYS_ntp_adjtime] = "ntp_adjtime";
769 #if defined (SYS_ntp_gettime)
770 syscall_table[SYS_ntp_gettime] = "ntp_gettime";
772 #if defined (SYS_nuname)
773 syscall_table[SYS_nuname] = "nuname";
775 #if defined (SYS_obreak)
776 syscall_table[SYS_obreak] = "obreak";
778 #if defined (SYS_old_accept)
779 syscall_table[SYS_old_accept] = "old_accept";
781 #if defined (SYS_old_fstat)
782 syscall_table[SYS_old_fstat] = "old_fstat";
784 #if defined (SYS_old_getpeername)
785 syscall_table[SYS_old_getpeername] = "old_getpeername";
787 #if defined (SYS_old_getpgrp)
788 syscall_table[SYS_old_getpgrp] = "old_getpgrp";
790 #if defined (SYS_old_getsockname)
791 syscall_table[SYS_old_getsockname] = "old_getsockname";
793 #if defined (SYS_old_killpg)
794 syscall_table[SYS_old_killpg] = "old_killpg";
796 #if defined (SYS_old_lstat)
797 syscall_table[SYS_old_lstat] = "old_lstat";
799 #if defined (SYS_old_recv)
800 syscall_table[SYS_old_recv] = "old_recv";
802 #if defined (SYS_old_recvfrom)
803 syscall_table[SYS_old_recvfrom] = "old_recvfrom";
805 #if defined (SYS_old_recvmsg)
806 syscall_table[SYS_old_recvmsg] = "old_recvmsg";
808 #if defined (SYS_old_send)
809 syscall_table[SYS_old_send] = "old_send";
811 #if defined (SYS_old_sendmsg)
812 syscall_table[SYS_old_sendmsg] = "old_sendmsg";
814 #if defined (SYS_old_sigblock)
815 syscall_table[SYS_old_sigblock] = "old_sigblock";
817 #if defined (SYS_old_sigsetmask)
818 syscall_table[SYS_old_sigsetmask] = "old_sigsetmask";
820 #if defined (SYS_old_sigvec)
821 syscall_table[SYS_old_sigvec] = "old_sigvec";
823 #if defined (SYS_old_stat)
824 syscall_table[SYS_old_stat] = "old_stat";
826 #if defined (SYS_old_vhangup)
827 syscall_table[SYS_old_vhangup] = "old_vhangup";
829 #if defined (SYS_old_wait)
830 syscall_table[SYS_old_wait] = "old_wait";
832 #if defined (SYS_oldquota)
833 syscall_table[SYS_oldquota] = "oldquota";
835 #if defined (SYS_online)
836 syscall_table[SYS_online] = "online";
838 #if defined (SYS_open)
839 syscall_table[SYS_open] = "open";
841 #if defined (SYS_open64)
842 syscall_table[SYS_open64] = "open64";
844 #if defined (SYS_ovadvise)
845 syscall_table[SYS_ovadvise] = "ovadvise";
847 #if defined (SYS_p_online)
848 syscall_table[SYS_p_online] = "p_online";
850 #if defined (SYS_pagelock)
851 syscall_table[SYS_pagelock] = "pagelock";
853 #if defined (SYS_pathconf)
854 syscall_table[SYS_pathconf] = "pathconf";
856 #if defined (SYS_pause)
857 syscall_table[SYS_pause] = "pause";
859 #if defined (SYS_pgrpsys)
860 syscall_table[SYS_pgrpsys] = "pgrpsys";
862 #if defined (SYS_pid_block)
863 syscall_table[SYS_pid_block] = "pid_block";
865 #if defined (SYS_pid_unblock)
866 syscall_table[SYS_pid_unblock] = "pid_unblock";
868 #if defined (SYS_pipe)
869 syscall_table[SYS_pipe] = "pipe";
871 #if defined (SYS_plock)
872 syscall_table[SYS_plock] = "plock";
874 #if defined (SYS_poll)
875 syscall_table[SYS_poll] = "poll";
877 #if defined (SYS_prctl)
878 syscall_table[SYS_prctl] = "prctl";
880 #if defined (SYS_pread)
881 syscall_table[SYS_pread] = "pread";
883 #if defined (SYS_pread64)
884 syscall_table[SYS_pread64] = "pread64";
886 #if defined (SYS_pread64)
887 syscall_table[SYS_pread64] = "pread64";
889 #if defined (SYS_prepblock)
890 syscall_table[SYS_prepblock] = "prepblock";
892 #if defined (SYS_priocntl)
893 syscall_table[SYS_priocntl] = "priocntl";
895 #if defined (SYS_priocntllst)
896 syscall_table[SYS_priocntllst] = "priocntllst";
898 #if defined (SYS_priocntlset)
899 syscall_table[SYS_priocntlset] = "priocntlset";
901 #if defined (SYS_priocntlsys)
902 syscall_table[SYS_priocntlsys] = "priocntlsys";
904 #if defined (SYS_procblk)
905 syscall_table[SYS_procblk] = "procblk";
907 #if defined (SYS_processor_bind)
908 syscall_table[SYS_processor_bind] = "processor_bind";
910 #if defined (SYS_processor_exbind)
911 syscall_table[SYS_processor_exbind] = "processor_exbind";
913 #if defined (SYS_processor_info)
914 syscall_table[SYS_processor_info] = "processor_info";
916 #if defined (SYS_procpriv)
917 syscall_table[SYS_procpriv] = "procpriv";
919 #if defined (SYS_profil)
920 syscall_table[SYS_profil] = "profil";
922 #if defined (SYS_proplist_syscall)
923 syscall_table[SYS_proplist_syscall] = "proplist_syscall";
925 #if defined (SYS_pset)
926 syscall_table[SYS_pset] = "pset";
928 #if defined (SYS_ptrace)
929 syscall_table[SYS_ptrace] = "ptrace";
931 #if defined (SYS_putmsg)
932 syscall_table[SYS_putmsg] = "putmsg";
934 #if defined (SYS_putpmsg)
935 syscall_table[SYS_putpmsg] = "putpmsg";
937 #if defined (SYS_pwrite)
938 syscall_table[SYS_pwrite] = "pwrite";
940 #if defined (SYS_pwrite64)
941 syscall_table[SYS_pwrite64] = "pwrite64";
943 #if defined (SYS_quotactl)
944 syscall_table[SYS_quotactl] = "quotactl";
946 #if defined (SYS_rdblock)
947 syscall_table[SYS_rdblock] = "rdblock";
949 #if defined (SYS_read)
950 syscall_table[SYS_read] = "read";
952 #if defined (SYS_readlink)
953 syscall_table[SYS_readlink] = "readlink";
955 #if defined (SYS_readv)
956 syscall_table[SYS_readv] = "readv";
958 #if defined (SYS_reboot)
959 syscall_table[SYS_reboot] = "reboot";
961 #if defined (SYS_recv)
962 syscall_table[SYS_recv] = "recv";
964 #if defined (SYS_recvfrom)
965 syscall_table[SYS_recvfrom] = "recvfrom";
967 #if defined (SYS_recvmsg)
968 syscall_table[SYS_recvmsg] = "recvmsg";
970 #if defined (SYS_rename)
971 syscall_table[SYS_rename] = "rename";
973 #if defined (SYS_resolvepath)
974 syscall_table[SYS_resolvepath] = "resolvepath";
976 #if defined (SYS_revoke)
977 syscall_table[SYS_revoke] = "revoke";
979 #if defined (SYS_rfsys)
980 syscall_table[SYS_rfsys] = "rfsys";
982 #if defined (SYS_rmdir)
983 syscall_table[SYS_rmdir] = "rmdir";
985 #if defined (SYS_rpcsys)
986 syscall_table[SYS_rpcsys] = "rpcsys";
988 #if defined (SYS_sbrk)
989 syscall_table[SYS_sbrk] = "sbrk";
991 #if defined (SYS_schedctl)
992 syscall_table[SYS_schedctl] = "schedctl";
994 #if defined (SYS_secadvise)
995 syscall_table[SYS_secadvise] = "secadvise";
997 #if defined (SYS_secsys)
998 syscall_table[SYS_secsys] = "secsys";
1000 #if defined (SYS_security)
1001 syscall_table[SYS_security] = "security";
1003 #if defined (SYS_select)
1004 syscall_table[SYS_select] = "select";
1006 #if defined (SYS_semctl)
1007 syscall_table[SYS_semctl] = "semctl";
1009 #if defined (SYS_semget)
1010 syscall_table[SYS_semget] = "semget";
1012 #if defined (SYS_semop)
1013 syscall_table[SYS_semop] = "semop";
1015 #if defined (SYS_semsys)
1016 syscall_table[SYS_semsys] = "semsys";
1018 #if defined (SYS_send)
1019 syscall_table[SYS_send] = "send";
1021 #if defined (SYS_sendmsg)
1022 syscall_table[SYS_sendmsg] = "sendmsg";
1024 #if defined (SYS_sendto)
1025 syscall_table[SYS_sendto] = "sendto";
1027 #if defined (SYS_set_program_attributes)
1028 syscall_table[SYS_set_program_attributes] = "set_program_attributes";
1030 #if defined (SYS_set_speculative)
1031 syscall_table[SYS_set_speculative] = "set_speculative";
1033 #if defined (SYS_set_sysinfo)
1034 syscall_table[SYS_set_sysinfo] = "set_sysinfo";
1036 #if defined (SYS_setcontext)
1037 syscall_table[SYS_setcontext] = "setcontext";
1039 #if defined (SYS_setdomainname)
1040 syscall_table[SYS_setdomainname] = "setdomainname";
1042 #if defined (SYS_setegid)
1043 syscall_table[SYS_setegid] = "setegid";
1045 #if defined (SYS_seteuid)
1046 syscall_table[SYS_seteuid] = "seteuid";
1048 #if defined (SYS_setgid)
1049 syscall_table[SYS_setgid] = "setgid";
1051 #if defined (SYS_setgroups)
1052 syscall_table[SYS_setgroups] = "setgroups";
1054 #if defined (SYS_sethostid)
1055 syscall_table[SYS_sethostid] = "sethostid";
1057 #if defined (SYS_sethostname)
1058 syscall_table[SYS_sethostname] = "sethostname";
1060 #if defined (SYS_setitimer)
1061 syscall_table[SYS_setitimer] = "setitimer";
1063 #if defined (SYS_setlogin)
1064 syscall_table[SYS_setlogin] = "setlogin";
1066 #if defined (SYS_setpgid)
1067 syscall_table[SYS_setpgid] = "setpgid";
1069 #if defined (SYS_setpgrp)
1070 syscall_table[SYS_setpgrp] = "setpgrp";
1072 #if defined (SYS_setpriority)
1073 syscall_table[SYS_setpriority] = "setpriority";
1075 #if defined (SYS_setregid)
1076 syscall_table[SYS_setregid] = "setregid";
1078 #if defined (SYS_setreuid)
1079 syscall_table[SYS_setreuid] = "setreuid";
1081 #if defined (SYS_setrlimit)
1082 syscall_table[SYS_setrlimit] = "setrlimit";
1084 #if defined (SYS_setrlimit64)
1085 syscall_table[SYS_setrlimit64] = "setrlimit64";
1087 #if defined (SYS_setsid)
1088 syscall_table[SYS_setsid] = "setsid";
1090 #if defined (SYS_setsockopt)
1091 syscall_table[SYS_setsockopt] = "setsockopt";
1093 #if defined (SYS_settimeofday)
1094 syscall_table[SYS_settimeofday] = "settimeofday";
1096 #if defined (SYS_setuid)
1097 syscall_table[SYS_setuid] = "setuid";
1099 #if defined (SYS_sgi)
1100 syscall_table[SYS_sgi] = "sgi";
1102 #if defined (SYS_sgifastpath)
1103 syscall_table[SYS_sgifastpath] = "sgifastpath";
1105 #if defined (SYS_sgikopt)
1106 syscall_table[SYS_sgikopt] = "sgikopt";
1108 #if defined (SYS_sginap)
1109 syscall_table[SYS_sginap] = "sginap";
1111 #if defined (SYS_shmat)
1112 syscall_table[SYS_shmat] = "shmat";
1114 #if defined (SYS_shmctl)
1115 syscall_table[SYS_shmctl] = "shmctl";
1117 #if defined (SYS_shmdt)
1118 syscall_table[SYS_shmdt] = "shmdt";
1120 #if defined (SYS_shmget)
1121 syscall_table[SYS_shmget] = "shmget";
1123 #if defined (SYS_shmsys)
1124 syscall_table[SYS_shmsys] = "shmsys";
1126 #if defined (SYS_shutdown)
1127 syscall_table[SYS_shutdown] = "shutdown";
1129 #if defined (SYS_sigaction)
1130 syscall_table[SYS_sigaction] = "sigaction";
1132 #if defined (SYS_sigaltstack)
1133 syscall_table[SYS_sigaltstack] = "sigaltstack";
1135 #if defined (SYS_sigaltstack)
1136 syscall_table[SYS_sigaltstack] = "sigaltstack";
1138 #if defined (SYS_sigblock)
1139 syscall_table[SYS_sigblock] = "sigblock";
1141 #if defined (SYS_signal)
1142 syscall_table[SYS_signal] = "signal";
1144 #if defined (SYS_signotify)
1145 syscall_table[SYS_signotify] = "signotify";
1147 #if defined (SYS_signotifywait)
1148 syscall_table[SYS_signotifywait] = "signotifywait";
1150 #if defined (SYS_sigpending)
1151 syscall_table[SYS_sigpending] = "sigpending";
1153 #if defined (SYS_sigpoll)
1154 syscall_table[SYS_sigpoll] = "sigpoll";
1156 #if defined (SYS_sigprocmask)
1157 syscall_table[SYS_sigprocmask] = "sigprocmask";
1159 #if defined (SYS_sigqueue)
1160 syscall_table[SYS_sigqueue] = "sigqueue";
1162 #if defined (SYS_sigreturn)
1163 syscall_table[SYS_sigreturn] = "sigreturn";
1165 #if defined (SYS_sigsendset)
1166 syscall_table[SYS_sigsendset] = "sigsendset";
1168 #if defined (SYS_sigsendsys)
1169 syscall_table[SYS_sigsendsys] = "sigsendsys";
1171 #if defined (SYS_sigsetmask)
1172 syscall_table[SYS_sigsetmask] = "sigsetmask";
1174 #if defined (SYS_sigstack)
1175 syscall_table[SYS_sigstack] = "sigstack";
1177 #if defined (SYS_sigsuspend)
1178 syscall_table[SYS_sigsuspend] = "sigsuspend";
1180 #if defined (SYS_sigvec)
1181 syscall_table[SYS_sigvec] = "sigvec";
1183 #if defined (SYS_sigwait)
1184 syscall_table[SYS_sigwait] = "sigwait";
1186 #if defined (SYS_sigwaitprim)
1187 syscall_table[SYS_sigwaitprim] = "sigwaitprim";
1189 #if defined (SYS_sleep)
1190 syscall_table[SYS_sleep] = "sleep";
1192 #if defined (SYS_so_socket)
1193 syscall_table[SYS_so_socket] = "so_socket";
1195 #if defined (SYS_so_socketpair)
1196 syscall_table[SYS_so_socketpair] = "so_socketpair";
1198 #if defined (SYS_sockconfig)
1199 syscall_table[SYS_sockconfig] = "sockconfig";
1201 #if defined (SYS_socket)
1202 syscall_table[SYS_socket] = "socket";
1204 #if defined (SYS_socketpair)
1205 syscall_table[SYS_socketpair] = "socketpair";
1207 #if defined (SYS_sproc)
1208 syscall_table[SYS_sproc] = "sproc";
1210 #if defined (SYS_sprocsp)
1211 syscall_table[SYS_sprocsp] = "sprocsp";
1213 #if defined (SYS_sstk)
1214 syscall_table[SYS_sstk] = "sstk";
1216 #if defined (SYS_stat)
1217 syscall_table[SYS_stat] = "stat";
1219 #if defined (SYS_stat64)
1220 syscall_table[SYS_stat64] = "stat64";
1222 #if defined (SYS_statfs)
1223 syscall_table[SYS_statfs] = "statfs";
1225 #if defined (SYS_statvfs)
1226 syscall_table[SYS_statvfs] = "statvfs";
1228 #if defined (SYS_statvfs64)
1229 syscall_table[SYS_statvfs64] = "statvfs64";
1231 #if defined (SYS_stime)
1232 syscall_table[SYS_stime] = "stime";
1234 #if defined (SYS_stty)
1235 syscall_table[SYS_stty] = "stty";
1237 #if defined (SYS_subsys_info)
1238 syscall_table[SYS_subsys_info] = "subsys_info";
1240 #if defined (SYS_swapctl)
1241 syscall_table[SYS_swapctl] = "swapctl";
1243 #if defined (SYS_swapon)
1244 syscall_table[SYS_swapon] = "swapon";
1246 #if defined (SYS_symlink)
1247 syscall_table[SYS_symlink] = "symlink";
1249 #if defined (SYS_sync)
1250 syscall_table[SYS_sync] = "sync";
1252 #if defined (SYS_sys3b)
1253 syscall_table[SYS_sys3b] = "sys3b";
1255 #if defined (SYS_syscall)
1256 syscall_table[SYS_syscall] = "syscall";
1258 #if defined (SYS_sysconfig)
1259 syscall_table[SYS_sysconfig] = "sysconfig";
1261 #if defined (SYS_sysfs)
1262 syscall_table[SYS_sysfs] = "sysfs";
1264 #if defined (SYS_sysi86)
1265 syscall_table[SYS_sysi86] = "sysi86";
1267 #if defined (SYS_sysinfo)
1268 syscall_table[SYS_sysinfo] = "sysinfo";
1270 #if defined (SYS_sysmips)
1271 syscall_table[SYS_sysmips] = "sysmips";
1273 #if defined (SYS_syssun)
1274 syscall_table[SYS_syssun] = "syssun";
1276 #if defined (SYS_systeminfo)
1277 syscall_table[SYS_systeminfo] = "systeminfo";
1279 #if defined (SYS_table)
1280 syscall_table[SYS_table] = "table";
1282 #if defined (SYS_time)
1283 syscall_table[SYS_time] = "time";
1285 #if defined (SYS_timedwait)
1286 syscall_table[SYS_timedwait] = "timedwait";
1288 #if defined (SYS_timer_create)
1289 syscall_table[SYS_timer_create] = "timer_create";
1291 #if defined (SYS_timer_delete)
1292 syscall_table[SYS_timer_delete] = "timer_delete";
1294 #if defined (SYS_timer_getoverrun)
1295 syscall_table[SYS_timer_getoverrun] = "timer_getoverrun";
1297 #if defined (SYS_timer_gettime)
1298 syscall_table[SYS_timer_gettime] = "timer_gettime";
1300 #if defined (SYS_timer_settime)
1301 syscall_table[SYS_timer_settime] = "timer_settime";
1303 #if defined (SYS_times)
1304 syscall_table[SYS_times] = "times";
1306 #if defined (SYS_truncate)
1307 syscall_table[SYS_truncate] = "truncate";
1309 #if defined (SYS_truncate64)
1310 syscall_table[SYS_truncate64] = "truncate64";
1312 #if defined (SYS_tsolsys)
1313 syscall_table[SYS_tsolsys] = "tsolsys";
1315 #if defined (SYS_uadmin)
1316 syscall_table[SYS_uadmin] = "uadmin";
1318 #if defined (SYS_ulimit)
1319 syscall_table[SYS_ulimit] = "ulimit";
1321 #if defined (SYS_umask)
1322 syscall_table[SYS_umask] = "umask";
1324 #if defined (SYS_umount)
1325 syscall_table[SYS_umount] = "umount";
1327 #if defined (SYS_uname)
1328 syscall_table[SYS_uname] = "uname";
1330 #if defined (SYS_unblock)
1331 syscall_table[SYS_unblock] = "unblock";
1333 #if defined (SYS_unlink)
1334 syscall_table[SYS_unlink] = "unlink";
1336 #if defined (SYS_unmount)
1337 syscall_table[SYS_unmount] = "unmount";
1339 #if defined (SYS_usleep_thread)
1340 syscall_table[SYS_usleep_thread] = "usleep_thread";
1342 #if defined (SYS_uswitch)
1343 syscall_table[SYS_uswitch] = "uswitch";
1345 #if defined (SYS_utc_adjtime)
1346 syscall_table[SYS_utc_adjtime] = "utc_adjtime";
1348 #if defined (SYS_utc_gettime)
1349 syscall_table[SYS_utc_gettime] = "utc_gettime";
1351 #if defined (SYS_utime)
1352 syscall_table[SYS_utime] = "utime";
1354 #if defined (SYS_utimes)
1355 syscall_table[SYS_utimes] = "utimes";
1357 #if defined (SYS_utssys)
1358 syscall_table[SYS_utssys] = "utssys";
1360 #if defined (SYS_vfork)
1361 syscall_table[SYS_vfork] = "vfork";
1363 #if defined (SYS_vhangup)
1364 syscall_table[SYS_vhangup] = "vhangup";
1366 #if defined (SYS_vtrace)
1367 syscall_table[SYS_vtrace] = "vtrace";
1369 #if defined (SYS_wait)
1370 syscall_table[SYS_wait] = "wait";
1372 #if defined (SYS_waitid)
1373 syscall_table[SYS_waitid] = "waitid";
1375 #if defined (SYS_waitsys)
1376 syscall_table[SYS_waitsys] = "waitsys";
1378 #if defined (SYS_write)
1379 syscall_table[SYS_write] = "write";
1381 #if defined (SYS_writev)
1382 syscall_table[SYS_writev] = "writev";
1384 #if defined (SYS_xenix)
1385 syscall_table[SYS_xenix] = "xenix";
1387 #if defined (SYS_xmknod)
1388 syscall_table[SYS_xmknod] = "xmknod";
1390 #if defined (SYS_xstat)
1391 syscall_table[SYS_xstat] = "xstat";
1393 #if defined (SYS_yield)
1394 syscall_table[SYS_yield] = "yield";
1399 * Prettyprint a single syscall by number.
1403 proc_prettyfprint_syscall (FILE *file, int num, int verbose)
1405 if (syscall_table[num])
1406 fprintf (file, "SYS_%s ", syscall_table[num]);
1408 fprintf (file, "<Unknown syscall %d> ", num);
1412 proc_prettyprint_syscall (int num, int verbose)
1414 proc_prettyfprint_syscall (stdout, num, verbose);
1418 * Prettyprint all of the syscalls in a sysset_t set.
1422 proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, int verbose)
1426 for (i = 0; i < MAX_SYSCALLS; i++)
1427 if (prismember (sysset, i))
1429 proc_prettyfprint_syscall (file, i, verbose);
1431 fprintf (file, "\n");
1435 proc_prettyprint_syscalls (sysset_t *sysset, int verbose)
1437 proc_prettyfprint_syscalls (stdout, sysset, verbose);
1440 /* FIXME: add real-time signals */
1442 static struct trans signal_table[] =
1444 { 0, "<no signal>", "no signal" },
1446 { SIGHUP, "SIGHUP", "Hangup" },
1449 { SIGINT, "SIGINT", "Interrupt (rubout)" },
1452 { SIGQUIT, "SIGQUIT", "Quit (ASCII FS)" },
1455 { SIGILL, "SIGILL", "Illegal instruction" }, /* not reset when caught */
1458 { SIGTRAP, "SIGTRAP", "Trace trap" }, /* not reset when caught */
1461 { SIGABRT, "SIGABRT", "used by abort()" }, /* replaces SIGIOT */
1464 { SIGIOT, "SIGIOT", "IOT instruction" },
1467 { SIGEMT, "SIGEMT", "EMT instruction" },
1470 { SIGFPE, "SIGFPE", "Floating point exception" },
1473 { SIGKILL, "SIGKILL", "Kill" }, /* Solaris: cannot be caught/ignored */
1476 { SIGBUS, "SIGBUS", "Bus error" },
1479 { SIGSEGV, "SIGSEGV", "Segmentation violation" },
1482 { SIGSYS, "SIGSYS", "Bad argument to system call" },
1485 { SIGPIPE, "SIGPIPE", "Write to pipe with no one to read it" },
1488 { SIGALRM, "SIGALRM", "Alarm clock" },
1491 { SIGTERM, "SIGTERM", "Software termination signal from kill" },
1494 { SIGUSR1, "SIGUSR1", "User defined signal 1" },
1497 { SIGUSR2, "SIGUSR2", "User defined signal 2" },
1500 { SIGCHLD, "SIGCHLD", "Child status changed" }, /* Posix version */
1503 { SIGCLD, "SIGCLD", "Child status changed" }, /* Solaris version */
1506 { SIGPWR, "SIGPWR", "Power-fail restart" },
1509 { SIGWINCH, "SIGWINCH", "Window size change" },
1512 { SIGURG, "SIGURG", "Urgent socket condition" },
1515 { SIGPOLL, "SIGPOLL", "Pollable event" },
1518 { SIGIO, "SIGIO", "Socket I/O possible" }, /* alias for SIGPOLL */
1521 { SIGSTOP, "SIGSTOP", "Stop, not from tty" }, /* cannot be caught or ignored */
1524 { SIGTSTP, "SIGTSTP", "User stop from tty" },
1527 { SIGCONT, "SIGCONT", "Stopped process has been continued" },
1530 { SIGTTIN, "SIGTTIN", "Background tty read attempted" },
1533 { SIGTTOU, "SIGTTOU", "Background tty write attempted" },
1536 { SIGVTALRM, "SIGVTALRM", "Virtual timer expired" },
1539 { SIGPROF, "SIGPROF", "Profiling timer expired" },
1542 { SIGXCPU, "SIGXCPU", "Exceeded CPU limit" },
1545 { SIGXFSZ, "SIGXFSZ", "Exceeded file size limit" },
1548 { SIGWAITING, "SIGWAITING", "Process's LWPs are blocked" },
1551 { SIGLWP, "SIGLWP", "Used by thread library" },
1554 { SIGFREEZE, "SIGFREEZE", "Used by CPR" },
1557 { SIGTHAW, "SIGTHAW", "Used by CPR" },
1560 { SIGCANCEL, "SIGCANCEL", "Used by libthread" },
1563 { SIGLOST, "SIGLOST", "Resource lost" },
1566 { SIG32, "SIG32", "Reserved for kernel usage (Irix)" },
1569 { SIGPTINTR, "SIGPTINTR", "Posix 1003.1b" },
1572 { SIGTRESCHED, "SIGTRESCHED", "Posix 1003.1b" },
1575 { SIGINFO, "SIGINFO", "Information request" },
1578 { SIGRESV, "SIGRESV", "Reserved by Digital for future use" },
1581 { SIGAIO, "SIGAIO", "Asynchronous I/O signal" },
1586 * Prettyprint a single signal by number.
1587 * Accepts a signal number and finds it in the signal table,
1588 * then pretty-prints it.
1592 proc_prettyfprint_signal (FILE *file, int signo, int verbose)
1596 for (i = 0; i < sizeof (signal_table) / sizeof (signal_table[0]); i++)
1597 if (signo == signal_table[i].value)
1599 fprintf (file, "%s", signal_table[i].name);
1601 fprintf (file, ": %s\n", signal_table[i].desc);
1603 fprintf (file, " ");
1606 fprintf (file, "Unknown signal %d%c", signo, verbose ? '\n' : ' ');
1610 proc_prettyprint_signal (int signo, int verbose)
1612 proc_prettyfprint_signal (stdout, signo, verbose);
1616 * Prettyprint all of the signals in a sigset_t set.
1618 * This function loops over all signal numbers from 0 to NSIG,
1619 * uses them as indexes for prismember, and prints them pretty.
1621 * It does not loop over the signal table, as is done with the
1622 * fault table, because the signal table may contain aliases.
1623 * If it did, both aliases would be printed.
1627 proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose)
1631 for (i = 0; i < NSIG; i++)
1632 if (prismember (sigset, i))
1633 proc_prettyfprint_signal (file, i, verbose);
1636 fprintf (file, "\n");
1640 proc_prettyprint_signalset (sigset_t *sigset, int verbose)
1642 proc_prettyfprint_signalset (stdout, sigset, verbose);
1645 /* Hardware fault translation table. */
1647 static struct trans fault_table[] =
1649 #if defined (FLTILL)
1650 { FLTILL, "FLTILL", "Illegal instruction" },
1652 #if defined (FLTPRIV)
1653 { FLTPRIV, "FLTPRIV", "Privileged instruction" },
1655 #if defined (FLTBPT)
1656 { FLTBPT, "FLTBPT", "Breakpoint trap" },
1658 #if defined (FLTTRACE)
1659 { FLTTRACE, "FLTTRACE", "Trace trap" },
1661 #if defined (FLTACCESS)
1662 { FLTACCESS, "FLTACCESS", "Memory access fault" },
1664 #if defined (FLTBOUNDS)
1665 { FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation" },
1667 #if defined (FLTIOVF)
1668 { FLTIOVF, "FLTIOVF", "Integer overflow" },
1670 #if defined (FLTIZDIV)
1671 { FLTIZDIV, "FLTIZDIV", "Integer zero divide" },
1673 #if defined (FLTFPE)
1674 { FLTFPE, "FLTFPE", "Floating-point exception" },
1676 #if defined (FLTSTACK)
1677 { FLTSTACK, "FLTSTACK", "Unrecoverable stack fault" },
1679 #if defined (FLTPAGE)
1680 { FLTPAGE, "FLTPAGE", "Recoverable page fault" },
1682 #if defined (FLTPCINVAL)
1683 { FLTPCINVAL, "FLTPCINVAL", "Invalid PC exception" },
1685 #if defined (FLTWATCH)
1686 { FLTWATCH, "FLTWATCH", "User watchpoint" },
1688 #if defined (FLTKWATCH)
1689 { FLTKWATCH, "FLTKWATCH", "Kernel watchpoint" },
1691 #if defined (FLTSCWATCH)
1692 { FLTSCWATCH, "FLTSCWATCH", "Hit a store conditional on a watched page" },
1697 * Work horse. Accepts an index into the fault table, prints it pretty.
1701 prettyfprint_faulttable_entry (FILE *file, int i, int verbose)
1703 fprintf (file, "%s", fault_table[i].name);
1705 fprintf (file, ": %s\n", fault_table[i].desc);
1707 fprintf (file, " ");
1711 * Prettyprint a hardware fault by number.
1715 proc_prettyfprint_fault (FILE *file, int faultno, int verbose)
1719 for (i = 0; i < sizeof (fault_table) / sizeof (fault_table[0]); i++)
1720 if (faultno == fault_table[i].value)
1722 prettyfprint_faulttable_entry (file, i, verbose);
1726 fprintf (file, "Unknown hardware fault %d%c",
1727 faultno, verbose ? '\n' : ' ');
1731 proc_prettyprint_fault (int faultno, int verbose)
1733 proc_prettyfprint_fault (stdout, faultno, verbose);
1737 * Prettyprint all the faults in a fltset_t set.
1739 * This function loops thru the fault table,
1740 * using the value field as the index to prismember.
1741 * The fault table had better not contain aliases,
1742 * for if it does they will both be printed.
1746 proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, int verbose)
1750 for (i = 0; i < sizeof (fault_table) / sizeof (fault_table[0]); i++)
1751 if (prismember (fltset, fault_table[i].value))
1752 prettyfprint_faulttable_entry (file, i, verbose);
1755 fprintf (file, "\n");
1759 proc_prettyprint_faultset (fltset_t *fltset, int verbose)
1761 proc_prettyfprint_faultset (stdout, fltset, verbose);
1765 * Todo: actions, holds...
1769 proc_prettyprint_actionset (struct sigaction *actions, int verbose)
1774 _initialize_proc_events (void)
1776 init_syscall_table ();