/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2019 Danny Robson */ #include #include #include #include #include #include enum { ARG_SELF, ARG_CHILD, NUM_ARGS }; static void print_usage (std::ostream &os, int argc, char **argv) { (void)argc; os << "Usage: " << argv[ARG_SELF] << " [args] ...\n"; } int main (int argc, char **argv) { if (argc < NUM_ARGS) { print_usage (std::cerr, argc, argv); return EXIT_FAILURE; } std::ostringstream os; os << argv[ARG_SELF] << '-' << argv[ARG_CHILD]; cruft::posix::error::try_call (execv, os.str ().c_str (), argv + 1); unreachable (); }