Date: Tue, 19 Dec 2000 20:01:10 +0300 (MSK) From: Dmitry Dicky <diwil@dataart.com> To: freebsd-hackers@freebsd.org Subject: recvfrom() and signals Message-ID: <XFMail.001219200110.diwil@dataart.com>
next in thread | raw e-mail | index | archive | help
Hello fellows, I just faced with a problem of a strange (may be not documented) recvfrom() behaviour. The fragment of the code is: ... signal(SIGALRM, timeouttrap); alarm(10); i = recvfrom(sock, buf, len, 0, from, fromlen); printf("%d bytes received\n",i); .... void timeouttrap(int sig) { printf(">> %d", sig); return; } I use non blocking socket and it receives data with no problems. When alarm occures, the signal delivered to the process and alarm handler prints a signal number. As I understand after this recvfrom should return -1 and errno should be set to EINTR. BUt, upon signal delivery (actually any signal, CHLD for example) recvfrom() still hangs the program execution and awaits data. However, man pages say that recvfrom() will return -1 if the call has been interrupted. Is this a system bug or just my misunderstanding? Thank you in advance, Dmitry. -- ********************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) DataArt Enterprises, Inc. (_Y_.)' ._ ) `._ `. ``-..-' Serpukhovskaja street, 10 _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 3261780, 5585314 ********************************************************************** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.001219200110.diwil>