Article View: comp.sys.next.programmer
Article #1778Re: Serial port communication difficulties
From: Rainer Staringer
Date: Mon, 16 Nov 1992 08:09
Date: Mon, 16 Nov 1992 08:09
27 lines
1693 bytes
1693 bytes
In article <JDAWSON.92Nov15131012@donald.cc.utexas.edu> jdawson@ccwf.cc.utexas.edu (John Dawson) writes: [lots of helpful hints deleted...] > If NeXT were running on a real version of UNIX, you'd have more > options available. For example, on a Sun, you could use fcntl() to > set a flag called FNDELAY on an open file descriptor that would mark > it as non-blocking. Then, you could use fread(); it would just return > 0 when there was no more input waiting on your stream. But NOOOOOOOO > .... If NeXT were even POSIX-compliant, which they said they were going > to be come 3.0, they'd have a similar facility. int n = 1; ioctl (fd, FIONBIO, &n); worked fine for me last time I checked... I have not yet met any OS where fcntl worked correctly in all cases. For instance on Apollos using fcntl with the FNDELAY flag succeeded in making the descriptor non-blocking but always returned -1, with the errno set to something ridiculous... I have heard rumors that fcntl is some late addition to BSD, that they never really got right. -- Rainer Staringer | rainer@fml.tuwien.ac.at Financial Markets Lab, TU Vienna | +43 (1) 58801/8138
Technical Details
Message-ID:
<1992Nov16.080905.25111@email.tuwien.ac.at>Path:
arc1-ca.pugleaf.net!sparky!uunet!email!newsReferences:
<JDAWSON.92Nov15131012@donald.cc.utexas.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!email!news From: rainer@ruble.fml.tuwien.ac.at (Rainer Staringer) Subject: Re: Serial port communication difficulties Message-ID: <1992Nov16.080905.25111@email.tuwien.ac.at> Sender: news@email.tuwien.ac.at Nntp-Posting-Host: moolah.fml.tuwien.ac.at Reply-To: rainer@eimoni.tuwien.ac.at Organization: Technical University of Vienna References: <JDAWSON.92Nov15131012@donald.cc.utexas.edu> Date: Mon, 16 Nov 1992 08:09:05 GMT Lines: 27