Oracle beq and popen ()

I have a program like this (for the Pro * C precompiler):

#include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <errno.h> EXEC SQL BEGIN DECLARE SECTION; static VARCHAR ora_connect_str[81]; EXEC SQL END DECLARE SECTION; EXEC SQL INCLUDE SQLCA; int main() { FILE *f; int rc = 1; char *eptr=getenv("DB_LOGIN"); strcpy(ora_connect_str.arr, eptr); ora_connect_str.len = strlen(eptr); EXEC SQL CONNECT :ora_connect_str; f=popen("exit 0", "r"); rc = pclose(f); printf("errno=%d rc=%d\n", errno, rc); } 

When I use tcp / ip connection with oracle, it works fine. But when I use BEQ, pclose () returns -1 with errno 10. Can someone direct me to the document (s) describing possible problems with BEQ connections? It seems that somewhere inside the inlay of the oracle there is a wait () call already ...

+4
source share
1 answer

Take a look at this post: http://openacs.org/forums/message-view?message_id=187522

An important section is:

  /* Restore SIGCHLD since Oracle10 client has trapped it **SG** */ signal(SIGCHLD, SIG_DFL); 

Try adding it before calling "popen", it should work.

You will have to deal with what Oracle is trying to ignore, although zombie processes are either hanging.

0
source

Source: https://habr.com/ru/post/1368980/


All Articles