Lines Matching refs:fp
116 register SM_FILE_T *fp;
137 fp = sm_fp(type, ioflags, NULL);
150 if ((*fp->f_open)(fp, info, flags, rpool) < 0)
152 fp->f_flags = 0; /* release */
153 fp->sm_magic = NULL; /* release */
163 sm_rpool_attach_x(rpool, sm_io_fclose, fp);
166 return fp;
172 ** fp -- file pointer to duplicate
185 sm_io_dup(fp)
186 SM_FILE_T *fp;
189 SM_REQUIRE_ISA(fp, SmFileMagic);
190 if (fp->sm_magic != SmFileMagic)
195 if (fp->f_dup_cnt >= INT_MAX - 1)
201 fp->f_dup_cnt++;
202 return fp;
213 ** fp -- the file pointer to reuse
223 sm_io_reopen(type, timeout, info, flags, rpool, fp)
229 SM_FILE_T *fp;
237 (void) sm_io_close(fp, timeout);
277 if (fp != NULL)
279 if (fp->sm_magic != SmFileMagic)
280 fp->f_flags = SMFEOF; /* hold on to it */
284 (void) sm_io_flush(fp, SM_TIME_FOREVER);
285 (void) sm_io_close(fp, SM_TIME_FOREVER);
289 fp2 = sm_fp(type, ioflags, fp);
323 ** When a read occurs on fp, fp2 will be flushed iff there is no
324 ** data waiting on fp.
327 ** fp -- the file opened for reading.
335 sm_io_autoflush(fp, fp2)
336 SM_FILE_T *fp;
341 SM_REQUIRE_ISA(fp, SmFileMagic);
345 savefp = fp->f_flushfp;
346 fp->f_flushfp = fp2;