home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.minix
- Path: sparky!uunet!spool.mu.edu!yale.edu!yale!gumby!wmu-coyote!ishwar
- From: ishwar@sol.cs.wmich.edu (Ishwar Rattan)
- Subject: help with <fcntl.h> in Minix 1.5
- Message-ID: <1993Jan26.003907.723@sol.cs.wmich.edu>
- Followup-To: ishwar@cs.wmich.edu
- Keywords: <fcntl.h> file, Minix 1.5, header file errors
- Organization: Western Michigan Univ. Comp. Sci. Dept.
- Date: Tue, 26 Jan 1993 00:39:07 GMT
- Lines: 34
-
- hello
-
- i wrote this c-program with <fcntl.h> header file using
- out of the box Minix 1.5. when compiled with cc, it gives errors
- in the header file!? any ideas / help will be apprecaited.
-
- - ishwar
- ------
- #include <stdio.h>
- #include <fcntl.h>
-
- main()
- {
- char ch;
- int fin;
-
- if((fin = open("junk", O_RDONLY)) < 0)
- xit("open failed.");
- while(read(fin, &ch, 1))
- putchar(ch);
-
- if(close(fin) < 0)
- xit("close failed.");
-
- exit(0);
- }
-
- xit(reason)
- char *reason;
- {
- fprintf(stderr, "%s\n", reason);
- exit(1);
- }
- -------
-