URGENT : Help needed with system()/fork() call 
Author Message
 URGENT : Help needed with system()/fork() call

Hi,

I want to execute a shell script from my c program when some conditions
are true and have tried using system() and execl() with fork(). However
the program is a multithreaded one and upn execution it gives
segmentation fault and dumps core. Debug of the core file indicates it
to be coming from a library running in a different thread.

Please suggest me how else can I call the script or how can I take care
of this multithreading problem.

Thanks,
Sanjay.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 10 Jul 2002 03:00:00 GMT  
 URGENT : Help needed with system()/fork() call

Quote:

>Hi,

>I want to execute a shell script from my c program when some conditions
>are true and have tried using system() and execl() with fork(). However
>the program is a multithreaded one and upn execution it gives
>segmentation fault and dumps core. Debug of the core file indicates it
>to be coming from a library running in a different thread.

>Please suggest me how else can I call the script or how can I take care
>of this multithreading problem.

Unfortunately C has no support for multithreading (or execl() or fork()
for that matter). You'll probably have better luck asking the Unix experts
in comp.unix.programmer or a newsgroup relating to your particular OS.
There is also a threads related newsgroup comp.programming.threads.

--
-----------------------------------------


-----------------------------------------



Wed, 10 Jul 2002 03:00:00 GMT  
 URGENT : Help needed with system()/fork() call

Quote:
>Hi,

>I want to execute a shell script from my c program when some conditions
>are true and have tried using system() and execl() with fork(). However
>the program is a multithreaded one and upn execution it gives
>segmentation fault and dumps core. Debug of the core file indicates it
>to be coming from a library running in a different thread.

>Please suggest me how else can I call the script or how can I take care
>of this multithreading problem.

These features are not a part of ISO-C. Please consult one of the numerous
Unix or Unix-like groups on Usenet. And read theire FAQ first.

--
-hs-
CLC-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
ISO-C Library: http://www.dinkum.com/htm_cl
"It's specified. But anyone who writes code like that should be
transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC



Wed, 10 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need urgent help with this (fork, dup, pipes)

2. [Help : using fork() system call

3. Urgent Help Needed-Calling the help file.

4. Inexplicable System call failure - HELP - expert needed

5. Inexplicable system call failure! HELP-Expert Needed

6. system call in Sun OS - need help

7. Help with system calls needed

8. URGENT URGENT dlopen() help needed...

9. HELP:perform system call or call an external program

10. Urgent info needed re: system V Curses Lib and C-ISAM LIB for VMS

11. Need advice/help with fork()

12. Unix: Need help with fork() or other methods of multithreading

 

 
Powered by phpBB® Forum Software