Lines Matching refs:fp
64 freopen(const char *file, const char *mode, FILE *fp)
71 _DIAGASSERT(fp != NULL);
74 (void) fclose(fp);
89 if (fp->_flags == 0) {
90 fp->_flags = __SEOF; /* hold on to it */
95 if (fp->_flags & __SWR)
96 (void)__sflush(fp);
98 isopen = fp->_close != NULL;
99 if ((wantfd = __sfileno(fp)) == -1 && isopen) {
100 (void) (*fp->_close)(fp->_cookie);
110 (void) (*fp->_close)(fp->_cookie);
118 * Finish closing fp. Even if the open succeeded above, we cannot
119 * keep fp->_base: it may be the wrong size. This loses the effect
123 (void) (*fp->_close)(fp->_cookie);
124 if (fp->_flags & __SMBF)
125 free((char *)fp->_bf._base);
126 fp->_w = 0;
127 fp->_r = 0;
128 fp->_p = NULL;
129 fp->_bf._base = NULL;
130 fp->_bf._size = 0;
131 fp->_lbfsize = 0;
132 if (HASUB(fp))
133 FREEUB(fp);
134 WCIO_FREE(fp);
135 _UB(fp)._size = 0;
136 FREELB(fp);
139 fp->_flags = 0; /* set it free */
169 fp->_flags = flags;
170 fp->_file = f;
171 fp->_cookie = fp;
172 fp->_read = __sread;
173 fp->_write = __swrite;
174 fp->_seek = __sseek;
175 fp->_close = __sclose;
186 (void) __sseek((void *)fp, (off_t)0, SEEK_END);
187 return fp;