8 char *fname = "test.tmp";
14 /* create a readonly file */
16 if ((fd=open(fname,O_RDWR|O_CREAT,0444)) == -1) {
17 printf("first open failed : %s\n",strerror(errno));
22 /* try and open it for reading. This should work. Under linux 2.0 it doesn't */
23 if ((fd=open(fname,O_RDONLY|O_CREAT,0666)) == -1) {
24 printf("2nd open failed : %s\n",strerror(errno));
29 /* it worked - clean up */