X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Nick Bowler Newsgroups: comp.os.msdos.djgpp Subject: Reading /dev/null seems broken. Date: Tue, 15 Jan 2013 04:18:07 +0000 (UTC) Organization: A noiseless patient Spider Lines: 40 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 15 Jan 2013 04:18:07 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="fc3f734a965da4e0c71f7fb34316daf1"; logging-data="4156"; mail-complaints-to="abuse AT eternal-september DOT org"; posting-account="U2FsdGVkX1/hNVsIqA6yAF3JdLoJAjXb" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:yl37JZqqSkUMdTVwRgd2QHDHedk= Bytes: 2554 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi folks, I've been playing around with DJGPP in dosemu, trying to build one of my own C projects using the GNU build system (autoconf, automake, etc.) I installed the latest versions from the "current" directory on the DJGPP FTP site. After some minor configuration struggles, the configure script mostly worked, until it came time to run config.status (a shell script which gets generated and run by the main configure script). At this point, the entire system would (apparently) lock up. I tracked this down to one line in the script which reads from /dev/null, which looks like this: if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then Sure enough, the lockup can easily be reproduced from the DJGPP bash prompt with a similar command: sed 's/x//' < /dev/null > /dev/null which hangs in the same way. If I omit the >/dev/null redirection, then endless garbage data is spewed to the console instead of the expected nothing at all. On a "real" POSIX-y system, this should exit with success since reading from /dev/null will always return 0 (EOF). I replaced the entire test with a simple "true" in the config.status script, and things ran fine. Another instance came up later during the build, with a command similar to: cat /dev/null > file This is expected to produce an empty output file, but instead, gigabytes of garbage are written. Seems to be pretty much the same root problem. While in this case I can work around these problems, should DJGPP be presenting a /dev/null that works properly? Cheers, Nick