These fixes fall into a few different buckets. First c99 doesn't allow a
parameter without a type. So in cases where the type had previously been an
implicit int, make it an explicit int. Second, for return values, don't allow
them to be implicit ints either, make them explicit. In a few cases change c89
function definitions to c99 function definitions. Lastly include <stdlib.h>
in sbrk.c to get the prototype for abort () which we call when we detect a
heap/stack collision.
}
-void _exit (n)
+void _exit (int n)
{
/* Destructors should be done earlier because they need to be done before the
files are closed, but here is better than nowhere (and this balances the
#define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
-_getpid (n)
+int
+_getpid (int n)
{
return 1;
}
#define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
-_isatty (fd)
- int fd;
+int
+_isatty (int fd)
{
return 1;
}
#define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
-_kill (pid, sig)
- pid_t pid;
- int sig;
+int
+_kill (pid_t pid, int sig)
{
return TRAP0 (SYS_exit, 0xdead0000 | sig, 0, 0);
}
#define TRAP0(f, p1, p2, p3) __trap0(f, (int)(p1), (int)(p2), (int)(p3))
+int
_read (int file,
char *ptr,
int len)
#include <sys/types.h>
#include <sys/stat.h>
#include "sys/syscall.h"
+#include <stdlib.h>
+extern int _write (int, char *, int);
caddr_t
_sbrk (int incr)
{