curl_main.c 500 B

12345678910111213141516171819202122
  1. /* host-curl: the browser's __serve helper, built for Linux. */
  2. #include <signal.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include "host.h"
  7. extern void curl_start(const char *arg);
  8. int main(int argc, char **argv)
  9. {
  10. const char *root = getenv("NEBOS_HOST_ROOT");
  11. memset(&host_opts, 0, sizeof(host_opts));
  12. host_opts.headless = 1;
  13. if (host_runtime_init(argv[0], root) != 0)
  14. return 1;
  15. signal(SIGPIPE, SIG_IGN);
  16. curl_start(argc > 1 && argv[1] ? argv[1] : "");
  17. return 0;
  18. }