home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / language / sbprolog / syscall.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-23  |  769 b   |  30 lines

  1. /*
  2. syscall.c by David Roch
  3. This routine translates some of the Berkely Unix (tm)
  4. system calls to the Amiga.
  5. Works on atari too.
  6. */
  7.  
  8. #include <stdio.h>
  9. #include "syscall.h"
  10. typedef unsigned int call_args;
  11. syscall(n, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
  12. int    n;
  13. call_args    arg1, arg2, arg3, arg4, arg5, arg6, arg7;
  14. {
  15.     switch (n) {
  16.  
  17.         case SYS_chdir:
  18.             return(chdir(arg1));
  19.         case SYS_chmod:
  20.             return(chmod(arg1, arg2));
  21.         case SYS_access:
  22.             return(access(arg1, arg2));
  23.         default:
  24.             printf("System call %d has not yet been implemented in this port of SBProlog.\n",
  25.                 "If you wish to add this system primitive, you must add the proper case\n",
  26.                 "statement to the C source file syscall.c and recompile.\n");
  27.             return(-1); /* command failed (hopefully) */
  28.         }
  29. }
  30.