* Satyajeet Seth <[EMAIL PROTECTED]> [001212 02:21] wrote:
> Hi
> 
> Is it possible to implement threads in FreeBSD 4.0 kernel using the rfork
> system call? If yes, could you give an example?
> 
> 
> I tried to get the following piece of code to work without success.
> 
> #include <unistd.h>
> main()
> {
>         if (rfork( RFPROC | RFNOWAIT | RFMEM | RFSIGSHARE ) > 0)
>         {
>                 while(1)
>                         printf ("Parent process's pid = %d\n", getpid());
>         }
>         while(1)
>                 printf ("Child process's pid = %d\n", getpid());
> }

Use the linuxthreads port and you'll save yourself a lot of
work.

Btw, this question gets asked once or twice a week on this list,
you should check the archives before posting to -hackers.

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to