blob: db4888a25e716b81f38f9880af7cd6ae4d3ed848 [file] [log] [blame]
Robert Swiecki0e673882016-03-31 18:50:29 +02001/*
2 *
3 * honggfuzz - routines dealing with subprocesses
4 * -----------------------------------------
5 *
6 * Author: Robert Swiecki <swiecki@google.com>
7 *
8 * Copyright 2010-2015 by Google Inc. All Rights Reserved.
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License. You may obtain
12 * a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19 * implied. See the License for the specific language governing
20 * permissions and limitations under the License.
21 *
22 */
23
24#ifndef _HF_SUBPROC_H_
25#define _HF_SUBPROC_H_
26
Robert Swiecki10eeb0a2017-09-28 15:42:52 +020027#include "honggfuzz.h"
Jaggerc8b6eda2016-09-01 03:52:35 +020028
29/* Missing WIFCONTINUED in Android */
30#ifndef WIFCONTINUED
31#define WIFCONTINUED(x) WEXITSTATUS(0)
32#endif
33
Robert Swiecki0e673882016-03-31 18:50:29 +020034extern const char *subproc_StatusToStr(int status, char *str, size_t len);
Robert Swieckieab0e862016-10-18 23:04:42 +020035
Jaggerc7743512016-08-31 22:00:19 +020036extern bool subproc_PrepareExecv(honggfuzz_t * hfuzz, fuzzer_t * fuzzer, const char *fileName);
Robert Swieckieab0e862016-10-18 23:04:42 +020037
Robert Swiecki940a0802016-11-02 12:42:09 +010038extern bool subproc_Run(honggfuzz_t * hfuzz, fuzzer_t * fuzzer);
Robert Swieckieab0e862016-10-18 23:04:42 +020039
Jaggerc4729592016-09-02 01:52:30 +020040extern bool subproc_persistentModeRoundDone(honggfuzz_t * hfuzz, fuzzer_t * fuzzer);
Robert Swieckieab0e862016-10-18 23:04:42 +020041
Robert Swiecki810d2c92017-06-01 21:37:27 +020042extern uint8_t subproc_System(honggfuzz_t * hfuzz, fuzzer_t * fuzzer, const char *const argv[]);
Robert Swiecki0e673882016-03-31 18:50:29 +020043
Robert Swieckifddc0862016-10-27 12:42:46 +020044extern void subproc_checkTimeLimit(honggfuzz_t * hfuzz, fuzzer_t * fuzzer);
45
Robert Swiecki4f09ce02017-02-25 22:47:55 +010046extern void subproc_checkTermination(honggfuzz_t * hfuzz, fuzzer_t * fuzzer);
47
Robert Swiecki0e673882016-03-31 18:50:29 +020048#endif