7 int main(int argc, char **argv)
10 int fd = open(argv[1], O_WRONLY);
17 /* We need rc because Sles11 compiler warns against unchecked
18 * return value of read and write */
19 rc = write(fd, (void *)0x4096000, 5);
21 perror("write badarea (Should have failed)");
23 rc = write(fd, &fd, 0);
25 perror("write zero bytes");
27 rc = write(fd, &fd, 1);
29 perror("write one byte");
31 rc = write(fd, &fd, 2UL*1024*1024);
32 if (rc != 2UL*1024*1024)
35 rc = write(fd, &fd, 2UL*1024*1024*1024);
36 if (rc != 2UL*1024*1024*1024)
39 rc = write(fd, &fd, -2);
46 fd = open(argv[1], O_RDONLY);
49 rc = read(fd, (void *)0x4096000, 5);
54 /* Tame the compiler spooked about rc assigned, but not used */
56 return -1; /* Not really important. */