sysfunc.c 591 B

123456789101112131415161718192021222324
  1. /* vim: tabstop=4 shiftwidth=4 noexpandtab
  2. * This file is part of ToaruOS and is released under the terms
  3. * of the NCSA / University of Illinois License - see LICENSE.md
  4. * Copyright (C) 2013 K. Lange
  5. *
  6. * sysfunc
  7. *
  8. * Executes an "extended system function" which
  9. * is basically just a super-syscall.
  10. */
  11. #include <stdlib.h>
  12. #include <stdio.h>
  13. #include <errno.h>
  14. #include <sys/sysfunc.h>
  15. int main(int argc, char ** argv) {
  16. if (argc < 2) return 1;
  17. int ret = sysfunc(atoi(argv[1]), &argv[2]);
  18. if (ret < 0) {
  19. fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
  20. }
  21. return ret;
  22. }