On Wed, Jun 11, 2003 at 06:30:57PM +0530 or thereabouts, Sharma, Tarun seemed to write:
> while running a program I found that fork was giving some error. Can anybody
> tell me why fork can give error and whats the solution for not getting this
> problem ?
Is it your program?
If so, do something like this:
int kid_pid;
/* ... later ... */
switch (kid_pid = fork()) {
case -1:
perror ("myprogram: fork()");
exit (1);
/* ... rest of it ... */
}
If not, the program is not giving you enough info :-)
You may be able to attach it in gdb and break fork,
step until the next line of code after the fork, and
print (char *) strerror (errno).
HTH,
-- Josh
>
>
> Tarun
> _______________________________________________
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"