diff options
author | marcel <marcel@FreeBSD.org> | 1999-08-16 11:49:30 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-08-16 11:49:30 +0000 |
commit | bb62e6fb8596301eafd991549ca8e8d483a626b5 (patch) | |
tree | 7ecaa95058df8069c383503d881fc6c360b9a7f8 /sys/i386/linux | |
parent | f909574334998e6f81a18fb4c70e45f9cc371aa8 (diff) | |
download | FreeBSD-src-bb62e6fb8596301eafd991549ca8e8d483a626b5.zip FreeBSD-src-bb62e6fb8596301eafd991549ca8e8d483a626b5.tar.gz |
Implement linux_vfork() syscall by calling vfork(). Analogous to the
linux_fork() implementation.
Diffstat (limited to 'sys/i386/linux')
-rw-r--r-- | sys/i386/linux/linux_misc.c | 19 | ||||
-rw-r--r-- | sys/i386/linux/linux_proto.h | 6 | ||||
-rw-r--r-- | sys/i386/linux/linux_syscall.h | 3 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysent.c | 4 |
4 files changed, 27 insertions, 5 deletions
diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c index 684a9fc..6bdadce 100644 --- a/sys/i386/linux/linux_misc.c +++ b/sys/i386/linux/linux_misc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.62 1999/08/15 13:28:35 marcel Exp $ + * $Id: linux_misc.c,v 1.63 1999/08/15 17:28:39 marcel Exp $ */ #include "opt_compat.h" @@ -575,6 +575,23 @@ linux_fork(struct proc *p, struct linux_fork_args *args) return 0; } +int +linux_vfork(struct proc *p, struct linux_vfork_args *args) +{ + int error; + +#ifdef DEBUG + printf("Linux-emul(%ld): fork()\n", p->p_pid); +#endif + + if ((error = vfork(p, (struct vfork_args *)args)) != 0) + return error; + /* Are we the child? */ + if (p->p_retval[1] == 1) + p->p_retval[0] = 0; + return 0; +} + #define CLONE_VM 0x100 #define CLONE_FS 0x200 #define CLONE_FILES 0x400 diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index e5aefb9..d3f742c 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * created from Id: syscalls.master,v 1.21 1999/08/15 17:25:56 marcel Exp + * created from Id: syscalls.master,v 1.22 1999/08/16 11:47:21 marcel Exp */ #ifndef _LINUX_SYSPROTO_H_ @@ -423,6 +423,9 @@ struct linux_getcwd_args { char * buf; char buf_[PAD_(char *)]; unsigned long bufsize; char bufsize_[PAD_(unsigned long)]; }; +struct linux_vfork_args { + register_t dummy; +}; int linux_setup __P((struct proc *, struct linux_setup_args *)); int linux_fork __P((struct proc *, struct linux_fork_args *)); int linux_open __P((struct proc *, struct linux_open_args *)); @@ -529,6 +532,7 @@ int linux_rt_sigaction __P((struct proc *, struct linux_rt_sigaction_args *)); int linux_rt_sigprocmask __P((struct proc *, struct linux_rt_sigprocmask_args *)); int linux_chown __P((struct proc *, struct linux_chown_args *)); int linux_getcwd __P((struct proc *, struct linux_getcwd_args *)); +int linux_vfork __P((struct proc *, struct linux_vfork_args *)); #ifdef COMPAT_43 diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h index 963fab5..3e75060 100644 --- a/sys/i386/linux/linux_syscall.h +++ b/sys/i386/linux/linux_syscall.h @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from Id: syscalls.master,v 1.21 1999/08/15 17:25:56 marcel Exp + * created from Id: syscalls.master,v 1.22 1999/08/16 11:47:21 marcel Exp */ #define LINUX_SYS_linux_setup 0 @@ -167,4 +167,5 @@ #define LINUX_SYS_linux_rt_sigprocmask 175 #define LINUX_SYS_linux_chown 182 #define LINUX_SYS_linux_getcwd 183 +#define LINUX_SYS_linux_vfork 190 #define LINUX_SYS_MAXSYSCALL 191 diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index 41cce48..a98b32f 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from Id: syscalls.master,v 1.21 1999/08/15 17:25:56 marcel Exp + * created from Id: syscalls.master,v 1.22 1999/08/16 11:47:21 marcel Exp */ #include "opt_compat.h" @@ -204,5 +204,5 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys }, /* 187 = sendfile */ { 0, (sy_call_t *)nosys }, /* 188 = getpmsg */ { 0, (sy_call_t *)nosys }, /* 189 = putpmsg */ - { 0, (sy_call_t *)nosys }, /* 190 = vfork */ + { 0, (sy_call_t *)linux_vfork }, /* 190 = linux_vfork */ }; |