2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #define _LINUX_SOCKET_H
36 #define MS_RDONLY 1 /* Mount read-only */
37 #define MS_NOSUID 2 /* Ignore suid and sgid bits */
38 #define MS_NODEV 4 /* Disallow access to device special files */
39 #define MS_NOEXEC 8 /* Disallow program execution */
40 #define MS_SYNCHRONOUS 16 /* Writes are synced at once */
41 #define MS_REMOUNT 32 /* Alter flags of a mounted FS */
42 #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
43 #define MS_DIRSYNC 128 /* Directory modifications are synchronous */
44 #define MS_NOATIME 1024 /* Do not update access times. */
45 #define MS_NODIRATIME 2048 /* Do not update directory access times */
49 #define MS_SILENT 32768
50 #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
51 #define MS_UNBINDABLE (1<<17) /* change to unbindable */
52 #define MS_PRIVATE (1<<18) /* change to private */
53 #define MS_SLAVE (1<<19) /* change to slave */
54 #define MS_SHARED (1<<20) /* change to shared */
55 #define MS_RELATIME (1<<21)
56 #define MS_KERNMOUNT (1<<22)
57 #define MS_I_VERSION (1<<23)
58 #define MS_STRICTATIME (1<<24)
59 #define MS_NOSEC (1<<28)
60 #define MS_BORN (1<<29)
61 #define MS_ACTIVE (1<<30)
62 #define MS_NOUSER (1<<31)
63 #define MS_MGC_VAL 0xc0ed0000 /* Magic flag number */
64 #define MS_MGC_MSK 0xffff0000 /* Magic flag mask */
66 #include <sys/socket.h>
67 #include <netinet/in.h>
68 #include <arpa/inet.h>
69 #ifdef HAVE_LINUX_CAPABILITY_H
70 # include <linux/capability.h>
72 #ifdef HAVE_ASM_CACHECTL_H
73 # include <asm/cachectl.h>
75 #ifdef HAVE_LINUX_USTNAME_H
76 # include <linux/utsname.h>
78 #ifdef HAVE_ASM_SYSMIPS_H
79 # include <asm/sysmips.h>
81 #include <linux/sysctl.h>
82 #include <linux/personality.h>
84 static const struct xlat mount_flags[] = {
116 sys_mount(struct tcb *tcp)
119 int ignore_type = 0, ignore_data = 0;
120 unsigned long flags = tcp->u_arg[3];
123 if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
124 flags &= ~MS_MGC_MSK;
126 if (flags & MS_REMOUNT)
128 else if (flags & (MS_BIND | MS_MOVE))
129 ignore_type = ignore_data = 1;
131 printpath(tcp, tcp->u_arg[0]);
134 printpath(tcp, tcp->u_arg[1]);
137 if (ignore_type && tcp->u_arg[2])
138 tprintf("%#lx", tcp->u_arg[2]);
140 printstr(tcp, tcp->u_arg[2], -1);
143 printflags(mount_flags, tcp->u_arg[3], "MS_???");
146 if (ignore_data && tcp->u_arg[4])
147 tprintf("%#lx", tcp->u_arg[4]);
149 printstr(tcp, tcp->u_arg[4], -1);
154 #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
155 #define MNT_DETACH 0x00000002 /* Just detach from the tree */
156 #define MNT_EXPIRE 0x00000004 /* Mark for expiry */
158 static const struct xlat umount_flags[] = {
166 sys_umount2(struct tcb *tcp)
169 printstr(tcp, tcp->u_arg[0], -1);
171 printflags(umount_flags, tcp->u_arg[1], "MNT_???");
176 /* These are not macros, but enums. We just copy the values by hand
177 from Linux 2.6.9 here. */
178 static const struct xlat personality_options[] = {
180 XLAT(PER_LINUX_32BIT),
181 XLAT(PER_LINUX_FDPIC),
192 XLAT(PER_LINUX32_3GB),
205 sys_personality(struct tcb *tcp)
208 printxval(personality_options, tcp->u_arg[0], "PER_???");
213 SYSLOG_ACTION_CLOSE = 0,
216 SYSLOG_ACTION_READ_ALL,
217 SYSLOG_ACTION_READ_CLEAR,
219 SYSLOG_ACTION_CONSOLE_OFF,
220 SYSLOG_ACTION_CONSOLE_ON,
221 SYSLOG_ACTION_CONSOLE_LEVEL,
222 SYSLOG_ACTION_SIZE_UNREAD,
223 SYSLOG_ACTION_SIZE_BUFFER
226 static const struct xlat syslog_action_type[] = {
227 XLAT(SYSLOG_ACTION_CLOSE),
228 XLAT(SYSLOG_ACTION_OPEN),
229 XLAT(SYSLOG_ACTION_READ),
230 XLAT(SYSLOG_ACTION_READ_ALL),
231 XLAT(SYSLOG_ACTION_READ_CLEAR),
232 XLAT(SYSLOG_ACTION_CLEAR),
233 XLAT(SYSLOG_ACTION_CONSOLE_OFF),
234 XLAT(SYSLOG_ACTION_CONSOLE_ON),
235 XLAT(SYSLOG_ACTION_CONSOLE_LEVEL),
236 XLAT(SYSLOG_ACTION_SIZE_UNREAD),
237 XLAT(SYSLOG_ACTION_SIZE_BUFFER),
242 sys_syslog(struct tcb *tcp)
244 int type = tcp->u_arg[0];
248 printxval(syslog_action_type, type, "SYSLOG_ACTION_???");
253 case SYSLOG_ACTION_READ:
254 case SYSLOG_ACTION_READ_ALL:
255 case SYSLOG_ACTION_READ_CLEAR:
262 tcp->u_arg[1], tcp->u_arg[2]);
269 tprintf("%#lx", tcp->u_arg[1]);
271 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
273 tprintf(", %d", (int) tcp->u_arg[2]);
279 static const struct xlat cacheflush_scope[] = {
280 #ifdef FLUSH_SCOPE_LINE
281 XLAT(FLUSH_SCOPE_LINE),
283 #ifdef FLUSH_SCOPE_PAGE
284 XLAT(FLUSH_SCOPE_PAGE),
286 #ifdef FLUSH_SCOPE_ALL
287 XLAT(FLUSH_SCOPE_ALL),
292 static const struct xlat cacheflush_flags[] = {
293 #ifdef FLUSH_CACHE_BOTH
294 XLAT(FLUSH_CACHE_BOTH),
296 #ifdef FLUSH_CACHE_DATA
297 XLAT(FLUSH_CACHE_DATA),
299 #ifdef FLUSH_CACHE_INSN
300 XLAT(FLUSH_CACHE_INSN),
306 sys_cacheflush(struct tcb *tcp)
310 tprintf("%#lx, ", tcp->u_arg[0]);
312 printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
315 printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
317 tprintf(", %lu", tcp->u_arg[3]);
325 #include <bfin_sram.h>
327 static const struct xlat sram_alloc_flags[] = {
329 XLAT(L1_DATA_A_SRAM),
330 XLAT(L1_DATA_B_SRAM),
337 sys_sram_alloc(struct tcb *tcp)
341 tprintf("%lu, ", tcp->u_arg[0]);
343 printflags(sram_alloc_flags, tcp->u_arg[1], "???_SRAM");
348 #include <asm/cachectl.h>
350 static const struct xlat cacheflush_flags[] = {
358 sys_cacheflush(struct tcb *tcp)
362 tprintf("%#lx, ", tcp->u_arg[0]);
364 tprintf("%ld, ", tcp->u_arg[1]);
366 printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE");
374 static const struct xlat cacheflush_flags[] = {
375 #ifdef CACHEFLUSH_D_INVAL
376 XLAT(CACHEFLUSH_D_INVAL),
378 #ifdef CACHEFLUSH_D_WB
379 XLAT(CACHEFLUSH_D_WB),
381 #ifdef CACHEFLUSH_D_PURGE
382 XLAT(CACHEFLUSH_D_PURGE),
391 sys_cacheflush(struct tcb *tcp)
395 tprintf("%#lx, ", tcp->u_arg[0]);
397 tprintf("%lu, ", tcp->u_arg[1]);
399 printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
407 static const struct xlat capabilities[] = {
408 { 1<<CAP_CHOWN, "CAP_CHOWN" },
409 { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
410 { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
411 { 1<<CAP_FOWNER, "CAP_FOWNER" },
412 { 1<<CAP_FSETID, "CAP_FSETID" },
413 { 1<<CAP_KILL, "CAP_KILL" },
414 { 1<<CAP_SETGID, "CAP_SETGID" },
415 { 1<<CAP_SETUID, "CAP_SETUID" },
416 { 1<<CAP_SETPCAP, "CAP_SETPCAP" },
417 { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"},
418 { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"},
419 { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"},
420 { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" },
421 { 1<<CAP_NET_RAW, "CAP_NET_RAW" },
422 { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" },
423 { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" },
424 { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"},
425 { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" },
426 { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"},
427 { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"},
428 { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" },
429 { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" },
430 { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" },
431 { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" },
432 { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
433 { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
434 { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
436 { 1<<CAP_MKNOD, "CAP_MKNOD" },
439 { 1<<CAP_LEASE, "CAP_LEASE" },
441 #ifdef CAP_AUDIT_WRITE
442 { 1<<CAP_AUDIT_WRITE, "CAP_AUDIT_WRITE"},
444 #ifdef CAP_AUDIT_CONTROL
445 { 1<<CAP_AUDIT_CONTROL, "CAP_AUDIT_CONTROL"},
448 { 1<<CAP_SETFCAP, "CAP_SETFCAP" },
453 #ifndef _LINUX_CAPABILITY_VERSION_1
454 # define _LINUX_CAPABILITY_VERSION_1 0x19980330
456 #ifndef _LINUX_CAPABILITY_VERSION_2
457 # define _LINUX_CAPABILITY_VERSION_2 0x20071026
459 #ifndef _LINUX_CAPABILITY_VERSION_3
460 # define _LINUX_CAPABILITY_VERSION_3 0x20080522
463 static const struct xlat cap_version[] = {
464 XLAT(_LINUX_CAPABILITY_VERSION_1),
465 XLAT(_LINUX_CAPABILITY_VERSION_2),
466 XLAT(_LINUX_CAPABILITY_VERSION_3),
471 print_cap_header(struct tcb *tcp, unsigned long addr)
473 union { cap_user_header_t p; long *a; char *c; } arg;
474 long a[sizeof(*arg.p) / sizeof(long) + 1];
479 else if (!verbose(tcp) ||
480 umoven(tcp, addr, sizeof(*arg.p), arg.c) < 0)
481 tprintf("%#lx", addr);
484 printxval(cap_version, arg.p->version,
485 "_LINUX_CAPABILITY_VERSION_???");
486 tprintf(", %d}", arg.p->pid);
491 print_cap_data(struct tcb *tcp, unsigned long addr)
493 union { cap_user_data_t p; long *a; char *c; } arg;
494 long a[sizeof(*arg.p) / sizeof(long) + 1];
499 else if (!verbose(tcp) ||
500 (exiting(tcp) && syserror(tcp)) ||
501 umoven(tcp, addr, sizeof(*arg.p), arg.c) < 0)
502 tprintf("%#lx", addr);
505 printflags(capabilities, arg.p->effective, "CAP_???");
507 printflags(capabilities, arg.p->permitted, "CAP_???");
509 printflags(capabilities, arg.p->inheritable, "CAP_???");
515 sys_capget(struct tcb *tcp)
518 print_cap_header(tcp, tcp->u_arg[0]);
521 print_cap_data(tcp, tcp->u_arg[1]);
527 sys_capset(struct tcb *tcp)
530 print_cap_header(tcp, tcp->u_arg[0]);
532 print_cap_data(tcp, tcp->u_arg[1]);
539 int sys_capget(struct tcb *tcp)
541 return printargs(tcp);
544 int sys_capset(struct tcb *tcp)
546 return printargs(tcp);
551 /* Linux 2.6.18+ headers removed CTL_PROC enum. */
553 # define CTL_CPU 10 /* older headers lack */
554 static const struct xlat sysctl_root[] = {
568 static const struct xlat sysctl_kern[] = {
570 XLAT(KERN_OSRELEASE),
573 XLAT(KERN_SECUREMASK),
576 XLAT(KERN_DOMAINNAME),
577 #ifdef KERN_SECURELVL
578 XLAT(KERN_SECURELVL),
581 #ifdef KERN_REALROOTDEV
582 XLAT(KERN_REALROOTDEV),
584 #ifdef KERN_JAVA_INTERPRETER
585 XLAT(KERN_JAVA_INTERPRETER),
587 #ifdef KERN_JAVA_APPLETVIEWER
588 XLAT(KERN_JAVA_APPLETVIEWER),
590 XLAT(KERN_SPARC_REBOOT),
591 XLAT(KERN_CTLALTDEL),
593 XLAT(KERN_NAMETRANS),
594 XLAT(KERN_PPC_HTABRECLAIM),
595 XLAT(KERN_PPC_ZEROPAGED),
596 XLAT(KERN_PPC_POWERSAVE_NAP),
598 XLAT(KERN_SG_BIG_BUFF),
610 static const struct xlat sysctl_vm[] = {
635 XLAT(VM_OVERCOMMIT_MEMORY),
648 #ifdef VM_PAGERDAEMON
649 XLAT(VM_PAGERDAEMON),
660 XLAT(VM_PAGE_CLUSTER),
664 static const struct xlat sysctl_net[] = {
683 static const struct xlat sysctl_net_core[] = {
684 XLAT(NET_CORE_WMEM_MAX),
685 XLAT(NET_CORE_RMEM_MAX),
686 XLAT(NET_CORE_WMEM_DEFAULT),
687 XLAT(NET_CORE_RMEM_DEFAULT),
688 XLAT(NET_CORE_MAX_BACKLOG),
689 XLAT(NET_CORE_FASTROUTE),
690 XLAT(NET_CORE_MSG_COST),
691 XLAT(NET_CORE_MSG_BURST),
692 XLAT(NET_CORE_OPTMEM_MAX),
696 static const struct xlat sysctl_net_unix[] = {
697 XLAT(NET_UNIX_DESTROY_DELAY),
698 XLAT(NET_UNIX_DELETE_DELAY),
702 static const struct xlat sysctl_net_ipv4[] = {
703 XLAT(NET_IPV4_FORWARD),
704 XLAT(NET_IPV4_DYNADDR),
706 XLAT(NET_IPV4_NEIGH),
707 XLAT(NET_IPV4_ROUTE),
708 XLAT(NET_IPV4_FIB_HASH),
709 XLAT(NET_IPV4_TCP_TIMESTAMPS),
710 XLAT(NET_IPV4_TCP_WINDOW_SCALING),
711 XLAT(NET_IPV4_TCP_SACK),
712 XLAT(NET_IPV4_TCP_RETRANS_COLLAPSE),
713 XLAT(NET_IPV4_DEFAULT_TTL),
714 XLAT(NET_IPV4_AUTOCONFIG),
715 XLAT(NET_IPV4_NO_PMTU_DISC),
716 XLAT(NET_IPV4_TCP_SYN_RETRIES),
717 XLAT(NET_IPV4_IPFRAG_HIGH_THRESH),
718 XLAT(NET_IPV4_IPFRAG_LOW_THRESH),
719 XLAT(NET_IPV4_IPFRAG_TIME),
720 XLAT(NET_IPV4_TCP_MAX_KA_PROBES),
721 XLAT(NET_IPV4_TCP_KEEPALIVE_TIME),
722 XLAT(NET_IPV4_TCP_KEEPALIVE_PROBES),
723 XLAT(NET_IPV4_TCP_RETRIES1),
724 XLAT(NET_IPV4_TCP_RETRIES2),
725 XLAT(NET_IPV4_TCP_FIN_TIMEOUT),
726 XLAT(NET_IPV4_IP_MASQ_DEBUG),
727 XLAT(NET_TCP_SYNCOOKIES),
728 XLAT(NET_TCP_STDURG),
729 XLAT(NET_TCP_RFC1337),
730 XLAT(NET_TCP_SYN_TAILDROP),
731 XLAT(NET_TCP_MAX_SYN_BACKLOG),
732 XLAT(NET_IPV4_LOCAL_PORT_RANGE),
733 XLAT(NET_IPV4_ICMP_ECHO_IGNORE_ALL),
734 XLAT(NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS),
735 XLAT(NET_IPV4_ICMP_SOURCEQUENCH_RATE),
736 XLAT(NET_IPV4_ICMP_DESTUNREACH_RATE),
737 XLAT(NET_IPV4_ICMP_TIMEEXCEED_RATE),
738 XLAT(NET_IPV4_ICMP_PARAMPROB_RATE),
739 XLAT(NET_IPV4_ICMP_ECHOREPLY_RATE),
740 XLAT(NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES),
741 XLAT(NET_IPV4_IGMP_MAX_MEMBERSHIPS),
745 static const struct xlat sysctl_net_ipv4_route[] = {
746 XLAT(NET_IPV4_ROUTE_FLUSH),
747 XLAT(NET_IPV4_ROUTE_MIN_DELAY),
748 XLAT(NET_IPV4_ROUTE_MAX_DELAY),
749 XLAT(NET_IPV4_ROUTE_GC_THRESH),
750 XLAT(NET_IPV4_ROUTE_MAX_SIZE),
751 XLAT(NET_IPV4_ROUTE_GC_MIN_INTERVAL),
752 XLAT(NET_IPV4_ROUTE_GC_TIMEOUT),
753 XLAT(NET_IPV4_ROUTE_GC_INTERVAL),
754 XLAT(NET_IPV4_ROUTE_REDIRECT_LOAD),
755 XLAT(NET_IPV4_ROUTE_REDIRECT_NUMBER),
756 XLAT(NET_IPV4_ROUTE_REDIRECT_SILENCE),
757 XLAT(NET_IPV4_ROUTE_ERROR_COST),
758 XLAT(NET_IPV4_ROUTE_ERROR_BURST),
759 XLAT(NET_IPV4_ROUTE_GC_ELASTICITY),
763 static const struct xlat sysctl_net_ipv4_conf[] = {
764 XLAT(NET_IPV4_CONF_FORWARDING),
765 XLAT(NET_IPV4_CONF_MC_FORWARDING),
766 XLAT(NET_IPV4_CONF_PROXY_ARP),
767 XLAT(NET_IPV4_CONF_ACCEPT_REDIRECTS),
768 XLAT(NET_IPV4_CONF_SECURE_REDIRECTS),
769 XLAT(NET_IPV4_CONF_SEND_REDIRECTS),
770 XLAT(NET_IPV4_CONF_SHARED_MEDIA),
771 XLAT(NET_IPV4_CONF_RP_FILTER),
772 XLAT(NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE),
773 XLAT(NET_IPV4_CONF_BOOTP_RELAY),
774 XLAT(NET_IPV4_CONF_LOG_MARTIANS),
778 static const struct xlat sysctl_net_ipv6[] = {
780 XLAT(NET_IPV6_NEIGH),
781 XLAT(NET_IPV6_ROUTE),
785 static const struct xlat sysctl_net_ipv6_route[] = {
786 XLAT(NET_IPV6_ROUTE_FLUSH),
787 XLAT(NET_IPV6_ROUTE_GC_THRESH),
788 XLAT(NET_IPV6_ROUTE_MAX_SIZE),
789 XLAT(NET_IPV6_ROUTE_GC_MIN_INTERVAL),
790 XLAT(NET_IPV6_ROUTE_GC_TIMEOUT),
791 XLAT(NET_IPV6_ROUTE_GC_INTERVAL),
792 XLAT(NET_IPV6_ROUTE_GC_ELASTICITY),
797 sys_sysctl(struct tcb *tcp)
799 struct __sysctl_args info;
803 if (umove(tcp, tcp->u_arg[0], &info) < 0)
804 return printargs(tcp);
806 size = sizeof(int) * (unsigned long) info.nlen;
807 name = (size / sizeof(int) != info.nlen) ? NULL : malloc(size);
809 umoven(tcp, (unsigned long) info.name, size, (char *) name) < 0) {
812 tprintf("{%p, %d, %p, %p, %p, %lu}",
813 info.name, info.nlen, info.oldval,
814 info.oldlenp, info.newval, (unsigned long)info.newlen);
819 int cnt = 0, max_cnt;
825 printxval(sysctl_root, name[0], "CTL_???");
833 printxval(sysctl_kern, name[1], "KERN_???");
838 printxval(sysctl_vm, name[1], "VM_???");
843 printxval(sysctl_net, name[1], "NET_???");
851 printxval(sysctl_net_core, name[2],
856 printxval(sysctl_net_unix, name[2],
861 printxval(sysctl_net_ipv4, name[2],
869 printxval(sysctl_net_ipv4_route,
871 "NET_IPV4_ROUTE_???");
875 printxval(sysctl_net_ipv4_conf,
877 "NET_IPV4_CONF_???");
885 printxval(sysctl_net_ipv6, name[2],
893 printxval(sysctl_net_ipv6_route,
895 "NET_IPV6_ROUTE_???");
910 if (abbrev(tcp) && max_cnt > max_strlen)
911 max_cnt = max_strlen;
912 while (cnt < max_cnt)
913 tprintf(", %x", name[cnt++]);
916 tprintf("}, %d, ", info.nlen);
919 if (info.oldval == NULL) {
921 } else if (umove(tcp, (long)info.oldlenp, &oldlen) >= 0
923 && ((name[0] == CTL_KERN
924 && (name[1] == KERN_OSRELEASE
925 || name[1] == KERN_OSTYPE
926 #ifdef KERN_JAVA_INTERPRETER
927 || name[1] == KERN_JAVA_INTERPRETER
929 #ifdef KERN_JAVA_APPLETVIEWER
930 || name[1] == KERN_JAVA_APPLETVIEWER
933 printpath(tcp, (size_t)info.oldval);
935 tprintf("%p", info.oldval);
937 tprintf(", %lu, ", (unsigned long)oldlen);
938 if (info.newval == NULL)
940 else if (syserror(tcp))
941 tprintf("%p", info.newval);
943 printpath(tcp, (size_t)info.newval);
944 tprintf(", %lu", (unsigned long)info.newlen);
953 #ifndef __NEW_UTS_LEN
954 #define __NEW_UTS_LEN 64
957 static const struct xlat sysmips_operations[] = {
962 XLAT(MIPS_ATOMIC_SET),
966 int sys_sysmips(struct tcb *tcp)
969 printxval(sysmips_operations, tcp->u_arg[0], "???");
971 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
972 } else if (tcp->u_arg[0] == SETNAME) {
973 char nodename[__NEW_UTS_LEN + 1];
974 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
975 tprintf(", %#lx", tcp->u_arg[1]);
977 tprintf(", \"%.*s\"", (int)(__NEW_UTS_LEN + 1), nodename);
978 } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
979 tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
980 } else if (tcp->u_arg[0] == MIPS_FIXADE) {
981 tprintf(", 0x%lx", tcp->u_arg[1]);
983 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
993 #define OR1K_ATOMIC_SWAP 1
994 #define OR1K_ATOMIC_CMPXCHG 2
995 #define OR1K_ATOMIC_XCHG 3
996 #define OR1K_ATOMIC_ADD 4
997 #define OR1K_ATOMIC_DECPOS 5
998 #define OR1K_ATOMIC_AND 6
999 #define OR1K_ATOMIC_OR 7
1000 #define OR1K_ATOMIC_UMAX 8
1001 #define OR1K_ATOMIC_UMIN 9
1003 static const struct xlat atomic_ops[] = {
1004 { OR1K_ATOMIC_SWAP, "SWAP" },
1005 { OR1K_ATOMIC_CMPXCHG, "CMPXCHG" },
1006 { OR1K_ATOMIC_XCHG, "XCHG" },
1007 { OR1K_ATOMIC_ADD, "ADD" },
1008 { OR1K_ATOMIC_DECPOS, "DECPOS" },
1009 { OR1K_ATOMIC_AND, "AND" },
1010 { OR1K_ATOMIC_OR, "OR" },
1011 { OR1K_ATOMIC_UMAX, "UMAX" },
1012 { OR1K_ATOMIC_UMIN, "UMIN" },
1016 int sys_or1k_atomic(struct tcb *tcp)
1018 if (entering(tcp)) {
1019 printxval(atomic_ops, tcp->u_arg[0], "???");
1020 switch(tcp->u_arg[0]) {
1021 case OR1K_ATOMIC_SWAP:
1022 tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
1024 case OR1K_ATOMIC_CMPXCHG:
1025 tprintf(", 0x%lx, %#lx, %#lx", tcp->u_arg[1], tcp->u_arg[2],
1029 case OR1K_ATOMIC_XCHG:
1030 case OR1K_ATOMIC_ADD:
1031 case OR1K_ATOMIC_AND:
1032 case OR1K_ATOMIC_OR:
1033 case OR1K_ATOMIC_UMAX:
1034 case OR1K_ATOMIC_UMIN:
1035 tprintf(", 0x%lx, %#lx", tcp->u_arg[1], tcp->u_arg[2]);
1038 case OR1K_ATOMIC_DECPOS:
1039 tprintf(", 0x%lx", tcp->u_arg[1]);