blob: ab294128d223b014e4ac9916d63e8f8aaffea699 [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001/*
2 * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +00005 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00006 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
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.
18 *
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.
29 *
30 * $Id$
31 */
32
33#include "defs.h"
34
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000035#if defined(LINUX) || defined(SUNOS4) || defined(FREEBSD)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000036
Roland McGrath4df13c12004-04-16 21:48:40 +000037# ifdef HAVE_MQUEUE_H
38# include <mqueue.h>
39# endif
40
41#include <fcntl.h>
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000042#include <sys/ipc.h>
43#include <sys/sem.h>
44#include <sys/msg.h>
45#include <sys/shm.h>
46
47#ifndef MSG_STAT
48#define MSG_STAT 11
49#endif
50#ifndef MSG_INFO
51#define MSG_INFO 12
52#endif
53#ifndef SHM_STAT
54#define SHM_STAT 13
55#endif
56#ifndef SHM_INFO
57#define SHM_INFO 14
58#endif
59#ifndef SEM_STAT
60#define SEM_STAT 18
61#endif
62#ifndef SEM_INFO
63#define SEM_INFO 19
64#endif
65
Roland McGrath80731792003-01-14 09:46:17 +000066#if defined LINUX && !defined IPC_64
67# define IPC_64 0x100
68#endif
69
Roland McGrath4df13c12004-04-16 21:48:40 +000070extern void printsigevent(struct tcb *tcp, long arg);
71
Roland McGrathd9f816f2004-09-04 03:39:20 +000072static const struct xlat msgctl_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000073 { IPC_RMID, "IPC_RMID" },
74 { IPC_SET, "IPC_SET" },
75 { IPC_STAT, "IPC_STAT" },
76#ifdef LINUX
77 { IPC_INFO, "IPC_INFO" },
78 { MSG_STAT, "MSG_STAT" },
79 { MSG_INFO, "MSG_INFO" },
80#endif /* LINUX */
81 { 0, NULL },
82};
83
Roland McGrathd9f816f2004-09-04 03:39:20 +000084static const struct xlat semctl_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000085 { IPC_RMID, "IPC_RMID" },
86 { IPC_SET, "IPC_SET" },
87 { IPC_STAT, "IPC_STAT" },
88#ifdef LINUX
89 { IPC_INFO, "IPC_INFO" },
90 { SEM_STAT, "SEM_STAT" },
91 { SEM_INFO, "SEM_INFO" },
92#endif /* LINUX */
93 { GETPID, "GETPID" },
94 { GETVAL, "GETVAL" },
95 { GETALL, "GETALL" },
96 { GETNCNT, "GETNCNT" },
97 { GETZCNT, "GETZCNT" },
98 { SETVAL, "SETVAL" },
99 { SETALL, "SETALL" },
100 { 0, NULL },
101};
102
Roland McGrathd9f816f2004-09-04 03:39:20 +0000103static const struct xlat shmctl_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000104 { IPC_RMID, "IPC_RMID" },
105 { IPC_SET, "IPC_SET" },
106 { IPC_STAT, "IPC_STAT" },
107#ifdef LINUX
108 { IPC_INFO, "IPC_INFO" },
109 { SHM_STAT, "SHM_STAT" },
110 { SHM_INFO, "SHM_INFO" },
111#endif /* LINUX */
Roland McGrath80731792003-01-14 09:46:17 +0000112#ifdef SHM_LOCK
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000113 { SHM_LOCK, "SHM_LOCK" },
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000114#endif
Roland McGrath80731792003-01-14 09:46:17 +0000115#ifdef SHM_UNLOCK
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000116 { SHM_UNLOCK, "SHM_UNLOCK" },
Roland McGrath80731792003-01-14 09:46:17 +0000117#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000118 { 0, NULL },
119};
120
Roland McGrathd9f816f2004-09-04 03:39:20 +0000121static const struct xlat resource_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000122 { IPC_CREAT, "IPC_CREAT" },
123 { IPC_EXCL, "IPC_EXCL" },
124 { IPC_NOWAIT, "IPC_NOWAIT" },
Roland McGrath802b8f42005-05-09 07:40:33 +0000125 { 0, NULL },
126};
127
128static const struct xlat shm_resource_flags[] = {
129 { IPC_CREAT, "IPC_CREAT" },
130 { IPC_EXCL, "IPC_EXCL" },
Roland McGrathe2be9ab2003-07-17 09:03:04 +0000131#ifdef SHM_HUGETLB
132 { SHM_HUGETLB, "SHM_HUGETLB" },
133#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000134 { 0, NULL },
135};
136
Roland McGrathd9f816f2004-09-04 03:39:20 +0000137static const struct xlat shm_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000138#ifdef LINUX
139 { SHM_REMAP, "SHM_REMAP" },
140#endif /* LINUX */
141 { SHM_RDONLY, "SHM_RDONLY" },
142 { SHM_RND, "SHM_RND" },
143 { 0, NULL },
144};
145
Roland McGrathd9f816f2004-09-04 03:39:20 +0000146static const struct xlat msg_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000147 { MSG_NOERROR, "MSG_NOERROR" },
148#ifdef LINUX
149 { MSG_EXCEPT, "MSG_EXCEPT" },
150#endif /* LINUX */
151 { IPC_NOWAIT, "IPC_NOWAIT" },
152 { 0, NULL },
153};
154
155int sys_msgget(tcp)
156struct tcb *tcp;
157{
158 if (entering(tcp)) {
159 if (tcp->u_arg[0])
Roland McGrath9f130d52006-08-22 07:36:55 +0000160 tprintf("%#lx", tcp->u_arg[0]);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000161 else
162 tprintf("IPC_PRIVATE");
163 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000164 if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000165 tprintf("|");
Roland McGrathe2be9ab2003-07-17 09:03:04 +0000166 tprintf("%#lo", tcp->u_arg[1] & 0777);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000167 }
168 return 0;
169}
170
Roland McGrath80731792003-01-14 09:46:17 +0000171#ifdef IPC_64
172# define PRINTCTL(flagset, arg, dflt) \
173 if ((arg) & IPC_64) tprintf("IPC_64|"); \
174 printxval((flagset), (arg) &~ IPC_64, dflt)
175#else
176# define PRINTCTL printxval
177#endif
178
Roland McGrath54b90d72005-12-02 03:57:07 +0000179static int
180indirect_ipccall(tcp)
181struct tcb *tcp;
182{
183#ifdef LINUX
184#ifdef X86_64
185 return current_personality > 0;
186#endif
Roland McGratha81bf4c2005-12-02 04:18:55 +0000187#if defined IA64
188 return tcp->scno < 1024; /* ia32 emulation syscalls are low */
Roland McGrath54b90d72005-12-02 03:57:07 +0000189#endif
Roland McGrathe1ebaab2005-12-02 04:34:09 +0000190#if !defined MIPS && !defined HPPA
191 return 1;
192#endif
193#endif /* LINUX */
Roland McGrath54b90d72005-12-02 03:57:07 +0000194 return 0;
195}
196
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000197int sys_msgctl(tcp)
198struct tcb *tcp;
199{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000200 if (entering(tcp)) {
Roland McGrath80731792003-01-14 09:46:17 +0000201 tprintf("%lu, ", tcp->u_arg[0]);
202 PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???");
Roland McGrath54b90d72005-12-02 03:57:07 +0000203 tprintf(", %#lx", tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000204 }
205 return 0;
206}
207
208int sys_msgsnd(tcp)
209struct tcb *tcp;
210{
211 long mtype;
212
213 if (entering(tcp)) {
214 tprintf("%lu", tcp->u_arg[0]);
Roland McGrath54b90d72005-12-02 03:57:07 +0000215 if (indirect_ipccall(tcp)) {
216 umove(tcp, tcp->u_arg[3], &mtype);
217 tprintf(", {%lu, ", mtype);
218 printstr(tcp, tcp->u_arg[3] + sizeof(long),
219 tcp->u_arg[1]);
220 tprintf("}, %lu", tcp->u_arg[1]);
221 tprintf(", ");
222 printflags(msg_flags, tcp->u_arg[2], "MSG_???");
223 } else {
224 umove(tcp, tcp->u_arg[1], &mtype);
225 tprintf(", {%lu, ", mtype);
226 printstr(tcp, tcp->u_arg[1] + sizeof(long),
227 tcp->u_arg[2]);
228 tprintf("}, %lu", tcp->u_arg[2]);
229 tprintf(", ");
230 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
231 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000232 }
233 return 0;
234}
235
236int sys_msgrcv(tcp)
237struct tcb *tcp;
238{
239 long mtype;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000240
Roland McGrathf467c002005-12-02 03:44:12 +0000241 if (entering(tcp)) {
242 tprintf("%lu, ", tcp->u_arg[0]);
243 } else {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000244 tprintf("%lu", tcp->u_arg[0]);
Roland McGrath54b90d72005-12-02 03:57:07 +0000245 if (indirect_ipccall(tcp)) {
246 struct ipc_wrapper {
247 struct msgbuf *msgp;
248 long msgtyp;
249 } tmp;
250 umove(tcp, tcp->u_arg[3], &tmp);
251 umove(tcp, (long) tmp.msgp, &mtype);
252 tprintf(", {%lu, ", mtype);
253 printstr(tcp, (long) (tmp.msgp) + sizeof(long),
254 tcp->u_arg[1]);
255 tprintf("}, %lu", tcp->u_arg[1]);
256 tprintf(", %ld", tmp.msgtyp);
257 tprintf(", ");
258 printflags(msg_flags, tcp->u_arg[2], "MSG_???");
259 } else {
260 umove(tcp, tcp->u_arg[1], &mtype);
261 tprintf("{%lu, ", mtype);
262 printstr(tcp, tcp->u_arg[1] + sizeof(long),
263 tcp->u_arg[2]);
264 tprintf("}, %lu", tcp->u_arg[2]);
265 tprintf(", %ld", tcp->u_arg[3]);
266 tprintf(", ");
267 printflags(msg_flags, tcp->u_arg[4], "MSG_???");
268 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000269 }
270 return 0;
271}
272
273int sys_semop(tcp)
274struct tcb *tcp;
275{
276 if (entering(tcp)) {
277 tprintf("%lu", tcp->u_arg[0]);
Roland McGrath54b90d72005-12-02 03:57:07 +0000278 if (indirect_ipccall(tcp)) {
279 tprintf(", %#lx", tcp->u_arg[3]);
280 tprintf(", %lu", tcp->u_arg[1]);
281 } else {
282 tprintf(", %#lx", tcp->u_arg[1]);
283 tprintf(", %lu", tcp->u_arg[2]);
284 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000285 }
286 return 0;
287}
288
Roland McGrath84776472003-04-08 01:46:48 +0000289#ifdef LINUX
290int sys_semtimedop(tcp)
291struct tcb *tcp;
292{
293 if (entering(tcp)) {
294 tprintf("%lu", tcp->u_arg[0]);
Roland McGratha079d9f2006-04-25 07:22:01 +0000295 if (indirect_ipccall(tcp)) {
Roland McGrath54b90d72005-12-02 03:57:07 +0000296 tprintf(", %#lx", tcp->u_arg[3]);
297 tprintf(", %lu, ", tcp->u_arg[1]);
298 printtv(tcp, tcp->u_arg[5]);
299 } else {
300 tprintf(", %#lx", tcp->u_arg[1]);
301 tprintf(", %lu, ", tcp->u_arg[2]);
302 printtv(tcp, tcp->u_arg[3]);
303 }
Roland McGrath84776472003-04-08 01:46:48 +0000304 }
305 return 0;
306}
307#endif
308
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000309int sys_semget(tcp)
310struct tcb *tcp;
311{
312 if (entering(tcp)) {
313 if (tcp->u_arg[0])
Roland McGrath9f130d52006-08-22 07:36:55 +0000314 tprintf("%#lx", tcp->u_arg[0]);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000315 else
316 tprintf("IPC_PRIVATE");
317 tprintf(", %lu", tcp->u_arg[1]);
318 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000319 if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000320 tprintf("|");
Roland McGrathe2be9ab2003-07-17 09:03:04 +0000321 tprintf("%#lo", tcp->u_arg[2] & 0777);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000322 }
323 return 0;
324}
325
326int sys_semctl(tcp)
327struct tcb *tcp;
328{
329 if (entering(tcp)) {
330 tprintf("%lu", tcp->u_arg[0]);
331 tprintf(", %lu, ", tcp->u_arg[1]);
Roland McGrath80731792003-01-14 09:46:17 +0000332 PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000333 tprintf(", %#lx", tcp->u_arg[3]);
334 }
335 return 0;
336}
337
338int sys_shmget(tcp)
339struct tcb *tcp;
340{
341 if (entering(tcp)) {
342 if (tcp->u_arg[0])
Roland McGrath9f130d52006-08-22 07:36:55 +0000343 tprintf("%#lx", tcp->u_arg[0]);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000344 else
345 tprintf("IPC_PRIVATE");
346 tprintf(", %lu", tcp->u_arg[1]);
347 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000348 if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000349 tprintf("|");
Roland McGrathe2be9ab2003-07-17 09:03:04 +0000350 tprintf("%#lo", tcp->u_arg[2] & 0777);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000351 }
352 return 0;
353}
354
355int sys_shmctl(tcp)
356struct tcb *tcp;
357{
358 if (entering(tcp)) {
359 tprintf("%lu, ", tcp->u_arg[0]);
Roland McGrath80731792003-01-14 09:46:17 +0000360 PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???");
Roland McGrath54b90d72005-12-02 03:57:07 +0000361 if (indirect_ipccall(tcp)) {
362 tprintf(", %#lx", tcp->u_arg[3]);
363 } else {
364 tprintf(", %#lx", tcp->u_arg[2]);
365 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000366 }
367 return 0;
368}
369
370int sys_shmat(tcp)
371struct tcb *tcp;
372{
373#ifdef LINUX
374 unsigned long raddr;
375#endif /* LINUX */
376
377 if (exiting(tcp)) {
378 tprintf("%lu", tcp->u_arg[0]);
Roland McGrath54b90d72005-12-02 03:57:07 +0000379 if (indirect_ipccall(tcp)) {
380 tprintf(", %#lx", tcp->u_arg[3]);
381 tprintf(", ");
382 printflags(shm_flags, tcp->u_arg[1], "SHM_???");
383 } else {
384 tprintf(", %#lx", tcp->u_arg[1]);
385 tprintf(", ");
386 printflags(shm_flags, tcp->u_arg[2], "SHM_???");
387 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000388 if (syserror(tcp))
389 return 0;
390#ifdef LINUX
391 if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
392 return RVAL_NONE;
393 tcp->u_rval = raddr;
394#endif /* LINUX */
395 return RVAL_HEX;
396 }
397 return 0;
398}
399
400int sys_shmdt(tcp)
401struct tcb *tcp;
402{
Roland McGrath54b90d72005-12-02 03:57:07 +0000403 if (entering(tcp)) {
404 if (indirect_ipccall(tcp)) {
405 tprintf("%#lx", tcp->u_arg[3]);
406 } else {
407 tprintf("%#lx", tcp->u_arg[0]);
408 }
409 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000410 return 0;
411}
412
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000413#endif /* defined(LINUX) || defined(SUNOS4) || defined(FREEBSD) */
Roland McGrath4df13c12004-04-16 21:48:40 +0000414
415#ifdef LINUX
Dmitry V. Levin9b5b67e2007-01-11 23:19:55 +0000416int
417sys_mq_open(struct tcb *tcp)
Roland McGrath4df13c12004-04-16 21:48:40 +0000418{
419 if (entering(tcp)) {
420 printpath(tcp, tcp->u_arg[0]);
421 tprintf(", ");
422 /* flags */
Denys Vlasenkoeedaac72009-03-10 20:41:58 +0000423 tprint_open_modes(tcp->u_arg[1]);
Roland McGrath4df13c12004-04-16 21:48:40 +0000424 if (tcp->u_arg[1] & O_CREAT) {
425# ifndef HAVE_MQUEUE_H
426 tprintf(", %lx", tcp->u_arg[2]);
427# else
428 struct mq_attr attr;
429 /* mode */
430 tprintf(", %#lo, ", tcp->u_arg[2]);
431 if (umove(tcp, tcp->u_arg[3], &attr) < 0)
432 tprintf("{ ??? }");
433 else
434 tprintf("{mq_maxmsg=%ld, mq_msgsize=%ld}",
435 attr.mq_maxmsg, attr.mq_msgsize);
436# endif
437 }
438 }
439 return 0;
440}
441
Dmitry V. Levin9b5b67e2007-01-11 23:19:55 +0000442int
443sys_mq_timedsend(struct tcb *tcp)
Roland McGrath4df13c12004-04-16 21:48:40 +0000444{
445 if (entering(tcp)) {
446 tprintf("%ld, ", tcp->u_arg[0]);
447 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
448 tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]);
449 printtv(tcp, tcp->u_arg[4]);
450 }
451 return 0;
452}
453
Dmitry V. Levin9b5b67e2007-01-11 23:19:55 +0000454int
455sys_mq_timedreceive(struct tcb *tcp)
Roland McGrath4df13c12004-04-16 21:48:40 +0000456{
457 if (entering(tcp))
458 tprintf("%ld, ", tcp->u_arg[0]);
459 else {
460 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
461 tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]);
462 printtv(tcp, tcp->u_arg[4]);
463 }
464 return 0;
465}
466
Dmitry V. Levin9b5b67e2007-01-11 23:19:55 +0000467int
468sys_mq_notify(struct tcb *tcp)
Roland McGrath4df13c12004-04-16 21:48:40 +0000469{
470 if (entering(tcp)) {
471 tprintf("%ld, ", tcp->u_arg[0]);
472 printsigevent(tcp, tcp->u_arg[1]);
473 }
474 return 0;
475}
476
Dmitry V. Levin9b5b67e2007-01-11 23:19:55 +0000477static void
478printmqattr(struct tcb *tcp, long addr)
Roland McGrath4df13c12004-04-16 21:48:40 +0000479{
480 if (addr == 0)
481 tprintf("NULL");
482 else {
483# ifndef HAVE_MQUEUE_H
484 tprintf("%#lx", addr);
485# else
486 struct mq_attr attr;
487 if (umove(tcp, addr, &attr) < 0) {
488 tprintf("{...}");
489 return;
490 }
491 tprintf("{mq_flags=");
Denys Vlasenkoeedaac72009-03-10 20:41:58 +0000492 tprint_open_modes(attr.mq_flags);
Roland McGrath4df13c12004-04-16 21:48:40 +0000493 tprintf(", mq_maxmsg=%ld, mq_msgsize=%ld, mq_curmsg=%ld}",
494 attr.mq_maxmsg, attr.mq_msgsize, attr.mq_curmsgs);
495# endif
496 }
497}
498
Dmitry V. Levin9b5b67e2007-01-11 23:19:55 +0000499int
500sys_mq_getsetattr(struct tcb *tcp)
Roland McGrath4df13c12004-04-16 21:48:40 +0000501{
502 if (entering(tcp)) {
503 tprintf("%ld, ", tcp->u_arg[0]);
504 printmqattr(tcp, tcp->u_arg[1]);
505 tprintf(", ");
506 } else
507 printmqattr(tcp, tcp->u_arg[2]);
508 return 0;
509}
510#endif