1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
ripped from fedora and hacked a bit
http://bugs.gentoo.org/229229
diff -up strace-4.5.16/linux/sparc/syscallent.h.BAD strace-4.5.16/linux/sparc/syscallent.h
--- strace-4.5.16/linux/sparc/syscallent.h.BAD 2008-05-15 16:06:36.000000000 -0500
+++ strace-4.5.16/linux/sparc/syscallent.h 2008-05-15 18:21:01.000000000 -0500
@@ -351,3 +351,57 @@
{ 5, 0, printargs, "SYS_350" }, /* 350 */
{ 5, 0, printargs, "SYS_351" }, /* 351 */
{ 5, 0, printargs, "SYS_352" }, /* 352 */
+#if SYS_socket_subcall != 353
+ #error fix me
+#endif
+ { 8, 0, printargs, "socket_subcall" }, /* 353 */
+ { 3, TN, sys_socket, "socket" }, /* 354 */
+ { 3, TN, sys_bind, "bind" }, /* 355 */
+ { 3, TN, sys_connect, "connect" }, /* 356 */
+ { 2, TN, sys_listen, "listen" }, /* 357 */
+ { 3, TN, sys_accept, "accept" }, /* 358 */
+ { 3, TN, sys_getsockname, "getsockname" }, /* 359 */
+ { 3, TN, sys_getpeername, "getpeername" }, /* 360 */
+ { 4, TN, sys_socketpair, "socketpair" }, /* 361 */
+ { 4, TN, sys_send, "send" }, /* 362 */
+ { 4, TN, sys_recv, "recv" }, /* 363 */
+ { 6, TN, sys_sendto, "sendto" }, /* 364 */
+ { 6, TN, sys_recvfrom, "recvfrom" }, /* 365 */
+ { 2, TN, sys_shutdown, "shutdown" }, /* 366 */
+ { 5, TN, sys_setsockopt, "setsockopt" }, /* 367 */
+ { 5, TN, sys_getsockopt, "getsockopt" }, /* 368 */
+ { 5, TN, sys_sendmsg, "sendmsg" }, /* 369 */
+ { 5, TN, sys_recvmsg, "recvmsg" }, /* 370 */
+#if SYS_ipc_subcall != 371
+ #error fix me
+#endif
+ { 4, 0, printargs, "ipc_subcall" }, /* 371 */
+ { 4, TI, printargs, "semop" }, /* 372 */
+ { 4, TI, sys_semget, "semget" }, /* 373 */
+ { 4, TI, sys_semctl, "semctl" }, /* 374 */
+ { 5, TI, sys_semtimedop, "semtimedop" }, /* 375 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 376 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 377 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 378 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 379 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 380 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 381 */
+ { 4, TI, sys_msgsnd, "msgsnd" }, /* 382 */
+ { 4, TI, sys_msgrcv, "msgrcv" }, /* 383 */
+ { 4, TI, sys_msgget, "msgget" }, /* 384 */
+ { 4, TI, sys_msgctl, "msgctl" }, /* 385 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 386 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 387 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 388 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 389 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 390 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 391 */
+ { 4, TI, sys_shmat, "shmat" }, /* 392 */
+ { 4, TI, sys_shmdt, "shmdt" }, /* 393 */
+ { 4, TI, sys_shmget, "shmget" }, /* 394 */
+ { 4, TI, sys_shmctl, "shmctl" }, /* 395 */
+ { 5, 0, printargs, "SYS_343" }, /* 396 */
+ { 5, 0, printargs, "SYS_344" }, /* 397 */
+ { 5, 0, printargs, "SYS_345" }, /* 398 */
+ { 5, 0, printargs, "SYS_346" }, /* 399 */
+ { 5, 0, printargs, "SYS_347" }, /* 400 */
diff -up strace-4.5.16/linux/sparc/syscall.h.BAD strace-4.5.16/linux/sparc/syscall.h
--- strace-4.5.16/linux/sparc/syscall.h.BAD 2008-05-15 16:02:07.000000000 -0500
+++ strace-4.5.16/linux/sparc/syscall.h 2008-05-15 16:06:03.000000000 -0500
@@ -213,4 +214,42 @@ int sys_fstatfs64(), sys_clock_settime()
int sys_clock_getres(), sys_clock_nanosleep();
int sys_timer_create(), sys_timer_settime(), sys_timer_gettime();
+int sys_semtimedop();
+# define SYS_socket_subcall 353
+#define SYS_sub_socket (SYS_socket_subcall + 1)
+#define SYS_sub_bind (SYS_socket_subcall + 2)
+#define SYS_sub_connect (SYS_socket_subcall + 3)
+#define SYS_sub_listen (SYS_socket_subcall + 4)
+#define SYS_sub_accept (SYS_socket_subcall + 5)
+#define SYS_sub_getsockname (SYS_socket_subcall + 6)
+#define SYS_sub_getpeername (SYS_socket_subcall + 7)
+#define SYS_sub_socketpair (SYS_socket_subcall + 8)
+#define SYS_sub_send (SYS_socket_subcall + 9)
+#define SYS_sub_recv (SYS_socket_subcall + 10)
+#define SYS_sub_sendto (SYS_socket_subcall + 11)
+#define SYS_sub_recvfrom (SYS_socket_subcall + 12)
+#define SYS_sub_shutdown (SYS_socket_subcall + 13)
+#define SYS_sub_setsockopt (SYS_socket_subcall + 14)
+#define SYS_sub_getsockopt (SYS_socket_subcall + 15)
+#define SYS_sub_sendmsg (SYS_socket_subcall + 16)
+#define SYS_sub_recvmsg (SYS_socket_subcall + 17)
+
+#define SYS_socket_nsubcalls 18
+
+#define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls))
+#define SYS_sub_semop (SYS_ipc_subcall + 1)
+#define SYS_sub_semget (SYS_ipc_subcall + 2)
+#define SYS_sub_semctl (SYS_ipc_subcall + 3)
+#define SYS_sub_semtimedop (SYS_ipc_subcall + 4)
+#define SYS_sub_msgsnd (SYS_ipc_subcall + 11)
+#define SYS_sub_msgrcv (SYS_ipc_subcall + 12)
+#define SYS_sub_msgget (SYS_ipc_subcall + 13)
+#define SYS_sub_msgctl (SYS_ipc_subcall + 14)
+#define SYS_sub_shmat (SYS_ipc_subcall + 21)
+#define SYS_sub_shmdt (SYS_ipc_subcall + 22)
+#define SYS_sub_shmget (SYS_ipc_subcall + 23)
+#define SYS_sub_shmctl (SYS_ipc_subcall + 24)
+
+#define SYS_ipc_nsubcalls 25
+
#include "syscall1.h"
diff -up strace-4.5.16/syscall.c.BAD strace-4.5.16/syscall.c
--- strace-4.5.16/syscall.c.BAD 2008-05-15 16:01:49.000000000 -0500
+++ strace-4.5.16/syscall.c 2008-05-15 16:01:53.000000000 -0500
@@ -579,51 +579,6 @@ static const struct subcall subcalls_tab
#endif /* FREEBSD */
#if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) ))
-
-static const int socket_map [] = {
- /* SYS_SOCKET */ 97,
- /* SYS_BIND */ 104,
- /* SYS_CONNECT */ 98,
- /* SYS_LISTEN */ 106,
- /* SYS_ACCEPT */ 99,
- /* SYS_GETSOCKNAME */ 150,
- /* SYS_GETPEERNAME */ 141,
- /* SYS_SOCKETPAIR */ 135,
- /* SYS_SEND */ 101,
- /* SYS_RECV */ 102,
- /* SYS_SENDTO */ 133,
- /* SYS_RECVFROM */ 125,
- /* SYS_SHUTDOWN */ 134,
- /* SYS_SETSOCKOPT */ 105,
- /* SYS_GETSOCKOPT */ 118,
- /* SYS_SENDMSG */ 114,
- /* SYS_RECVMSG */ 113
-};
-
-#if defined (SPARC) || defined (SPARC64)
-static void
-sparc_socket_decode (tcp)
-struct tcb *tcp;
-{
- volatile long addr;
- volatile int i, n;
-
- if (tcp->u_arg [0] < 1 || tcp->u_arg [0] > sizeof(socket_map)/sizeof(int)+1){
- return;
- }
- tcp->scno = socket_map [tcp->u_arg [0]-1];
- n = tcp->u_nargs = sysent [tcp->scno].nargs;
- addr = tcp->u_arg [1];
- for (i = 0; i < n; i++){
- int arg;
- if (umoven (tcp, addr, sizeof (arg), (void *) &arg) < 0)
- arg = 0;
- tcp->u_arg [i] = arg;
- addr += sizeof (arg);
- }
-}
-#endif
-
static void
decode_subcall(tcp, subcall, nsubcalls, style)
struct tcb *tcp;
@@ -2382,7 +2337,7 @@ trace_syscall(struct tcb *tcp)
switch (known_scno(tcp)) {
#ifdef LINUX
-#if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
+#if !defined (ALPHA) && !defined(MIPS) && !defined(HPPA)
case SYS_socketcall:
decode_subcall(tcp, SYS_socket_subcall,
SYS_socket_nsubcalls, deref_style);
@@ -2391,12 +2346,7 @@ trace_syscall(struct tcb *tcp)
decode_subcall(tcp, SYS_ipc_subcall,
SYS_ipc_nsubcalls, shift_style);
break;
-#endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
-#if defined (SPARC) || defined (SPARC64)
- case SYS_socketcall:
- sparc_socket_decode (tcp);
- break;
-#endif
+#endif /* !(ALPHA || MIPS || HPPA) */
#endif /* LINUX */
#ifdef SVR4
#ifdef SYS_pgrpsys_subcall
|