Re: sqlturbo connection gets inherited
Posted in 1994
FOLLOWUP: The Informix ESQL/C documentation (sqldetach doc) seems to imply that connections to sqlturbo will only be inherited by child processes created by a fork() (with no exec()). This is as I would expect. However, we are using fork()/exec() combinations and system() calls. In both cases, the child maintains the parent's sqlturbo association because of the pipe connection. To work around this problem, I have added the following logic to the parent process: After connecting to Informix intially, examine all file handles using fstat(). For each file which is a FIFO (pipe), use fcntl() to set the FD_CLOEXEC flag (close on exec()). This ensures that child processes which are exec'ed will not maintain the connection to sqlturbo. -- ------------------------------------------------------------------------------- Todd Saylor | Bi-Tech Software, Inc. "No matter where you go, there you are" | (916) 891-5281 ----------- Opinions expressed are subject to change without notice -----------