Check for status NULL argument in wait4 and waitpid. From PR #1392

by Thomas EberHardt.
This commit is contained in:
fvdl 1995-08-21 23:15:51 +00:00
parent 7560ab9b68
commit 7cd62a508c
16 changed files with 432 additions and 208 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_break.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_break.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_misc.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_misc_notalpha.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldmmap.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_oldmmap.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldselect.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_oldselect.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_olduname.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_pipe.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_pipe.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_misc.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_break.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_break.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_misc_notalpha.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldmmap.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_oldmmap.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldselect.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_oldselect.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_olduname.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_pipe.c,v 1.15 1995/08/21 03:42:09 mycroft Exp $ */
/* $NetBSD: linux_pipe.c,v 1.16 1995/08/21 23:15:51 fvdl Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -112,8 +112,11 @@ linux_waitpid(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -123,12 +126,16 @@ linux_waitpid(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*
@ -149,8 +156,11 @@ linux_wait4(p, uap, retval)
int error, *status, tstat;
caddr_t sg;
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
if (SCARG(uap, status) != NULL) {
sg = stackgap_init(p->p_emul);
status = (int *) stackgap_alloc(&sg, sizeof status);
} else
status = NULL;
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
@ -160,12 +170,16 @@ linux_wait4(p, uap, retval)
if ((error = wait4(p, &w4a, retval)))
return error;
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))
return error;
bsd_to_linux_wstat(&tstat);
bsd_to_linux_wstat(&tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
return copyout(&tstat, SCARG(uap, status), sizeof tstat);
}
return 0;
}
/*