gdb/proc-events.c - gdb

Global variables defined

Data types defined

Functions defined

Macros defined

Source code

  1. /* Machine-independent support for SVR4 /proc (process file system)

  2.    Copyright (C) 1999-2015 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.

  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 3 of the License, or
  8.    (at your option) any later version.

  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.

  13.    You should have received a copy of the GNU General Public License
  14.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  15. /* Pretty-print "events of interest".

  16.    This module includes pretty-print routines for:
  17.    * faults (hardware exceptions)
  18.    * signals (software interrupts)
  19.    * syscalls

  20.    FIXME: At present, the syscall translation table must be
  21.    initialized, which is not true of the other translation tables.  */

  22. #include "defs.h"

  23. #ifdef NEW_PROC_API
  24. #define _STRUCTURED_PROC 1
  25. #endif

  26. #include <sys/types.h>
  27. #include <sys/procfs.h>
  28. #ifdef HAVE_SYS_SYSCALL_H
  29. #include <sys/syscall.h>
  30. #endif
  31. #ifdef HAVE_SYS_FAULT_H
  32. #include <sys/fault.h>
  33. #endif

  34. #include "proc-utils.h"

  35. /* Much of the information used in the /proc interface, particularly
  36.    for printing status information, is kept as tables of structures of
  37.    the following form.  These tables can be used to map numeric values
  38.    to their symbolic names and to a string that describes their
  39.    specific use.  */

  40. struct trans
  41. {
  42.   int value;                    /* The numeric value.  */
  43.   char *name;                   /* The equivalent symbolic value.  */
  44.   char *desc;                   /* Short description of value.  */
  45. };


  46. /* Pretty print syscalls.  */

  47. /* Syscall translation table.  */

  48. #define MAX_SYSCALLS 262        /* Pretty arbitrary.  */
  49. static char *syscall_table[MAX_SYSCALLS];

  50. static void
  51. init_syscall_table (void)
  52. {
  53. #ifdef SYS_BSD_getime
  54.   syscall_table[SYS_BSD_getime] = "BSD_getime";
  55. #endif
  56. #ifdef SYS_BSDgetpgrp
  57.   syscall_table[SYS_BSDgetpgrp] = "BSDgetpgrp";
  58. #endif
  59. #ifdef SYS_BSDsetpgrp
  60.   syscall_table[SYS_BSDsetpgrp] = "BSDsetpgrp";
  61. #endif
  62. #ifdef SYS_acancel
  63.   syscall_table[SYS_acancel] = "acancel";
  64. #endif
  65. #ifdef SYS_accept
  66.   syscall_table[SYS_accept] = "accept";
  67. #endif
  68. #ifdef SYS_access
  69.   syscall_table[SYS_access] = "access";
  70. #endif
  71. #ifdef SYS_acct
  72.   syscall_table[SYS_acct] = "acct";
  73. #endif
  74. #ifdef SYS_acl
  75.   syscall_table[SYS_acl] = "acl";
  76. #endif
  77. #ifdef SYS_aclipc
  78.   syscall_table[SYS_aclipc] = "aclipc";
  79. #endif
  80. #ifdef SYS_adjtime
  81.   syscall_table[SYS_adjtime] = "adjtime";
  82. #endif
  83. #ifdef SYS_afs_syscall
  84.   syscall_table[SYS_afs_syscall] = "afs_syscall";
  85. #endif
  86. #ifdef SYS_alarm
  87.   syscall_table[SYS_alarm] = "alarm";
  88. #endif
  89. #ifdef SYS_alt_plock
  90.   syscall_table[SYS_alt_plock] = "alt_plock";
  91. #endif
  92. #ifdef SYS_alt_sigpending
  93.   syscall_table[SYS_alt_sigpending] = "alt_sigpending";
  94. #endif
  95. #ifdef SYS_async
  96.   syscall_table[SYS_async] = "async";
  97. #endif
  98. #ifdef SYS_async_daemon
  99.   syscall_table[SYS_async_daemon] = "async_daemon";
  100. #endif
  101. #ifdef SYS_audcntl
  102.   syscall_table[SYS_audcntl] = "audcntl";
  103. #endif
  104. #ifdef SYS_audgen
  105.   syscall_table[SYS_audgen] = "audgen";
  106. #endif
  107. #ifdef SYS_auditbuf
  108.   syscall_table[SYS_auditbuf] = "auditbuf";
  109. #endif
  110. #ifdef SYS_auditctl
  111.   syscall_table[SYS_auditctl] = "auditctl";
  112. #endif
  113. #ifdef SYS_auditdmp
  114.   syscall_table[SYS_auditdmp] = "auditdmp";
  115. #endif
  116. #ifdef SYS_auditevt
  117.   syscall_table[SYS_auditevt] = "auditevt";
  118. #endif
  119. #ifdef SYS_auditlog
  120.   syscall_table[SYS_auditlog] = "auditlog";
  121. #endif
  122. #ifdef SYS_auditsys
  123.   syscall_table[SYS_auditsys] = "auditsys";
  124. #endif
  125. #ifdef SYS_bind
  126.   syscall_table[SYS_bind] = "bind";
  127. #endif
  128. #ifdef SYS_block
  129.   syscall_table[SYS_block] = "block";
  130. #endif
  131. #ifdef SYS_brk
  132.   syscall_table[SYS_brk] = "brk";
  133. #endif
  134. #ifdef SYS_cachectl
  135.   syscall_table[SYS_cachectl] = "cachectl";
  136. #endif
  137. #ifdef SYS_cacheflush
  138.   syscall_table[SYS_cacheflush] = "cacheflush";
  139. #endif
  140. #ifdef SYS_cancelblock
  141.   syscall_table[SYS_cancelblock] = "cancelblock";
  142. #endif
  143. #ifdef SYS_cg_bind
  144.   syscall_table[SYS_cg_bind] = "cg_bind";
  145. #endif
  146. #ifdef SYS_cg_current
  147.   syscall_table[SYS_cg_current] = "cg_current";
  148. #endif
  149. #ifdef SYS_cg_ids
  150.   syscall_table[SYS_cg_ids] = "cg_ids";
  151. #endif
  152. #ifdef SYS_cg_info
  153.   syscall_table[SYS_cg_info] = "cg_info";
  154. #endif
  155. #ifdef SYS_cg_memloc
  156.   syscall_table[SYS_cg_memloc] = "cg_memloc";
  157. #endif
  158. #ifdef SYS_cg_processors
  159.   syscall_table[SYS_cg_processors] = "cg_processors";
  160. #endif
  161. #ifdef SYS_chdir
  162.   syscall_table[SYS_chdir] = "chdir";
  163. #endif
  164. #ifdef SYS_chflags
  165.   syscall_table[SYS_chflags] = "chflags";
  166. #endif
  167. #ifdef SYS_chmod
  168.   syscall_table[SYS_chmod] = "chmod";
  169. #endif
  170. #ifdef SYS_chown
  171.   syscall_table[SYS_chown] = "chown";
  172. #endif
  173. #ifdef SYS_chroot
  174.   syscall_table[SYS_chroot] = "chroot";
  175. #endif
  176. #ifdef SYS_clocal
  177.   syscall_table[SYS_clocal] = "clocal";
  178. #endif
  179. #ifdef SYS_clock_getres
  180.   syscall_table[SYS_clock_getres] = "clock_getres";
  181. #endif
  182. #ifdef SYS_clock_gettime
  183.   syscall_table[SYS_clock_gettime] = "clock_gettime";
  184. #endif
  185. #ifdef SYS_clock_settime
  186.   syscall_table[SYS_clock_settime] = "clock_settime";
  187. #endif
  188. #ifdef SYS_close
  189.   syscall_table[SYS_close] = "close";
  190. #endif
  191. #ifdef SYS_connect
  192.   syscall_table[SYS_connect] = "connect";
  193. #endif
  194. #ifdef SYS_context
  195.   syscall_table[SYS_context] = "context";
  196. #endif
  197. #ifdef SYS_creat
  198.   syscall_table[SYS_creat] = "creat";
  199. #endif
  200. #ifdef SYS_creat64
  201.   syscall_table[SYS_creat64] = "creat64";
  202. #endif
  203. #ifdef SYS_devstat
  204.   syscall_table[SYS_devstat] = "devstat";
  205. #endif
  206. #ifdef SYS_dmi
  207.   syscall_table[SYS_dmi] = "dmi";
  208. #endif
  209. #ifdef SYS_door
  210.   syscall_table[SYS_door] = "door";
  211. #endif
  212. #ifdef SYS_dshmsys
  213.   syscall_table[SYS_dshmsys] = "dshmsys";
  214. #endif
  215. #ifdef SYS_dup
  216.   syscall_table[SYS_dup] = "dup";
  217. #endif
  218. #ifdef SYS_dup2
  219.   syscall_table[SYS_dup2] = "dup2";
  220. #endif
  221. #ifdef SYS_evsys
  222.   syscall_table[SYS_evsys] = "evsys";
  223. #endif
  224. #ifdef SYS_evtrapret
  225.   syscall_table[SYS_evtrapret] = "evtrapret";
  226. #endif
  227. #ifdef SYS_exec
  228.   syscall_table[SYS_exec] = "exec";
  229. #endif
  230. #ifdef SYS_exec_with_loader
  231.   syscall_table[SYS_exec_with_loader] = "exec_with_loader";
  232. #endif
  233. #ifdef SYS_execv
  234.   syscall_table[SYS_execv] = "execv";
  235. #endif
  236. #ifdef SYS_execve
  237.   syscall_table[SYS_execve] = "execve";
  238. #endif
  239. #ifdef SYS_exit
  240.   syscall_table[SYS_exit] = "exit";
  241. #endif
  242. #ifdef SYS_exportfs
  243.   syscall_table[SYS_exportfs] = "exportfs";
  244. #endif
  245. #ifdef SYS_facl
  246.   syscall_table[SYS_facl] = "facl";
  247. #endif
  248. #ifdef SYS_fchdir
  249.   syscall_table[SYS_fchdir] = "fchdir";
  250. #endif
  251. #ifdef SYS_fchflags
  252.   syscall_table[SYS_fchflags] = "fchflags";
  253. #endif
  254. #ifdef SYS_fchmod
  255.   syscall_table[SYS_fchmod] = "fchmod";
  256. #endif
  257. #ifdef SYS_fchown
  258.   syscall_table[SYS_fchown] = "fchown";
  259. #endif
  260. #ifdef SYS_fchroot
  261.   syscall_table[SYS_fchroot] = "fchroot";
  262. #endif
  263. #ifdef SYS_fcntl
  264.   syscall_table[SYS_fcntl] = "fcntl";
  265. #endif
  266. #ifdef SYS_fdatasync
  267.   syscall_table[SYS_fdatasync] = "fdatasync";
  268. #endif
  269. #ifdef SYS_fdevstat
  270.   syscall_table[SYS_fdevstat] = "fdevstat";
  271. #endif
  272. #ifdef SYS_fdsync
  273.   syscall_table[SYS_fdsync] = "fdsync";
  274. #endif
  275. #ifdef SYS_filepriv
  276.   syscall_table[SYS_filepriv] = "filepriv";
  277. #endif
  278. #ifdef SYS_flock
  279.   syscall_table[SYS_flock] = "flock";
  280. #endif
  281. #ifdef SYS_flvlfile
  282.   syscall_table[SYS_flvlfile] = "flvlfile";
  283. #endif
  284. #ifdef SYS_fork
  285.   syscall_table[SYS_fork] = "fork";
  286. #endif
  287. #ifdef SYS_fork1
  288.   syscall_table[SYS_fork1] = "fork1";
  289. #endif
  290. #ifdef SYS_forkall
  291.   syscall_table[SYS_forkall] = "forkall";
  292. #endif
  293. #ifdef SYS_fpathconf
  294.   syscall_table[SYS_fpathconf] = "fpathconf";
  295. #endif
  296. #ifdef SYS_fstat
  297.   syscall_table[SYS_fstat] = "fstat";
  298. #endif
  299. #ifdef SYS_fstat64
  300.   syscall_table[SYS_fstat64] = "fstat64";
  301. #endif
  302. #ifdef SYS_fstatfs
  303.   syscall_table[SYS_fstatfs] = "fstatfs";
  304. #endif
  305. #ifdef SYS_fstatvfs
  306.   syscall_table[SYS_fstatvfs] = "fstatvfs";
  307. #endif
  308. #ifdef SYS_fstatvfs64
  309.   syscall_table[SYS_fstatvfs64] = "fstatvfs64";
  310. #endif
  311. #ifdef SYS_fsync
  312.   syscall_table[SYS_fsync] = "fsync";
  313. #endif
  314. #ifdef SYS_ftruncate
  315.   syscall_table[SYS_ftruncate] = "ftruncate";
  316. #endif
  317. #ifdef SYS_ftruncate64
  318.   syscall_table[SYS_ftruncate64] = "ftruncate64";
  319. #endif
  320. #ifdef SYS_fuser
  321.   syscall_table[SYS_fuser] = "fuser";
  322. #endif
  323. #ifdef SYS_fxstat
  324.   syscall_table[SYS_fxstat] = "fxstat";
  325. #endif
  326. #ifdef SYS_get_sysinfo
  327.   syscall_table[SYS_get_sysinfo] = "get_sysinfo";
  328. #endif
  329. #ifdef SYS_getaddressconf
  330.   syscall_table[SYS_getaddressconf] = "getaddressconf";
  331. #endif
  332. #ifdef SYS_getcontext
  333.   syscall_table[SYS_getcontext] = "getcontext";
  334. #endif
  335. #ifdef SYS_getdents
  336.   syscall_table[SYS_getdents] = "getdents";
  337. #endif
  338. #ifdef SYS_getdents64
  339.   syscall_table[SYS_getdents64] = "getdents64";
  340. #endif
  341. #ifdef SYS_getdirentries
  342.   syscall_table[SYS_getdirentries] = "getdirentries";
  343. #endif
  344. #ifdef SYS_getdomainname
  345.   syscall_table[SYS_getdomainname] = "getdomainname";
  346. #endif
  347. #ifdef SYS_getdtablesize
  348.   syscall_table[SYS_getdtablesize] = "getdtablesize";
  349. #endif
  350. #ifdef SYS_getfh
  351.   syscall_table[SYS_getfh] = "getfh";
  352. #endif
  353. #ifdef SYS_getfsstat
  354.   syscall_table[SYS_getfsstat] = "getfsstat";
  355. #endif
  356. #ifdef SYS_getgid
  357.   syscall_table[SYS_getgid] = "getgid";
  358. #endif
  359. #ifdef SYS_getgroups
  360.   syscall_table[SYS_getgroups] = "getgroups";
  361. #endif
  362. #ifdef SYS_gethostid
  363.   syscall_table[SYS_gethostid] = "gethostid";
  364. #endif
  365. #ifdef SYS_gethostname
  366.   syscall_table[SYS_gethostname] = "gethostname";
  367. #endif
  368. #ifdef SYS_getitimer
  369.   syscall_table[SYS_getitimer] = "getitimer";
  370. #endif
  371. #ifdef SYS_getksym
  372.   syscall_table[SYS_getksym] = "getksym";
  373. #endif
  374. #ifdef SYS_getlogin
  375.   syscall_table[SYS_getlogin] = "getlogin";
  376. #endif
  377. #ifdef SYS_getmnt
  378.   syscall_table[SYS_getmnt] = "getmnt";
  379. #endif
  380. #ifdef SYS_getmsg
  381.   syscall_table[SYS_getmsg] = "getmsg";
  382. #endif
  383. #ifdef SYS_getpagesize
  384.   syscall_table[SYS_getpagesize] = "getpagesize";
  385. #endif
  386. #ifdef SYS_getpeername
  387.   syscall_table[SYS_getpeername] = "getpeername";
  388. #endif
  389. #ifdef SYS_getpgid
  390.   syscall_table[SYS_getpgid] = "getpgid";
  391. #endif
  392. #ifdef SYS_getpgrp
  393.   syscall_table[SYS_getpgrp] = "getpgrp";
  394. #endif
  395. #ifdef SYS_getpid
  396.   syscall_table[SYS_getpid] = "getpid";
  397. #endif
  398. #ifdef SYS_getpmsg
  399.   syscall_table[SYS_getpmsg] = "getpmsg";
  400. #endif
  401. #ifdef SYS_getpriority
  402.   syscall_table[SYS_getpriority] = "getpriority";
  403. #endif
  404. #ifdef SYS_getrlimit
  405.   syscall_table[SYS_getrlimit] = "getrlimit";
  406. #endif
  407. #ifdef SYS_getrlimit64
  408.   syscall_table[SYS_getrlimit64] = "getrlimit64";
  409. #endif
  410. #ifdef SYS_getrusage
  411.   syscall_table[SYS_getrusage] = "getrusage";
  412. #endif
  413. #ifdef SYS_getsid
  414.   syscall_table[SYS_getsid] = "getsid";
  415. #endif
  416. #ifdef SYS_getsockname
  417.   syscall_table[SYS_getsockname] = "getsockname";
  418. #endif
  419. #ifdef SYS_getsockopt
  420.   syscall_table[SYS_getsockopt] = "getsockopt";
  421. #endif
  422. #ifdef SYS_gettimeofday
  423.   syscall_table[SYS_gettimeofday] = "gettimeofday";
  424. #endif
  425. #ifdef SYS_getuid
  426.   syscall_table[SYS_getuid] = "getuid";
  427. #endif
  428. #ifdef SYS_gtty
  429.   syscall_table[SYS_gtty] = "gtty";
  430. #endif
  431. #ifdef SYS_hrtsys
  432.   syscall_table[SYS_hrtsys] = "hrtsys";
  433. #endif
  434. #ifdef SYS_inst_sync
  435.   syscall_table[SYS_inst_sync] = "inst_sync";
  436. #endif
  437. #ifdef SYS_install_utrap
  438.   syscall_table[SYS_install_utrap] = "install_utrap";
  439. #endif
  440. #ifdef SYS_invlpg
  441.   syscall_table[SYS_invlpg] = "invlpg";
  442. #endif
  443. #ifdef SYS_ioctl
  444.   syscall_table[SYS_ioctl] = "ioctl";
  445. #endif
  446. #ifdef SYS_kaio
  447.   syscall_table[SYS_kaio] = "kaio";
  448. #endif
  449. #ifdef SYS_keyctl
  450.   syscall_table[SYS_keyctl] = "keyctl";
  451. #endif
  452. #ifdef SYS_kill
  453.   syscall_table[SYS_kill] = "kill";
  454. #endif
  455. #ifdef SYS_killpg
  456.   syscall_table[SYS_killpg] = "killpg";
  457. #endif
  458. #ifdef SYS_kloadcall
  459.   syscall_table[SYS_kloadcall] = "kloadcall";
  460. #endif
  461. #ifdef SYS_kmodcall
  462.   syscall_table[SYS_kmodcall] = "kmodcall";
  463. #endif
  464. #ifdef SYS_ksigaction
  465.   syscall_table[SYS_ksigaction] = "ksigaction";
  466. #endif
  467. #ifdef SYS_ksigprocmask
  468.   syscall_table[SYS_ksigprocmask] = "ksigprocmask";
  469. #endif
  470. #ifdef SYS_ksigqueue
  471.   syscall_table[SYS_ksigqueue] = "ksigqueue";
  472. #endif
  473. #ifdef SYS_lchown
  474.   syscall_table[SYS_lchown] = "lchown";
  475. #endif
  476. #ifdef SYS_link
  477.   syscall_table[SYS_link] = "link";
  478. #endif
  479. #ifdef SYS_listen
  480.   syscall_table[SYS_listen] = "listen";
  481. #endif
  482. #ifdef SYS_llseek
  483.   syscall_table[SYS_llseek] = "llseek";
  484. #endif
  485. #ifdef SYS_lseek
  486.   syscall_table[SYS_lseek] = "lseek";
  487. #endif
  488. #ifdef SYS_lseek64
  489.   syscall_table[SYS_lseek64] = "lseek64";
  490. #endif
  491. #ifdef SYS_lstat
  492.   syscall_table[SYS_lstat] = "lstat";
  493. #endif
  494. #ifdef SYS_lstat64
  495.   syscall_table[SYS_lstat64] = "lstat64";
  496. #endif
  497. #ifdef SYS_lvldom
  498.   syscall_table[SYS_lvldom] = "lvldom";
  499. #endif
  500. #ifdef SYS_lvlequal
  501.   syscall_table[SYS_lvlequal] = "lvlequal";
  502. #endif
  503. #ifdef SYS_lvlfile
  504.   syscall_table[SYS_lvlfile] = "lvlfile";
  505. #endif
  506. #ifdef SYS_lvlipc
  507.   syscall_table[SYS_lvlipc] = "lvlipc";
  508. #endif
  509. #ifdef SYS_lvlproc
  510.   syscall_table[SYS_lvlproc] = "lvlproc";
  511. #endif
  512. #ifdef SYS_lvlvfs
  513.   syscall_table[SYS_lvlvfs] = "lvlvfs";
  514. #endif
  515. #ifdef SYS_lwp_alarm
  516.   syscall_table[SYS_lwp_alarm] = "lwp_alarm";
  517. #endif
  518. #ifdef SYS_lwp_cond_broadcast
  519.   syscall_table[SYS_lwp_cond_broadcast] = "lwp_cond_broadcast";
  520. #endif
  521. #ifdef SYS_lwp_cond_signal
  522.   syscall_table[SYS_lwp_cond_signal] = "lwp_cond_signal";
  523. #endif
  524. #ifdef SYS_lwp_cond_wait
  525.   syscall_table[SYS_lwp_cond_wait] = "lwp_cond_wait";
  526. #endif
  527. #ifdef SYS_lwp_continue
  528.   syscall_table[SYS_lwp_continue] = "lwp_continue";
  529. #endif
  530. #ifdef SYS_lwp_create
  531.   syscall_table[SYS_lwp_create] = "lwp_create";
  532. #endif
  533. #ifdef SYS_lwp_exit
  534.   syscall_table[SYS_lwp_exit] = "lwp_exit";
  535. #endif
  536. #ifdef SYS_lwp_getprivate
  537.   syscall_table[SYS_lwp_getprivate] = "lwp_getprivate";
  538. #endif
  539. #ifdef SYS_lwp_info
  540.   syscall_table[SYS_lwp_info] = "lwp_info";
  541. #endif
  542. #ifdef SYS_lwp_kill
  543.   syscall_table[SYS_lwp_kill] = "lwp_kill";
  544. #endif
  545. #ifdef SYS_lwp_mutex_init
  546.   syscall_table[SYS_lwp_mutex_init] = "lwp_mutex_init";
  547. #endif
  548. #ifdef SYS_lwp_mutex_lock
  549.   syscall_table[SYS_lwp_mutex_lock] = "lwp_mutex_lock";
  550. #endif
  551. #ifdef SYS_lwp_mutex_trylock
  552.   syscall_table[SYS_lwp_mutex_trylock] = "lwp_mutex_trylock";
  553. #endif
  554. #ifdef SYS_lwp_mutex_unlock
  555.   syscall_table[SYS_lwp_mutex_unlock] = "lwp_mutex_unlock";
  556. #endif
  557. #ifdef SYS_lwp_private
  558.   syscall_table[SYS_lwp_private] = "lwp_private";
  559. #endif
  560. #ifdef SYS_lwp_self
  561.   syscall_table[SYS_lwp_self] = "lwp_self";
  562. #endif
  563. #ifdef SYS_lwp_sema_post
  564.   syscall_table[SYS_lwp_sema_post] = "lwp_sema_post";
  565. #endif
  566. #ifdef SYS_lwp_sema_trywait
  567.   syscall_table[SYS_lwp_sema_trywait] = "lwp_sema_trywait";
  568. #endif
  569. #ifdef SYS_lwp_sema_wait
  570.   syscall_table[SYS_lwp_sema_wait] = "lwp_sema_wait";
  571. #endif
  572. #ifdef SYS_lwp_setprivate
  573.   syscall_table[SYS_lwp_setprivate] = "lwp_setprivate";
  574. #endif
  575. #ifdef SYS_lwp_sigredirect
  576.   syscall_table[SYS_lwp_sigredirect] = "lwp_sigredirect";
  577. #endif
  578. #ifdef SYS_lwp_suspend
  579.   syscall_table[SYS_lwp_suspend] = "lwp_suspend";
  580. #endif
  581. #ifdef SYS_lwp_wait
  582.   syscall_table[SYS_lwp_wait] = "lwp_wait";
  583. #endif
  584. #ifdef SYS_lxstat
  585.   syscall_table[SYS_lxstat] = "lxstat";
  586. #endif
  587. #ifdef SYS_madvise
  588.   syscall_table[SYS_madvise] = "madvise";
  589. #endif
  590. #ifdef SYS_memcntl
  591.   syscall_table[SYS_memcntl] = "memcntl";
  592. #endif
  593. #ifdef SYS_mincore
  594.   syscall_table[SYS_mincore] = "mincore";
  595. #endif
  596. #ifdef SYS_mincore
  597.   syscall_table[SYS_mincore] = "mincore";
  598. #endif
  599. #ifdef SYS_mkdir
  600.   syscall_table[SYS_mkdir] = "mkdir";
  601. #endif
  602. #ifdef SYS_mkmld
  603.   syscall_table[SYS_mkmld] = "mkmld";
  604. #endif
  605. #ifdef SYS_mknod
  606.   syscall_table[SYS_mknod] = "mknod";
  607. #endif
  608. #ifdef SYS_mldmode
  609.   syscall_table[SYS_mldmode] = "mldmode";
  610. #endif
  611. #ifdef SYS_mmap
  612.   syscall_table[SYS_mmap] = "mmap";
  613. #endif
  614. #ifdef SYS_mmap64
  615.   syscall_table[SYS_mmap64] = "mmap64";
  616. #endif
  617. #ifdef SYS_modadm
  618.   syscall_table[SYS_modadm] = "modadm";
  619. #endif
  620. #ifdef SYS_modctl
  621.   syscall_table[SYS_modctl] = "modctl";
  622. #endif
  623. #ifdef SYS_modload
  624.   syscall_table[SYS_modload] = "modload";
  625. #endif
  626. #ifdef SYS_modpath
  627.   syscall_table[SYS_modpath] = "modpath";
  628. #endif
  629. #ifdef SYS_modstat
  630.   syscall_table[SYS_modstat] = "modstat";
  631. #endif
  632. #ifdef SYS_moduload
  633.   syscall_table[SYS_moduload] = "moduload";
  634. #endif
  635. #ifdef SYS_mount
  636.   syscall_table[SYS_mount] = "mount";
  637. #endif
  638. #ifdef SYS_mprotect
  639.   syscall_table[SYS_mprotect] = "mprotect";
  640. #endif
  641. #ifdef SYS_mremap
  642.   syscall_table[SYS_mremap] = "mremap";
  643. #endif
  644. #ifdef SYS_msfs_syscall
  645.   syscall_table[SYS_msfs_syscall] = "msfs_syscall";
  646. #endif
  647. #ifdef SYS_msgctl
  648.   syscall_table[SYS_msgctl] = "msgctl";
  649. #endif
  650. #ifdef SYS_msgget
  651.   syscall_table[SYS_msgget] = "msgget";
  652. #endif
  653. #ifdef SYS_msgrcv
  654.   syscall_table[SYS_msgrcv] = "msgrcv";
  655. #endif
  656. #ifdef SYS_msgsnd
  657.   syscall_table[SYS_msgsnd] = "msgsnd";
  658. #endif
  659. #ifdef SYS_msgsys
  660.   syscall_table[SYS_msgsys] = "msgsys";
  661. #endif
  662. #ifdef SYS_msleep
  663.   syscall_table[SYS_msleep] = "msleep";
  664. #endif
  665. #ifdef SYS_msync
  666.   syscall_table[SYS_msync] = "msync";
  667. #endif
  668. #ifdef SYS_munmap
  669.   syscall_table[SYS_munmap] = "munmap";
  670. #endif
  671. #ifdef SYS_mvalid
  672.   syscall_table[SYS_mvalid] = "mvalid";
  673. #endif
  674. #ifdef SYS_mwakeup
  675.   syscall_table[SYS_mwakeup] = "mwakeup";
  676. #endif
  677. #ifdef SYS_naccept
  678.   syscall_table[SYS_naccept] = "naccept";
  679. #endif
  680. #ifdef SYS_nanosleep
  681.   syscall_table[SYS_nanosleep] = "nanosleep";
  682. #endif
  683. #ifdef SYS_nfssvc
  684.   syscall_table[SYS_nfssvc] = "nfssvc";
  685. #endif
  686. #ifdef SYS_nfssys
  687.   syscall_table[SYS_nfssys] = "nfssys";
  688. #endif
  689. #ifdef SYS_ngetpeername
  690.   syscall_table[SYS_ngetpeername] = "ngetpeername";
  691. #endif
  692. #ifdef SYS_ngetsockname
  693.   syscall_table[SYS_ngetsockname] = "ngetsockname";
  694. #endif
  695. #ifdef SYS_nice
  696.   syscall_table[SYS_nice] = "nice";
  697. #endif
  698. #ifdef SYS_nrecvfrom
  699.   syscall_table[SYS_nrecvfrom] = "nrecvfrom";
  700. #endif
  701. #ifdef SYS_nrecvmsg
  702.   syscall_table[SYS_nrecvmsg] = "nrecvmsg";
  703. #endif
  704. #ifdef SYS_nsendmsg
  705.   syscall_table[SYS_nsendmsg] = "nsendmsg";
  706. #endif
  707. #ifdef SYS_ntp_adjtime
  708.   syscall_table[SYS_ntp_adjtime] = "ntp_adjtime";
  709. #endif
  710. #ifdef SYS_ntp_gettime
  711.   syscall_table[SYS_ntp_gettime] = "ntp_gettime";
  712. #endif
  713. #ifdef SYS_nuname
  714.   syscall_table[SYS_nuname] = "nuname";
  715. #endif
  716. #ifdef SYS_obreak
  717.   syscall_table[SYS_obreak] = "obreak";
  718. #endif
  719. #ifdef SYS_old_accept
  720.   syscall_table[SYS_old_accept] = "old_accept";
  721. #endif
  722. #ifdef SYS_old_fstat
  723.   syscall_table[SYS_old_fstat] = "old_fstat";
  724. #endif
  725. #ifdef SYS_old_getpeername
  726.   syscall_table[SYS_old_getpeername] = "old_getpeername";
  727. #endif
  728. #ifdef SYS_old_getpgrp
  729.   syscall_table[SYS_old_getpgrp] = "old_getpgrp";
  730. #endif
  731. #ifdef SYS_old_getsockname
  732.   syscall_table[SYS_old_getsockname] = "old_getsockname";
  733. #endif
  734. #ifdef SYS_old_killpg
  735.   syscall_table[SYS_old_killpg] = "old_killpg";
  736. #endif
  737. #ifdef SYS_old_lstat
  738.   syscall_table[SYS_old_lstat] = "old_lstat";
  739. #endif
  740. #ifdef SYS_old_recv
  741.   syscall_table[SYS_old_recv] = "old_recv";
  742. #endif
  743. #ifdef SYS_old_recvfrom
  744.   syscall_table[SYS_old_recvfrom] = "old_recvfrom";
  745. #endif
  746. #ifdef SYS_old_recvmsg
  747.   syscall_table[SYS_old_recvmsg] = "old_recvmsg";
  748. #endif
  749. #ifdef SYS_old_send
  750.   syscall_table[SYS_old_send] = "old_send";
  751. #endif
  752. #ifdef SYS_old_sendmsg
  753.   syscall_table[SYS_old_sendmsg] = "old_sendmsg";
  754. #endif
  755. #ifdef SYS_old_sigblock
  756.   syscall_table[SYS_old_sigblock] = "old_sigblock";
  757. #endif
  758. #ifdef SYS_old_sigsetmask
  759.   syscall_table[SYS_old_sigsetmask] = "old_sigsetmask";
  760. #endif
  761. #ifdef SYS_old_sigvec
  762.   syscall_table[SYS_old_sigvec] = "old_sigvec";
  763. #endif
  764. #ifdef SYS_old_stat
  765.   syscall_table[SYS_old_stat] = "old_stat";
  766. #endif
  767. #ifdef SYS_old_vhangup
  768.   syscall_table[SYS_old_vhangup] = "old_vhangup";
  769. #endif
  770. #ifdef SYS_old_wait
  771.   syscall_table[SYS_old_wait] = "old_wait";
  772. #endif
  773. #ifdef SYS_oldquota
  774.   syscall_table[SYS_oldquota] = "oldquota";
  775. #endif
  776. #ifdef SYS_online
  777.   syscall_table[SYS_online] = "online";
  778. #endif
  779. #ifdef SYS_open
  780.   syscall_table[SYS_open] = "open";
  781. #endif
  782. #ifdef SYS_open64
  783.   syscall_table[SYS_open64] = "open64";
  784. #endif
  785. #ifdef SYS_ovadvise
  786.   syscall_table[SYS_ovadvise] = "ovadvise";
  787. #endif
  788. #ifdef SYS_p_online
  789.   syscall_table[SYS_p_online] = "p_online";
  790. #endif
  791. #ifdef SYS_pagelock
  792.   syscall_table[SYS_pagelock] = "pagelock";
  793. #endif
  794. #ifdef SYS_pathconf
  795.   syscall_table[SYS_pathconf] = "pathconf";
  796. #endif
  797. #ifdef SYS_pause
  798.   syscall_table[SYS_pause] = "pause";
  799. #endif
  800. #ifdef SYS_pgrpsys
  801.   syscall_table[SYS_pgrpsys] = "pgrpsys";
  802. #endif
  803. #ifdef SYS_pid_block
  804.   syscall_table[SYS_pid_block] = "pid_block";
  805. #endif
  806. #ifdef SYS_pid_unblock
  807.   syscall_table[SYS_pid_unblock] = "pid_unblock";
  808. #endif
  809. #ifdef SYS_pipe
  810.   syscall_table[SYS_pipe] = "pipe";
  811. #endif
  812. #ifdef SYS_plock
  813.   syscall_table[SYS_plock] = "plock";
  814. #endif
  815. #ifdef SYS_poll
  816.   syscall_table[SYS_poll] = "poll";
  817. #endif
  818. #ifdef SYS_prctl
  819.   syscall_table[SYS_prctl] = "prctl";
  820. #endif
  821. #ifdef SYS_pread
  822.   syscall_table[SYS_pread] = "pread";
  823. #endif
  824. #ifdef SYS_pread64
  825.   syscall_table[SYS_pread64] = "pread64";
  826. #endif
  827. #ifdef SYS_pread64
  828.   syscall_table[SYS_pread64] = "pread64";
  829. #endif
  830. #ifdef SYS_prepblock
  831.   syscall_table[SYS_prepblock] = "prepblock";
  832. #endif
  833. #ifdef SYS_priocntl
  834.   syscall_table[SYS_priocntl] = "priocntl";
  835. #endif
  836. #ifdef SYS_priocntllst
  837.   syscall_table[SYS_priocntllst] = "priocntllst";
  838. #endif
  839. #ifdef SYS_priocntlset
  840.   syscall_table[SYS_priocntlset] = "priocntlset";
  841. #endif
  842. #ifdef SYS_priocntlsys
  843.   syscall_table[SYS_priocntlsys] = "priocntlsys";
  844. #endif
  845. #ifdef SYS_procblk
  846.   syscall_table[SYS_procblk] = "procblk";
  847. #endif
  848. #ifdef SYS_processor_bind
  849.   syscall_table[SYS_processor_bind] = "processor_bind";
  850. #endif
  851. #ifdef SYS_processor_exbind
  852.   syscall_table[SYS_processor_exbind] = "processor_exbind";
  853. #endif
  854. #ifdef SYS_processor_info
  855.   syscall_table[SYS_processor_info] = "processor_info";
  856. #endif
  857. #ifdef SYS_procpriv
  858.   syscall_table[SYS_procpriv] = "procpriv";
  859. #endif
  860. #ifdef SYS_profil
  861.   syscall_table[SYS_profil] = "profil";
  862. #endif
  863. #ifdef SYS_proplist_syscall
  864.   syscall_table[SYS_proplist_syscall] = "proplist_syscall";
  865. #endif
  866. #ifdef SYS_pset
  867.   syscall_table[SYS_pset] = "pset";
  868. #endif
  869. #ifdef SYS_ptrace
  870.   syscall_table[SYS_ptrace] = "ptrace";
  871. #endif
  872. #ifdef SYS_putmsg
  873.   syscall_table[SYS_putmsg] = "putmsg";
  874. #endif
  875. #ifdef SYS_putpmsg
  876.   syscall_table[SYS_putpmsg] = "putpmsg";
  877. #endif
  878. #ifdef SYS_pwrite
  879.   syscall_table[SYS_pwrite] = "pwrite";
  880. #endif
  881. #ifdef SYS_pwrite64
  882.   syscall_table[SYS_pwrite64] = "pwrite64";
  883. #endif
  884. #ifdef SYS_quotactl
  885.   syscall_table[SYS_quotactl] = "quotactl";
  886. #endif
  887. #ifdef SYS_rdblock
  888.   syscall_table[SYS_rdblock] = "rdblock";
  889. #endif
  890. #ifdef SYS_read
  891.   syscall_table[SYS_read] = "read";
  892. #endif
  893. #ifdef SYS_readlink
  894.   syscall_table[SYS_readlink] = "readlink";
  895. #endif
  896. #ifdef SYS_readv
  897.   syscall_table[SYS_readv] = "readv";
  898. #endif
  899. #ifdef SYS_reboot
  900.   syscall_table[SYS_reboot] = "reboot";
  901. #endif
  902. #ifdef SYS_recv
  903.   syscall_table[SYS_recv] = "recv";
  904. #endif
  905. #ifdef SYS_recvfrom
  906.   syscall_table[SYS_recvfrom] = "recvfrom";
  907. #endif
  908. #ifdef SYS_recvmsg
  909.   syscall_table[SYS_recvmsg] = "recvmsg";
  910. #endif
  911. #ifdef SYS_rename
  912.   syscall_table[SYS_rename] = "rename";
  913. #endif
  914. #ifdef SYS_resolvepath
  915.   syscall_table[SYS_resolvepath] = "resolvepath";
  916. #endif
  917. #ifdef SYS_revoke
  918.   syscall_table[SYS_revoke] = "revoke";
  919. #endif
  920. #ifdef SYS_rfsys
  921.   syscall_table[SYS_rfsys] = "rfsys";
  922. #endif
  923. #ifdef SYS_rmdir
  924.   syscall_table[SYS_rmdir] = "rmdir";
  925. #endif
  926. #ifdef SYS_rpcsys
  927.   syscall_table[SYS_rpcsys] = "rpcsys";
  928. #endif
  929. #ifdef SYS_sbrk
  930.   syscall_table[SYS_sbrk] = "sbrk";
  931. #endif
  932. #ifdef SYS_schedctl
  933.   syscall_table[SYS_schedctl] = "schedctl";
  934. #endif
  935. #ifdef SYS_secadvise
  936.   syscall_table[SYS_secadvise] = "secadvise";
  937. #endif
  938. #ifdef SYS_secsys
  939.   syscall_table[SYS_secsys] = "secsys";
  940. #endif
  941. #ifdef SYS_security
  942.   syscall_table[SYS_security] = "security";
  943. #endif
  944. #ifdef SYS_select
  945.   syscall_table[SYS_select] = "select";
  946. #endif
  947. #ifdef SYS_semctl
  948.   syscall_table[SYS_semctl] = "semctl";
  949. #endif
  950. #ifdef SYS_semget
  951.   syscall_table[SYS_semget] = "semget";
  952. #endif
  953. #ifdef SYS_semop
  954.   syscall_table[SYS_semop] = "semop";
  955. #endif
  956. #ifdef SYS_semsys
  957.   syscall_table[SYS_semsys] = "semsys";
  958. #endif
  959. #ifdef SYS_send
  960.   syscall_table[SYS_send] = "send";
  961. #endif
  962. #ifdef SYS_sendmsg
  963.   syscall_table[SYS_sendmsg] = "sendmsg";
  964. #endif
  965. #ifdef SYS_sendto
  966.   syscall_table[SYS_sendto] = "sendto";
  967. #endif
  968. #ifdef SYS_set_program_attributes
  969.   syscall_table[SYS_set_program_attributes] = "set_program_attributes";
  970. #endif
  971. #ifdef SYS_set_speculative
  972.   syscall_table[SYS_set_speculative] = "set_speculative";
  973. #endif
  974. #ifdef SYS_set_sysinfo
  975.   syscall_table[SYS_set_sysinfo] = "set_sysinfo";
  976. #endif
  977. #ifdef SYS_setcontext
  978.   syscall_table[SYS_setcontext] = "setcontext";
  979. #endif
  980. #ifdef SYS_setdomainname
  981.   syscall_table[SYS_setdomainname] = "setdomainname";
  982. #endif
  983. #ifdef SYS_setegid
  984.   syscall_table[SYS_setegid] = "setegid";
  985. #endif
  986. #ifdef SYS_seteuid
  987.   syscall_table[SYS_seteuid] = "seteuid";
  988. #endif
  989. #ifdef SYS_setgid
  990.   syscall_table[SYS_setgid] = "setgid";
  991. #endif
  992. #ifdef SYS_setgroups
  993.   syscall_table[SYS_setgroups] = "setgroups";
  994. #endif
  995. #ifdef SYS_sethostid
  996.   syscall_table[SYS_sethostid] = "sethostid";
  997. #endif
  998. #ifdef SYS_sethostname
  999.   syscall_table[SYS_sethostname] = "sethostname";
  1000. #endif
  1001. #ifdef SYS_setitimer
  1002.   syscall_table[SYS_setitimer] = "setitimer";
  1003. #endif
  1004. #ifdef SYS_setlogin
  1005.   syscall_table[SYS_setlogin] = "setlogin";
  1006. #endif
  1007. #ifdef SYS_setpgid
  1008.   syscall_table[SYS_setpgid] = "setpgid";
  1009. #endif
  1010. #ifdef SYS_setpgrp
  1011.   syscall_table[SYS_setpgrp] = "setpgrp";
  1012. #endif
  1013. #ifdef SYS_setpriority
  1014.   syscall_table[SYS_setpriority] = "setpriority";
  1015. #endif
  1016. #ifdef SYS_setregid
  1017.   syscall_table[SYS_setregid] = "setregid";
  1018. #endif
  1019. #ifdef SYS_setreuid
  1020.   syscall_table[SYS_setreuid] = "setreuid";
  1021. #endif
  1022. #ifdef SYS_setrlimit
  1023.   syscall_table[SYS_setrlimit] = "setrlimit";
  1024. #endif
  1025. #ifdef SYS_setrlimit64
  1026.   syscall_table[SYS_setrlimit64] = "setrlimit64";
  1027. #endif
  1028. #ifdef SYS_setsid
  1029.   syscall_table[SYS_setsid] = "setsid";
  1030. #endif
  1031. #ifdef SYS_setsockopt
  1032.   syscall_table[SYS_setsockopt] = "setsockopt";
  1033. #endif
  1034. #ifdef SYS_settimeofday
  1035.   syscall_table[SYS_settimeofday] = "settimeofday";
  1036. #endif
  1037. #ifdef SYS_setuid
  1038.   syscall_table[SYS_setuid] = "setuid";
  1039. #endif
  1040. #ifdef SYS_sgi
  1041.   syscall_table[SYS_sgi] = "sgi";
  1042. #endif
  1043. #ifdef SYS_sgifastpath
  1044.   syscall_table[SYS_sgifastpath] = "sgifastpath";
  1045. #endif
  1046. #ifdef SYS_sgikopt
  1047.   syscall_table[SYS_sgikopt] = "sgikopt";
  1048. #endif
  1049. #ifdef SYS_sginap
  1050.   syscall_table[SYS_sginap] = "sginap";
  1051. #endif
  1052. #ifdef SYS_shmat
  1053.   syscall_table[SYS_shmat] = "shmat";
  1054. #endif
  1055. #ifdef SYS_shmctl
  1056.   syscall_table[SYS_shmctl] = "shmctl";
  1057. #endif
  1058. #ifdef SYS_shmdt
  1059.   syscall_table[SYS_shmdt] = "shmdt";
  1060. #endif
  1061. #ifdef SYS_shmget
  1062.   syscall_table[SYS_shmget] = "shmget";
  1063. #endif
  1064. #ifdef SYS_shmsys
  1065.   syscall_table[SYS_shmsys] = "shmsys";
  1066. #endif
  1067. #ifdef SYS_shutdown
  1068.   syscall_table[SYS_shutdown] = "shutdown";
  1069. #endif
  1070. #ifdef SYS_sigaction
  1071.   syscall_table[SYS_sigaction] = "sigaction";
  1072. #endif
  1073. #ifdef SYS_sigaltstack
  1074.   syscall_table[SYS_sigaltstack] = "sigaltstack";
  1075. #endif
  1076. #ifdef SYS_sigaltstack
  1077.   syscall_table[SYS_sigaltstack] = "sigaltstack";
  1078. #endif
  1079. #ifdef SYS_sigblock
  1080.   syscall_table[SYS_sigblock] = "sigblock";
  1081. #endif
  1082. #ifdef SYS_signal
  1083.   syscall_table[SYS_signal] = "signal";
  1084. #endif
  1085. #ifdef SYS_signotify
  1086.   syscall_table[SYS_signotify] = "signotify";
  1087. #endif
  1088. #ifdef SYS_signotifywait
  1089.   syscall_table[SYS_signotifywait] = "signotifywait";
  1090. #endif
  1091. #ifdef SYS_sigpending
  1092.   syscall_table[SYS_sigpending] = "sigpending";
  1093. #endif
  1094. #ifdef SYS_sigpoll
  1095.   syscall_table[SYS_sigpoll] = "sigpoll";
  1096. #endif
  1097. #ifdef SYS_sigprocmask
  1098.   syscall_table[SYS_sigprocmask] = "sigprocmask";
  1099. #endif
  1100. #ifdef SYS_sigqueue
  1101.   syscall_table[SYS_sigqueue] = "sigqueue";
  1102. #endif
  1103. #ifdef SYS_sigreturn
  1104.   syscall_table[SYS_sigreturn] = "sigreturn";
  1105. #endif
  1106. #ifdef SYS_sigsendset
  1107.   syscall_table[SYS_sigsendset] = "sigsendset";
  1108. #endif
  1109. #ifdef SYS_sigsendsys
  1110.   syscall_table[SYS_sigsendsys] = "sigsendsys";
  1111. #endif
  1112. #ifdef SYS_sigsetmask
  1113.   syscall_table[SYS_sigsetmask] = "sigsetmask";
  1114. #endif
  1115. #ifdef SYS_sigstack
  1116.   syscall_table[SYS_sigstack] = "sigstack";
  1117. #endif
  1118. #ifdef SYS_sigsuspend
  1119.   syscall_table[SYS_sigsuspend] = "sigsuspend";
  1120. #endif
  1121. #ifdef SYS_sigvec
  1122.   syscall_table[SYS_sigvec] = "sigvec";
  1123. #endif
  1124. #ifdef SYS_sigwait
  1125.   syscall_table[SYS_sigwait] = "sigwait";
  1126. #endif
  1127. #ifdef SYS_sigwaitprim
  1128.   syscall_table[SYS_sigwaitprim] = "sigwaitprim";
  1129. #endif
  1130. #ifdef SYS_sleep
  1131.   syscall_table[SYS_sleep] = "sleep";
  1132. #endif
  1133. #ifdef SYS_so_socket
  1134.   syscall_table[SYS_so_socket] = "so_socket";
  1135. #endif
  1136. #ifdef SYS_so_socketpair
  1137.   syscall_table[SYS_so_socketpair] = "so_socketpair";
  1138. #endif
  1139. #ifdef SYS_sockconfig
  1140.   syscall_table[SYS_sockconfig] = "sockconfig";
  1141. #endif
  1142. #ifdef SYS_socket
  1143.   syscall_table[SYS_socket] = "socket";
  1144. #endif
  1145. #ifdef SYS_socketpair
  1146.   syscall_table[SYS_socketpair] = "socketpair";
  1147. #endif
  1148. #ifdef SYS_sproc
  1149.   syscall_table[SYS_sproc] = "sproc";
  1150. #endif
  1151. #ifdef SYS_sprocsp
  1152.   syscall_table[SYS_sprocsp] = "sprocsp";
  1153. #endif
  1154. #ifdef SYS_sstk
  1155.   syscall_table[SYS_sstk] = "sstk";
  1156. #endif
  1157. #ifdef SYS_stat
  1158.   syscall_table[SYS_stat] = "stat";
  1159. #endif
  1160. #ifdef SYS_stat64
  1161.   syscall_table[SYS_stat64] = "stat64";
  1162. #endif
  1163. #ifdef SYS_statfs
  1164.   syscall_table[SYS_statfs] = "statfs";
  1165. #endif
  1166. #ifdef SYS_statvfs
  1167.   syscall_table[SYS_statvfs] = "statvfs";
  1168. #endif
  1169. #ifdef SYS_statvfs64
  1170.   syscall_table[SYS_statvfs64] = "statvfs64";
  1171. #endif
  1172. #ifdef SYS_stime
  1173.   syscall_table[SYS_stime] = "stime";
  1174. #endif
  1175. #ifdef SYS_stty
  1176.   syscall_table[SYS_stty] = "stty";
  1177. #endif
  1178. #ifdef SYS_subsys_info
  1179.   syscall_table[SYS_subsys_info] = "subsys_info";
  1180. #endif
  1181. #ifdef SYS_swapctl
  1182.   syscall_table[SYS_swapctl] = "swapctl";
  1183. #endif
  1184. #ifdef SYS_swapon
  1185.   syscall_table[SYS_swapon] = "swapon";
  1186. #endif
  1187. #ifdef SYS_symlink
  1188.   syscall_table[SYS_symlink] = "symlink";
  1189. #endif
  1190. #ifdef SYS_sync
  1191.   syscall_table[SYS_sync] = "sync";
  1192. #endif
  1193. #ifdef SYS_sys3b
  1194.   syscall_table[SYS_sys3b] = "sys3b";
  1195. #endif
  1196. #ifdef SYS_syscall
  1197.   syscall_table[SYS_syscall] = "syscall";
  1198. #endif
  1199. #ifdef SYS_sysconfig
  1200.   syscall_table[SYS_sysconfig] = "sysconfig";
  1201. #endif
  1202. #ifdef SYS_sysfs
  1203.   syscall_table[SYS_sysfs] = "sysfs";
  1204. #endif
  1205. #ifdef SYS_sysi86
  1206.   syscall_table[SYS_sysi86] = "sysi86";
  1207. #endif
  1208. #ifdef SYS_sysinfo
  1209.   syscall_table[SYS_sysinfo] = "sysinfo";
  1210. #endif
  1211. #ifdef SYS_sysmips
  1212.   syscall_table[SYS_sysmips] = "sysmips";
  1213. #endif
  1214. #ifdef SYS_syssun
  1215.   syscall_table[SYS_syssun] = "syssun";
  1216. #endif
  1217. #ifdef SYS_systeminfo
  1218.   syscall_table[SYS_systeminfo] = "systeminfo";
  1219. #endif
  1220. #ifdef SYS_table
  1221.   syscall_table[SYS_table] = "table";
  1222. #endif
  1223. #ifdef SYS_time
  1224.   syscall_table[SYS_time] = "time";
  1225. #endif
  1226. #ifdef SYS_timedwait
  1227.   syscall_table[SYS_timedwait] = "timedwait";
  1228. #endif
  1229. #ifdef SYS_timer_create
  1230.   syscall_table[SYS_timer_create] = "timer_create";
  1231. #endif
  1232. #ifdef SYS_timer_delete
  1233.   syscall_table[SYS_timer_delete] = "timer_delete";
  1234. #endif
  1235. #ifdef SYS_timer_getoverrun
  1236.   syscall_table[SYS_timer_getoverrun] = "timer_getoverrun";
  1237. #endif
  1238. #ifdef SYS_timer_gettime
  1239.   syscall_table[SYS_timer_gettime] = "timer_gettime";
  1240. #endif
  1241. #ifdef SYS_timer_settime
  1242.   syscall_table[SYS_timer_settime] = "timer_settime";
  1243. #endif
  1244. #ifdef SYS_times
  1245.   syscall_table[SYS_times] = "times";
  1246. #endif
  1247. #ifdef SYS_truncate
  1248.   syscall_table[SYS_truncate] = "truncate";
  1249. #endif
  1250. #ifdef SYS_truncate64
  1251.   syscall_table[SYS_truncate64] = "truncate64";
  1252. #endif
  1253. #ifdef SYS_tsolsys
  1254.   syscall_table[SYS_tsolsys] = "tsolsys";
  1255. #endif
  1256. #ifdef SYS_uadmin
  1257.   syscall_table[SYS_uadmin] = "uadmin";
  1258. #endif
  1259. #ifdef SYS_ulimit
  1260.   syscall_table[SYS_ulimit] = "ulimit";
  1261. #endif
  1262. #ifdef SYS_umask
  1263.   syscall_table[SYS_umask] = "umask";
  1264. #endif
  1265. #ifdef SYS_umount
  1266.   syscall_table[SYS_umount] = "umount";
  1267. #endif
  1268. #ifdef SYS_uname
  1269.   syscall_table[SYS_uname] = "uname";
  1270. #endif
  1271. #ifdef SYS_unblock
  1272.   syscall_table[SYS_unblock] = "unblock";
  1273. #endif
  1274. #ifdef SYS_unlink
  1275.   syscall_table[SYS_unlink] = "unlink";
  1276. #endif
  1277. #ifdef SYS_unmount
  1278.   syscall_table[SYS_unmount] = "unmount";
  1279. #endif
  1280. #ifdef SYS_usleep_thread
  1281.   syscall_table[SYS_usleep_thread] = "usleep_thread";
  1282. #endif
  1283. #ifdef SYS_uswitch
  1284.   syscall_table[SYS_uswitch] = "uswitch";
  1285. #endif
  1286. #ifdef SYS_utc_adjtime
  1287.   syscall_table[SYS_utc_adjtime] = "utc_adjtime";
  1288. #endif
  1289. #ifdef SYS_utc_gettime
  1290.   syscall_table[SYS_utc_gettime] = "utc_gettime";
  1291. #endif
  1292. #ifdef SYS_utime
  1293.   syscall_table[SYS_utime] = "utime";
  1294. #endif
  1295. #ifdef SYS_utimes
  1296.   syscall_table[SYS_utimes] = "utimes";
  1297. #endif
  1298. #ifdef SYS_utssys
  1299.   syscall_table[SYS_utssys] = "utssys";
  1300. #endif
  1301. #ifdef SYS_vfork
  1302.   syscall_table[SYS_vfork] = "vfork";
  1303. #endif
  1304. #ifdef SYS_vhangup
  1305.   syscall_table[SYS_vhangup] = "vhangup";
  1306. #endif
  1307. #ifdef SYS_vtrace
  1308.   syscall_table[SYS_vtrace] = "vtrace";
  1309. #endif
  1310. #ifdef SYS_wait
  1311.   syscall_table[SYS_wait] = "wait";
  1312. #endif
  1313. #ifdef SYS_waitid
  1314.   syscall_table[SYS_waitid] = "waitid";
  1315. #endif
  1316. #ifdef SYS_waitsys
  1317.   syscall_table[SYS_waitsys] = "waitsys";
  1318. #endif
  1319. #ifdef SYS_write
  1320.   syscall_table[SYS_write] = "write";
  1321. #endif
  1322. #ifdef SYS_writev
  1323.   syscall_table[SYS_writev] = "writev";
  1324. #endif
  1325. #ifdef SYS_xenix
  1326.   syscall_table[SYS_xenix] = "xenix";
  1327. #endif
  1328. #ifdef SYS_xmknod
  1329.   syscall_table[SYS_xmknod] = "xmknod";
  1330. #endif
  1331. #ifdef SYS_xstat
  1332.   syscall_table[SYS_xstat] = "xstat";
  1333. #endif
  1334. #ifdef SYS_yield
  1335.   syscall_table[SYS_yield] = "yield";
  1336. #endif
  1337. }

  1338. /* Prettyprint syscall NUM.  */

  1339. void
  1340. proc_prettyfprint_syscall (FILE *file, int num, int verbose)
  1341. {
  1342.   if (syscall_table[num])
  1343.     fprintf (file, "SYS_%s ", syscall_table[num]);
  1344.   else
  1345.     fprintf (file, "<Unknown syscall %d> ", num);
  1346. }

  1347. void
  1348. proc_prettyprint_syscall (int num, int verbose)
  1349. {
  1350.   proc_prettyfprint_syscall (stdout, num, verbose);
  1351. }

  1352. /* Prettyprint all syscalls in SYSSET.  */

  1353. void
  1354. proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, int verbose)
  1355. {
  1356.   int i;

  1357.   for (i = 0; i < MAX_SYSCALLS; i++)
  1358.     if (prismember (sysset, i))
  1359.       {
  1360.         proc_prettyfprint_syscall (file, i, verbose);
  1361.       }
  1362.   fprintf (file, "\n");
  1363. }

  1364. void
  1365. proc_prettyprint_syscalls (sysset_t *sysset, int verbose)
  1366. {
  1367.   proc_prettyfprint_syscalls (stdout, sysset, verbose);
  1368. }

  1369. /* Prettyprint signals.  */

  1370. /* Signal translation table, ordered ANSI-standard signals first,
  1371.    other signals second, with signals in each block ordered by their
  1372.    numerical values on a typical POSIX platform.  */

  1373. static struct trans signal_table[] =
  1374. {
  1375.   { 0,      "<no signal>", "no signal" },

  1376.   /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
  1377.      are ANSI-standard signals and are always available.  */

  1378.   { SIGINT, "SIGINT", "Interrupt (rubout)" },
  1379.   { SIGILL, "SIGILL", "Illegal instruction" },        /* not reset when caught */
  1380.   { SIGABRT, "SIGABRT", "used by abort()" },        /* replaces SIGIOT */
  1381.   { SIGFPE, "SIGFPE", "Floating point exception" },
  1382.   { SIGSEGV, "SIGSEGV", "Segmentation violation" },
  1383.   { SIGTERM, "SIGTERM", "Software termination signal from kill" },

  1384.   /* All other signals need preprocessor conditionals.  */

  1385. #ifdef SIGHUP
  1386.   { SIGHUP, "SIGHUP", "Hangup" },
  1387. #endif
  1388. #ifdef SIGQUIT
  1389.   { SIGQUIT, "SIGQUIT", "Quit (ASCII FS)" },
  1390. #endif
  1391. #ifdef SIGTRAP
  1392.   { SIGTRAP, "SIGTRAP", "Trace trap" },                /* not reset when caught */
  1393. #endif
  1394. #ifdef SIGIOT
  1395.   { SIGIOT, "SIGIOT", "IOT instruction" },
  1396. #endif
  1397. #ifdef SIGEMT
  1398.   { SIGEMT, "SIGEMT", "EMT instruction" },
  1399. #endif
  1400. #ifdef SIGKILL
  1401.   { SIGKILL, "SIGKILL", "Kill" },        /* Solaris: cannot be caught/ignored */
  1402. #endif
  1403. #ifdef SIGBUS
  1404.   { SIGBUS, "SIGBUS", "Bus error" },
  1405. #endif
  1406. #ifdef SIGSYS
  1407.   { SIGSYS, "SIGSYS", "Bad argument to system call" },
  1408. #endif
  1409. #ifdef SIGPIPE
  1410.   { SIGPIPE, "SIGPIPE", "Write to pipe with no one to read it" },
  1411. #endif
  1412. #ifdef SIGALRM
  1413.   { SIGALRM, "SIGALRM", "Alarm clock" },
  1414. #endif
  1415. #ifdef SIGUSR1
  1416.   { SIGUSR1, "SIGUSR1", "User defined signal 1" },
  1417. #endif
  1418. #ifdef SIGUSR2
  1419.   { SIGUSR2, "SIGUSR2", "User defined signal 2" },
  1420. #endif
  1421. #ifdef SIGCHLD
  1422.   { SIGCHLD, "SIGCHLD", "Child status changed" },        /* Posix version */
  1423. #endif
  1424. #ifdef SIGCLD
  1425.   { SIGCLD, "SIGCLD", "Child status changed" },                /* Solaris version */
  1426. #endif
  1427. #ifdef SIGPWR
  1428.   { SIGPWR, "SIGPWR", "Power-fail restart" },
  1429. #endif
  1430. #ifdef SIGWINCH
  1431.   { SIGWINCH, "SIGWINCH", "Window size change" },
  1432. #endif
  1433. #ifdef SIGURG
  1434.   { SIGURG, "SIGURG", "Urgent socket condition" },
  1435. #endif
  1436. #ifdef SIGPOLL
  1437.   { SIGPOLL, "SIGPOLL", "Pollable event" },
  1438. #endif
  1439. #ifdef SIGIO
  1440.   { SIGIO, "SIGIO", "Socket I/O possible" },        /* alias for SIGPOLL */
  1441. #endif
  1442. #ifdef SIGSTOP
  1443.   { SIGSTOP, "SIGSTOP", "Stop, not from tty" },        /* cannot be caught or
  1444.                                                    ignored */
  1445. #endif
  1446. #ifdef SIGTSTP
  1447.   { SIGTSTP, "SIGTSTP", "User stop from tty" },
  1448. #endif
  1449. #ifdef SIGCONT
  1450.   { SIGCONT, "SIGCONT", "Stopped process has been continued" },
  1451. #endif
  1452. #ifdef SIGTTIN
  1453.   { SIGTTIN, "SIGTTIN", "Background tty read attempted" },
  1454. #endif
  1455. #ifdef SIGTTOU
  1456.   { SIGTTOU, "SIGTTOU", "Background tty write attempted" },
  1457. #endif
  1458. #ifdef SIGVTALRM
  1459.   { SIGVTALRM, "SIGVTALRM", "Virtual timer expired" },
  1460. #endif
  1461. #ifdef SIGPROF
  1462.   { SIGPROF, "SIGPROF", "Profiling timer expired" },
  1463. #endif
  1464. #ifdef SIGXCPU
  1465.   { SIGXCPU, "SIGXCPU", "Exceeded CPU limit" },
  1466. #endif
  1467. #ifdef SIGXFSZ
  1468.   { SIGXFSZ, "SIGXFSZ", "Exceeded file size limit" },
  1469. #endif
  1470. #ifdef SIGWAITING
  1471.   { SIGWAITING, "SIGWAITING", "Process's LWPs are blocked" },
  1472. #endif
  1473. #ifdef SIGLWP
  1474.   { SIGLWP, "SIGLWP", "Used by thread library" },
  1475. #endif
  1476. #ifdef SIGFREEZE
  1477.   { SIGFREEZE, "SIGFREEZE", "Used by CPR" },
  1478. #endif
  1479. #ifdef SIGTHAW
  1480.   { SIGTHAW, "SIGTHAW", "Used by CPR" },
  1481. #endif
  1482. #ifdef SIGCANCEL
  1483.   { SIGCANCEL, "SIGCANCEL", "Used by libthread" },
  1484. #endif
  1485. #ifdef SIGLOST
  1486.   { SIGLOST, "SIGLOST", "Resource lost" },
  1487. #endif
  1488. #ifdef SIG32
  1489.   { SIG32, "SIG32", "Reserved for kernel usage (Irix)" },
  1490. #endif
  1491. #ifdef SIGPTINTR
  1492.   { SIGPTINTR, "SIGPTINTR", "Posix 1003.1b" },
  1493. #endif
  1494. #ifdef SIGTRESCHED
  1495.   { SIGTRESCHED, "SIGTRESCHED", "Posix 1003.1b" },
  1496. #endif
  1497. #ifdef SIGINFO
  1498.   { SIGINFO, "SIGINFO", "Information request" },
  1499. #endif
  1500. #ifdef SIGRESV
  1501.   { SIGRESV, "SIGRESV", "Reserved by Digital for future use" },
  1502. #endif
  1503. #ifdef SIGAIO
  1504.   { SIGAIO, "SIGAIO", "Asynchronous I/O signal" },
  1505. #endif

  1506.   /* FIXME: add real-time signals.  */
  1507. };

  1508. /* Prettyprint signal number SIGNO.  */

  1509. void
  1510. proc_prettyfprint_signal (FILE *file, int signo, int verbose)
  1511. {
  1512.   int i;

  1513.   for (i = 0; i < sizeof (signal_table) / sizeof (signal_table[0]); i++)
  1514.     if (signo == signal_table[i].value)
  1515.       {
  1516.         fprintf (file, "%s", signal_table[i].name);
  1517.         if (verbose)
  1518.           fprintf (file, ": %s\n", signal_table[i].desc);
  1519.         else
  1520.           fprintf (file, " ");
  1521.         return;
  1522.       }
  1523.   fprintf (file, "Unknown signal %d%c", signo, verbose ? '\n' : ' ');
  1524. }

  1525. void
  1526. proc_prettyprint_signal (int signo, int verbose)
  1527. {
  1528.   proc_prettyfprint_signal (stdout, signo, verbose);
  1529. }

  1530. /* Prettyprint all signals in SIGSET.  */

  1531. void
  1532. proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose)
  1533. {
  1534.   int i;

  1535.   /* Loop over all signal numbers from 0 to NSIG, using them as the
  1536.      index to prismember.  The signal table had better not contain
  1537.      aliases, for if it does they will both be printed.  */

  1538.   for (i = 0; i < NSIG; i++)
  1539.     if (prismember (sigset, i))
  1540.       proc_prettyfprint_signal (file, i, verbose);

  1541.   if (!verbose)
  1542.     fprintf (file, "\n");
  1543. }

  1544. void
  1545. proc_prettyprint_signalset (sigset_t *sigset, int verbose)
  1546. {
  1547.   proc_prettyfprint_signalset (stdout, sigset, verbose);
  1548. }


  1549. /* Prettyprint faults.  */

  1550. /* Fault translation table.  */

  1551. static struct trans fault_table[] =
  1552. {
  1553. #ifdef FLTILL
  1554.   { FLTILL, "FLTILL", "Illegal instruction" },
  1555. #endif
  1556. #ifdef FLTPRIV
  1557.   { FLTPRIV, "FLTPRIV", "Privileged instruction" },
  1558. #endif
  1559. #ifdef FLTBPT
  1560.   { FLTBPT, "FLTBPT", "Breakpoint trap" },
  1561. #endif
  1562. #ifdef FLTTRACE
  1563.   { FLTTRACE, "FLTTRACE", "Trace trap" },
  1564. #endif
  1565. #ifdef FLTACCESS
  1566.   { FLTACCESS, "FLTACCESS", "Memory access fault" },
  1567. #endif
  1568. #ifdef FLTBOUNDS
  1569.   { FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation" },
  1570. #endif
  1571. #ifdef FLTIOVF
  1572.   { FLTIOVF, "FLTIOVF", "Integer overflow" },
  1573. #endif
  1574. #ifdef FLTIZDIV
  1575.   { FLTIZDIV, "FLTIZDIV", "Integer zero divide" },
  1576. #endif
  1577. #ifdef FLTFPE
  1578.   { FLTFPE, "FLTFPE", "Floating-point exception" },
  1579. #endif
  1580. #ifdef FLTSTACK
  1581.   { FLTSTACK, "FLTSTACK", "Unrecoverable stack fault" },
  1582. #endif
  1583. #ifdef FLTPAGE
  1584.   { FLTPAGE, "FLTPAGE", "Recoverable page fault" },
  1585. #endif
  1586. #ifdef FLTPCINVAL
  1587.   { FLTPCINVAL, "FLTPCINVAL", "Invalid PC exception" },
  1588. #endif
  1589. #ifdef FLTWATCH
  1590.   { FLTWATCH, "FLTWATCH", "User watchpoint" },
  1591. #endif
  1592. #ifdef FLTKWATCH
  1593.   { FLTKWATCH, "FLTKWATCH", "Kernel watchpoint" },
  1594. #endif
  1595. #ifdef FLTSCWATCH
  1596.   { FLTSCWATCH, "FLTSCWATCH", "Hit a store conditional on a watched page" },
  1597. #endif
  1598. };

  1599. /* Work horse.  Accepts an index into the fault table, prints it
  1600.    pretty.  */

  1601. static void
  1602. prettyfprint_faulttable_entry (FILE *file, int i, int verbose)
  1603. {
  1604.   fprintf (file, "%s", fault_table[i].name);
  1605.   if (verbose)
  1606.     fprintf (file, ": %s\n", fault_table[i].desc);
  1607.   else
  1608.     fprintf (file, " ");
  1609. }

  1610. /* Prettyprint hardware fault number FAULTNO.  */

  1611. void
  1612. proc_prettyfprint_fault (FILE *file, int faultno, int verbose)
  1613. {
  1614.   int i;

  1615.   for (i = 0; i < ARRAY_SIZE (fault_table); i++)
  1616.     if (faultno == fault_table[i].value)
  1617.       {
  1618.         prettyfprint_faulttable_entry (file, i, verbose);
  1619.         return;
  1620.       }

  1621.   fprintf (file, "Unknown hardware fault %d%c",
  1622.            faultno, verbose ? '\n' : ' ');
  1623. }

  1624. void
  1625. proc_prettyprint_fault (int faultno, int verbose)
  1626. {
  1627.   proc_prettyfprint_fault (stdout, faultno, verbose);
  1628. }

  1629. /* Prettyprint all faults in FLTSET.  */

  1630. void
  1631. proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, int verbose)
  1632. {
  1633.   int i;

  1634.   /* Loop through the fault table, using the value field as the index
  1635.      to prismember.  The fault table had better not contain aliases,
  1636.      for if it does they will both be printed.  */

  1637.   for (i = 0; i < ARRAY_SIZE (fault_table); i++)
  1638.     if (prismember (fltset, fault_table[i].value))
  1639.       prettyfprint_faulttable_entry (file, i, verbose);

  1640.   if (!verbose)
  1641.     fprintf (file, "\n");
  1642. }

  1643. void
  1644. proc_prettyprint_faultset (fltset_t *fltset, int verbose)
  1645. {
  1646.   proc_prettyfprint_faultset (stdout, fltset, verbose);
  1647. }

  1648. /* TODO: actions, holds...  */

  1649. void
  1650. proc_prettyprint_actionset (struct sigaction *actions, int verbose)
  1651. {
  1652. }


  1653. /* Provide a prototype to silence -Wmissing-prototypes.  */
  1654. void _initialize_proc_events (void);

  1655. void
  1656. _initialize_proc_events (void)
  1657. {
  1658.   init_syscall_table ();
  1659. }