#include #include char buf[8192]; #define NARG 5 int arg[NARG]; int sysr1(void); struct{ char *name; int (*func)(...); }tab[]={ #include "tab.h" 0, 0 }; int main(int argc, char *argv[]) { int i, r; int oflag=0; int parse(char *); char ebuf[ERRLEN]; ARGBEGIN{ case 'o': oflag++; break; default: goto Usage; }ARGEND if(argc<1 || argc>1+NARG){ Usage: fprint(2, "usage: syscall [-o] entry [args; buf==1024 byte buffer]\n"); fprint(2, "\tsyscall write 1 hello 5\n"); fprint(2, "\tsyscall -o lasterr buf\n"); return 1; } for(i=1; is && *t==0) return l; return (int)s; }