[so] Fw: [Tema 2][linux] mq_receive returneaza Bad file descriptor
Claudiu Olteanu
olteanu.claudiu at ymail.com
Wed Apr 10 11:07:28 EEST 2013
Am procedat in felul urmator: am pus un sleep inainte de mq_receive, am rulat programul cu strace cum ai zis si tu si am afisat cu lsof fisierele deschise de procesul respectiv.
- strace imi returneaza :
[pid 3142] mq_timedreceive(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8193, 0, NULL) = -1 EBADF (Bad file descriptor)
- "lsof -a -p 3142 " in momentul respectiv imi afiseaza pe ultima linie
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
test2 3142 clau 4w REG 0,13 80 17577 /queue_1
________________________________
From: Adrian Sendroiu <molecula2788 at gmail.com>
To: Claudiu Olteanu <olteanu.claudiu at ymail.com>
Cc: Sisteme de Operare <so at cursuri.cs.pub.ro>
Sent: Wednesday, April 10, 2013 9:42 AM
Subject: Re: [so] [Tema 2][linux] mq_receive returneaza Bad file descriptor
Claudiu Olteanu <olteanu.claudiu at ymail.com> writes:
> Salut!
>
> Nu imi dau seama de ce atunci cand incerc sa fac preiau ceva de pe
> coada imi da Bad file descriptor. Sa pun pe ea nu intampin nicio
> problema. File descriptorul este identic cu cel intors de
> mq_open. Aveti idee care ar putea fi problema?
>
> Apelul functiei mele arata ceva de genul : mq_receive(mq, (char *)msg,
> attr.mq_msgsize + 1 , NULL);
>
> Multumesc, Claudiu
Salut,
Esti sigur ca file descriptorul e bun? Cum ai verificat?
Incearca si cu strace
strace -f -etrace=mq_timedreceive comanda
Adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20130410/bbe0211d/attachment.html>
More information about the so
mailing list