Changeset View
Changeset View
Standalone View
Standalone View
fs/common/fstest_puffs.c
/* $NetBSD: fstest_puffs.c,v 1.11 2013/09/09 19:47:38 pooka Exp $ */ | /* $NetBSD: fstest_puffs.c,v 1.13 2020/06/17 00:16:21 kamil Exp $ */ | ||||
/* | /* | ||||
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. | * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
Show All 31 Lines | |||||
#include <puffsdump.h> | #include <puffsdump.h> | ||||
#include <signal.h> | #include <signal.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <rump/rump.h> | #include <rump/rump.h> | ||||
#include <rump/rump_syscallshotgun.h> | |||||
#include <rump/rump_syscalls.h> | #include <rump/rump_syscalls.h> | ||||
#include "h_fsmacros.h" | #include "h_fsmacros.h" | ||||
#define BUFSIZE (128*1024) | #define BUFSIZE (128*1024) | ||||
#define DTFS_DUMP "-o","dump" | #define DTFS_DUMP "-o","dump" | ||||
static bool mayquit = false; | static bool mayquit = false; | ||||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | donewfs(const atf_tc_t *tc, void **argp, | ||||
switch ((childpid = fork())) { | switch ((childpid = fork())) { | ||||
case 0: | case 0: | ||||
close(sv[1]); | close(sv[1]); | ||||
snprintf(comfd, sizeof(sv[0]), "%d", sv[0]); | snprintf(comfd, sizeof(sv[0]), "%d", sv[0]); | ||||
if (setenv("PUFFS_COMFD", comfd, 1) == -1) | if (setenv("PUFFS_COMFD", comfd, 1) == -1) | ||||
return errno; | return errno; | ||||
if (execvp(theargv[0], theargv) == -1) | execvp(theargv[0], theargv); | ||||
return errno; | return errno; | ||||
case -1: | case -1: | ||||
return errno; | return errno; | ||||
default: | default: | ||||
close(sv[0]); | close(sv[0]); | ||||
break; | break; | ||||
} | } | ||||
/* read args */ | /* read args */ | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |