A daemon process, on detecting the presence of a text file in a particular directory then launches an executable file which opens the aforementioned text file in order to read and then transmit its data over a TCP socket.
The number of the file descriptor of the opened text file is logged along with other information about the processing of the file.
It has been noticed that from time to time, the file descriptor returned by the open() call is zero (normally this is reserved for stdin). No error is detected and all works well. The source code in C does nothing more that open() and later close() - there is no redirection, duplication or any other wizardry performed on the returned file handle.
Under what circumstances could a process's file descriptor 0 be available for general use (and not attributed to stdin) ?
Platform is AIX 5.2.