8 #define perror(str) ((void)0)
10 int main(int argc, char **argv)
13 int fd = open(argv[1], O_WRONLY);
20 /* We need rc because Sles11 compiler warns against unchecked
21 * return value of read and write */
22 rc = write(fd, (void *)0x4096000, 5);
24 perror("write badarea (Should have failed)");
26 rc = write(fd, &fd, 0);
28 perror("write zero bytes");
30 rc = write(fd, &fd, 1);
32 perror("write one byte");
34 rc = write(fd, &fd, 2UL*1024*1024);
35 if (rc != 2UL*1024*1024)
38 rc = write(fd, &fd, 2UL*1024*1024*1024);
39 if (rc != 2UL*1024*1024*1024)
42 rc = write(fd, &fd, -2);
49 fd = open(argv[1], O_RDONLY);
52 rc = read(fd, (void *)0x4096000, 5);
57 /* Tame the compiler spooked about rc assigned, but not used */
59 return -1; /* Not really important. */