~ubuntu-branches/ubuntu/lucid/9base/lucid

« back to all changes in this revision

Viewing changes to lib9/fork.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2006-01-25 15:33:00 UTC
  • Revision ID: james.westby@ubuntu.com-20060125153300-6hh4p9wx8iqqply5
Tags: upstream-2
ImportĀ upstreamĀ versionĀ 2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <u.h>
 
2
#include <signal.h>
 
3
#include <libc.h>
 
4
#include "9proc.h"
 
5
#undef fork
 
6
 
 
7
int
 
8
p9fork(void)
 
9
{
 
10
        int pid;
 
11
        sigset_t all, old;
 
12
 
 
13
        sigfillset(&all);
 
14
        sigprocmask(SIG_SETMASK, &all, &old);
 
15
        pid = fork();
 
16
        if(pid == 0){
 
17
                _clearuproc();
 
18
                _p9uproc(0);
 
19
        }
 
20
        sigprocmask(SIG_SETMASK, &old, nil);
 
21
        return pid;
 
22
}