home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / next / programm / 7246 < prev    next >
Encoding:
Text File  |  1992-11-15  |  1.6 KB  |  41 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!email!news
  3. From: rainer@ruble.fml.tuwien.ac.at (Rainer Staringer)
  4. Subject: Re: Serial port communication difficulties
  5. Message-ID: <1992Nov16.080905.25111@email.tuwien.ac.at>
  6. Sender: news@email.tuwien.ac.at
  7. Nntp-Posting-Host: moolah.fml.tuwien.ac.at
  8. Reply-To: rainer@eimoni.tuwien.ac.at
  9. Organization: Technical University of Vienna
  10. References: <JDAWSON.92Nov15131012@donald.cc.utexas.edu>
  11. Date: Mon, 16 Nov 1992 08:09:05 GMT
  12. Lines: 27
  13.  
  14. In article <JDAWSON.92Nov15131012@donald.cc.utexas.edu>  
  15. jdawson@ccwf.cc.utexas.edu (John Dawson) writes:
  16.  
  17. [lots of helpful hints deleted...]
  18.  
  19. > If NeXT were running on a real version of UNIX, you'd have more
  20. > options available.  For example, on a Sun, you could use fcntl() to
  21. > set a flag called FNDELAY on an open file descriptor that would mark
  22. > it as non-blocking.  Then, you could use fread(); it would just return
  23. > 0 when there was no more input waiting on your stream.  But NOOOOOOOO
  24. > .... If NeXT were even POSIX-compliant, which they said they were going
  25. > to be come 3.0, they'd have a similar facility.
  26.  
  27. int n = 1;
  28. ioctl (fd, FIONBIO, &n);
  29.  
  30. worked fine for me last time I checked...
  31.  
  32. I have not yet met any OS where fcntl worked correctly in all cases.
  33. For instance on Apollos using fcntl with the FNDELAY flag succeeded in
  34. making the descriptor non-blocking but always returned -1, with the
  35. errno set to something ridiculous... I have heard rumors that fcntl is
  36. some late addition to BSD, that they never really got right.
  37.  
  38. --
  39. Rainer Staringer                   | rainer@fml.tuwien.ac.at
  40. Financial Markets Lab, TU Vienna   | +43 (1) 58801/8138
  41.