#ifdef PINTOS
#include <syscall.h>
#else
-#include <unistd.h>
-#include <fcntl.h>
+#include "posix-compat.h"
#endif
unsigned char buf[65536];
size_t histogram[256];
int
-main (void)
+main (int argc __attribute__ ((unused)), char *argv[])
{
int fd;
unsigned char *p;
size_t size;
size_t i;
-
-#ifdef PINTOS
- fd = open ("buffer");
-#else
- fd = open ("buffer", O_RDWR);
-#endif
+
+ fd = open (argv[1]);
if (fd < 0)
{
printf ("(child-sort) open() failed\n");
while (j-- > 0)
*p++ = i;
}
-#ifdef PINTOS
seek (fd, 0);
-#else
- lseek (fd, 0, SEEK_SET);
-#endif
write (fd, buf, size);
close (fd);
- return 0x123;
+ return 123;
}