Dmitry V. Levin | b21e2fb | 2014-12-03 21:01:35 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | enum { |
| 4 | SYSLOG_ACTION_CLOSE = 0, |
| 5 | SYSLOG_ACTION_OPEN, |
| 6 | SYSLOG_ACTION_READ, |
| 7 | SYSLOG_ACTION_READ_ALL, |
| 8 | SYSLOG_ACTION_READ_CLEAR, |
| 9 | SYSLOG_ACTION_CLEAR, |
| 10 | SYSLOG_ACTION_CONSOLE_OFF, |
| 11 | SYSLOG_ACTION_CONSOLE_ON, |
| 12 | SYSLOG_ACTION_CONSOLE_LEVEL, |
| 13 | SYSLOG_ACTION_SIZE_UNREAD, |
| 14 | SYSLOG_ACTION_SIZE_BUFFER |
| 15 | }; |
| 16 | |
| 17 | #include "xlat/syslog_action_type.h" |
| 18 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 19 | SYS_FUNC(syslog) |
Dmitry V. Levin | b21e2fb | 2014-12-03 21:01:35 +0000 | [diff] [blame] | 20 | { |
| 21 | int type = tcp->u_arg[0]; |
| 22 | |
| 23 | if (entering(tcp)) { |
| 24 | /* type */ |
| 25 | printxval(syslog_action_type, type, "SYSLOG_ACTION_???"); |
| 26 | tprints(", "); |
| 27 | } |
| 28 | |
| 29 | switch (type) { |
| 30 | case SYSLOG_ACTION_READ: |
| 31 | case SYSLOG_ACTION_READ_ALL: |
| 32 | case SYSLOG_ACTION_READ_CLEAR: |
| 33 | if (entering(tcp)) |
| 34 | return 0; |
| 35 | break; |
| 36 | default: |
| 37 | if (entering(tcp)) { |
| 38 | tprintf("%#lx, %lu", |
| 39 | tcp->u_arg[1], tcp->u_arg[2]); |
| 40 | } |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | /* bufp */ |
| 45 | if (syserror(tcp)) |
| 46 | tprintf("%#lx", tcp->u_arg[1]); |
| 47 | else |
| 48 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
| 49 | /* len */ |
| 50 | tprintf(", %d", (int) tcp->u_arg[2]); |
| 51 | |
| 52 | return 0; |
| 53 | } |