Restored work-around for hangs when trying to use disk-based handlers
[tangerine.git] / compiler / clib / stubs / genstubs.c
bloba99324d0144dd497cc93da898e09c4354bf46421
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: stub function generator for clib functions
6 Lang: english
7 */
9 #include "archspecific.h"
11 #undef __const
13 #include <stdio.h>
14 #include <string.h>
15 #include <stdlib.h>
17 #define SYSTEM_CALL(name, alias...) { #name , #alias },
19 struct
21 char *name;
22 char *alias;
23 } syscalls [] =
25 #include "../include/sys/syscall.def"
26 { NULL, NULL }
29 int main(int argc, char *argv[])
31 int n;
33 if (argc != 2)
35 fprintf(stderr, "Argument required: either '-list' or the name of the function\n");
36 return 1;
39 if (!strcmp(argv[1], "-list"))
41 for (n=0; syscalls[n].name; n++)
42 printf("%s\n",syscalls[n].name);
44 return 0;
47 for (n=0; syscalls[n].name != NULL; n++)
48 if (!strcmp(syscalls[n].name, argv[1]))
50 printf(STUBCODE_INIT);
51 printf(STUBCODE,
52 syscalls[n].name, "aroscbase",
53 JUMPVEC(n)
55 if (syscalls[n].alias[0] != '\0' )
57 printf(ALIASCODE,
58 syscalls[n].name, syscalls[n].alias
62 return 0;
65 fprintf(stderr, "Invalid function name \"%s\"\n", argv[1]);
67 return 1;