/dev/win devices complain opened as fd's 0,1,2 - why?

Mark J. Kilgard mjk at fluffy.rice.edu
Sat Jun 3 14:18:58 AEST 1989


One of the major limitations of SunView1 is that you up file descriptors
when you use windows.  I am writing an application that uses quite a few
windows (and file descriptors for other purposes) and have run into the
limit (even with the 64 in SunOS 4.0).  

In an effort to conserve file descriptors, I decided I would close stdin
and stdout since they are not used that way I could get two more fd's.

This works the only problems is that window devices bitch to stderr (I
assume) when they are used as stdin or stdout.  (According to the message
it sounds like it would bitch if it was opened as stderr too - but I'm not
sure where it would bitch too.  Hmm.)

Is there a better way to conserve file descriptors?  Is there a way to get
rid of the messages? 

It is my guess the messages are just warnings (my program still works fine
with stdin and stdout closed).  Am I correct about this?  Is closing these
fd's bad news for SunView programs.

- Mark



More information about the Comp.sys.sun mailing list