Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Oct 1998 17:07:12 -0400
From:      Geoffrey Robinson <geoffr@globalserve.net>
To:        questions@FreeBSD.ORG
Subject:   Interrupted System Calls Infinite Loop
Message-ID:  <36211E00.DDFD2346@globalserve.net>

next in thread | raw e-mail | index | archive | help
A friend of mine is working on a CGI that runs as many as 6 times a second
and reads and writes to several files each time it runs. One file in
particular that is opened with fopen() as read only is failing with errno
EINTR. I looked up interrupted system calls in _Advanced Programming in the
UNIX Environment_ by W. Richard Stevens who suggest handling the error by
simply retrying the system call repeatedly until it succeeds. However doing
this results in an infinite loop as the system call never succeeds on any
successive retry. Furthermore Richard Stevens goes on to say that 4.3+BSD
should restart the system call itself if it is interrupted and disk I/O
shouldn't be interrupted in the first place.

As far as we can tell this happens about ounce every 100 times the CGI
runs. Otherwise the CGI runs normally. Reads on other files never fail in
this manner; the file is a regular disk file and the CGI is compiled using
gcc 2.7.2.1 on FreeBSD 2.2.5 RELEASE. 

Thanks in advance for any solution or explanation of this problem.

-- 
Geoffrey Robinson
geoffr@globalserve.net
Oakville, Ontario, Canada.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36211E00.DDFD2346>