]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/Extras/libh/fopen2.c
Remove final traces of TMA support
[nmh] / docs / historical / mh-jun-1982 / Extras / libh / fopen2.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "../h/iobuf.h"
9
10 /* this is the counterpart to fopen which leaves
11 * the file opened for both read and write
12 * fseek may then be used to position at the end of the
13 * file (or wherever) before reading/writing
14 */
15 fopen2(filename, abufp)
16 char *filename;
17 struct iobuf *abufp;
18 {
19 register struct iobuf *bufp;
20
21 bufp = abufp;
22 bufp->b_nleft = 0;
23 bufp->b_nextp = 0;
24 if ((bufp->b_fildes = open(filename, 2)) < 0) return(-1);
25 return(0);
26 }