read from pty returns EAGAIN

Jason Heirtzler jdh at bu-pub.bu.edu
Tue Apr 2 02:12:33 AEST 1991


When I read from a pty that I've set up, it's returning EAGAIN if the
process on the slave side hasn't written anything (yet.)

If I understand the man page(s) correctly, it seems to imply that
you can use fcntl to clear O_NDELAY and O_NONBLOCK on the file descriptor,
and the read from the master side will block until data is ready.  This
doesn't seem to be what is happening, however.   I could kludge it, and
retry the read when (errno==EAGAIN) but that's pretty ugly.  Can someone
let me know what the "proper" way to do this is?

Please send responses via email.  Thanks.

-------------------------------------------------------------------
Jason Heirtzler           (617) 353-2780       jdh at bu-pub.bu.edu
Information Technology    Boston University    ..!bu.edu!bu-pub!jdh  



More information about the Comp.sys.sgi mailing list