exec/exit with vfork.
OK bluhm@
-# $OpenBSD: Makefile,v 1.11 2021/09/02 12:40:44 mbuhl Exp $
+# $OpenBSD: Makefile,v 1.12 2021/09/02 15:28:41 mbuhl Exp $
# Copyright (c) 2019 Moritz Buhl <openbsd@moritzbuhl.de>
# Copyright (c) 2019 Alexander Bluhm <bluhm@openbsd.org>
PROGS += t_syscall
PROGS += t_truncate
PROGS += t_umask t_unlink
+PROGS += t_vfork
PROGS += t_wait_noproc
PROGS += t_wait_noproc_wnohang
PROGS += t_write
REGRESS_EXPECTED_FAILURES += run-t_stat-5
REGRESS_EXPECTED_FAILURES += run-t_unlink-2
+run-t_vfork-2:
+ # SIGSTOP with vfork is masked before exec(3)/exit(3)
+ # see NetBSD: kern_sig.c,v 1.345
+ @echo DISABLED
+
. for p in ${PROGS}
SRCS_$p = $p.c atf-c.c
. endfor
t_select - remove sigset_t struct as it is int on OpenBSD
t_setrlimit - remove unsupported resource parameters and lwp
t_syscall - add __syscall prototype
+t_vfork - SIGSTOP is masked before exec(3)/exit(3)
t_wait_noproc - waitid and wait6 are not implemented
t_wait_noproc_wnohang - waitid and wait6 are not implemented
t_pipe2 - closefrom(4) == -1, remove F_GETNOSIGPIPE and nosigpipe test
t_stat - invalid GID with doas
t_unlink - wrong errno according to POSIX
-t_vfork - !(((status) & 0177) == 0) evaluated to false, SIGSTOP wrong
Excluded tests:
t_clock_nanosleep - not available
-/* $OpenBSD: macros.h,v 1.3 2021/09/02 12:40:44 mbuhl Exp $ */
+/* $OpenBSD: macros.h,v 1.4 2021/09/02 15:28:41 mbuhl Exp $ */
/* Public domain - Moritz Buhl */
#include <sys/param.h>
#define kinfo_proc2 kinfo_proc
#define KERN_PROC2 KERN_PROC
#define reallocarr(pp, n, s) ((*pp = reallocarray(*pp, n, s)), *pp == NULL)
+#define LSSTOP SSTOP
/* t_mlock.c */
#define MAP_WIRED __MAP_NOREPLACE
-/* $OpenBSD: t_fork.c,v 1.1 2021/09/02 12:40:44 mbuhl Exp $ */
+/* $OpenBSD: t_fork.c,v 1.2 2021/09/02 15:28:41 mbuhl Exp $ */
/* $NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $ */
/*-
__RCSID("$NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $");
#include <sys/param.h>
+#ifdef __OpenBSD__
+#include <sys/proc.h>
+#endif
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/wait.h>
continue;
if (p[i].p_ppid != process)
continue;
-#ifndef __OpenBSD__
if (p[i].p_stat != LSSTOP)
continue;
-#endif
child = p[i].p_pid;
break;
}
--- /dev/null
+/* $OpenBSD: t_vfork.c,v 1.1 2021/09/02 15:28:41 mbuhl Exp $ */
+/* $NetBSD: t_vfork.c,v 1.1 2018/05/18 06:39:58 kamil Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define VFORK
+#include "t_fork.c"