11-02-2005 02:12 AM
I want to run my program as a daemon under SUSE Linux 9.2 (NI driver 2.3). But when I demonize the process the fist driver function call results in a segmentation fault. I post a part of the source to show you what I do:
if(pid != 0)
exit(EXIT_SUCCESS);
setsid();
signal(SIGHUP,SIG_IGN);
if(fork != 0)
exit(EXIT_SUCCESS);
chdir(“/”);
unmask(0);
for(i = sysconf(_SC_OPEN_MAX); i > 0; I --)
close(i);
/****************************
**** some other code ****
****************************/
SendIFC(0); /***segmentation fault***/
11-02-2005 09:32 AM
11-02-2005 04:35 PM
11-03-2005 10:09 AM
05-31-2006 09:57 AM