1 //===- FuzzerUtilLinux.cpp - Misc utils for Linux. ------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // Misc utils for Linux.
9 //===----------------------------------------------------------------------===//
10 #include "FuzzerDefs.h"
11 #if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD ||                \
12     LIBFUZZER_OPENBSD
13 #include "FuzzerCommand.h"
14 
15 #include <stdlib.h>
16 
17 namespace fuzzer {
18 
19 int ExecuteCommand(const Command &Cmd) {
20   std::string CmdLine = Cmd.toString();
21   return system(CmdLine.c_str());
22 }
23 
24 } // namespace fuzzer
25 
26 #endif
27