Closed file descriptors using RUN statement
Posted in 1991
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
We have a 4gl program initiated by a C program, the C program communicating with the 4gl program via pipes (actually, the 4gl program calls routines written in C to do the communication). This senario relies, of course, on the pipe file descriptors created by the C program remaining open after the 4gl program is initiated. This works fine (i.e. we can communicate via the pipes OK) until the 4gl program decides to "run" another 4gl program. The 4gl program that is "run" will have an error within the C routines that do the pipe communication (errno=9 -- bad file number). We assume this is probably due to Informix closing all open file desciptors when executing the "run" statement. 1. Is this how the run statement works? 2. Our workaround is to write a C function to do the exec for us and this seems to work. Are there potential problems with this approach? Has anyone run into this before? Any thoughts?... ---------------------------------------------------------------------------- Fred Tempereau ANALOG: (619) 259-4372 SNAIL: Fujitsu Systems of America FAX: (619) 792-5377 12670 High Bluff Drive UUCP: uunet!scubed.com!fsadev!fredt San Diego, CA 92130-2013