Lines Matching +full:pre +full:- +full:timeout

9 <br> $Id: io.html,v 1.3 2001-03-17 03:22:50 gshapiro Exp $
45 A third difference is that the I/O functions take a <i>timeout</i>
48 to setup it's own timeout mechanism. NOTE: SIGALRM's should not be
49 active in the calling program when an I/O function with a <i>timeout</i>
60 Remember many functions also have a <i>timeout</i> argument added.
86 <pre>
89 </pre>
98 <pre>
105 <a href="#sm_io_close">int sm_io_close(SM_FILE_T *fp, int timeout)</a>
113 <a href="#defaultapi">char * sm_io_fgets(SM_FILE_T *fp, int timeout, char *buf, int n)</a>
115 <a href="#defaultapi">int sm_io_flush(SM_FILE_T *fp, int timeout)</a>
119 <a href="#defaultapi">int sm_io_fprintf(SM_FILE_T *fp, int timeout, const char *fmt, ...)</a>
123 <a href="#defaultapi">int sm_io_fscanf(SM_FILE_T *fp, int timeout, char const *fmt, ...) </a>
125 <a href="#defaultapi">int sm_io_getc(SM_FILE_T *fp, int timeout)</a>
129 <a href="#sm_io_open">SM_FILE_T * sm_io_open(SM_FILE_T type, int timeout, void *info, int flags, vo…
133 <a href="#defaultapi">int sm_io_putc(SM_FILE_T *fp, int timeout, int c)</a>
135 <a href="#defaultapi">size_t sm_io_read(SM_FILE_T *fp, int timeout, char *buf, size_t size)</a>
137 <a href="#sm_io_reopen">SM_FILE_T * sm_io_open(SM_FILE_T type, int timeout, void *info, int flags, …
139 <a href="#defaultapi">void sm_io_rewind(SM_FILE_T *fp, int timeout)</a>
141 <a href="#defaultapi">int sm_io_seek(SM_FILE_T *fp, off_t offset, int timeout, int whence)</a>
145 <a href="#defaultapi">int sm_io_setvbuf(SM_FILE_T *fp, int timeout, char *buf, int mode, size_t siz…
149 <a href="#defaultapi">long sm_io_tell(SM_FILE_T *fp, int timeout)</a>
151 <a href="#defaultapi">int sm_io_ungetc(SM_FILE_T *fp, int timeout, int c)</a>
153 <a href="#defaultapi">size_t sm_io_write(SM_FILE_T *fp, int timeout, char *buf, size_t size)</a>
157 </pre>
160 For many of the functions a <i>timeout</i> argument is given. This limits
162 pre-defined values:
165 SM_TIME_DEFAULT - timeout using the default setting for this file type
168 SM_TIME_FOREVER - timeout will take forever; blocks until task completed
171 SM_TIME_IMMEDIATE - timeout (virtually) now
178 is given for <i>timeout</i>.
185 <!-- SM_IO_FOPEN -->
203 <!-- SM_IO_OPEN -->
208 sm_io_open(const SM_FILE_T *type, int timeout, const void *info, int flags, void *rpool)
211 Opens a file by <i>type</i> directed by <i>info</i>. <i>Type</i> is a filled-in
256 <pre>
257 SM_IO_SET_TYPE(type, name, open, close, read, write, seek, get, set, timeout)
258 </pre>
261 <i>Timeout</i> is set as described in the <a href="#timeouts"><b>Timeouts</b></a>
272 SM_IO_RDWR - read and write
275 SM_IO_RDONLY - read only
278 SM_IO_WRONLY - write only
281 SM_IO_APPEND - allow write to EOF only
284 SM_IO_APPENDRW - allow read-write from EOF only
287 SM_IO_RDWRTR - read and write with truncation of file first
301 <!-- SM_IO_SETINFO -->
313 configured the same way (this is to prevent side-effect
315 The value of <i>what</i> will be file-type dependent since this function
324 On success 0 (zero) is returned. On failure -1 is returned and errno is set.
326 <!-- SM_IO_GETINFO -->
346 On success 0 (zero) is returned. On failure -1 is returned and errno is set.
348 <!-- SM_IO_AUTOFLUSH -->
366 <!-- SM_IO_AUTOMODE -->
375 Associate the two file pointers for blocking/non-blocking mode changes.
377 a file between blocking and non-blocking. If the underlying file descriptor
383 <!-- SM_IO_CLOSE -->
388 sm_io_close(SM_FILE_T *sfp, int timeout)
394 <i>Timeout</i> is set as described in the <a href="#timeouts"><b>Timeouts</b></a>
433 functions that result in the file-type behaving as the system stdio
443 functions that result in the file-type behaving as the system stdio
487 <i>smiostdout</i> and <i>smiostderr</i> are layered on-top-of
520 <pre>
529 </pre>
534 <pre>
535 SM_IO_SET_TYPE(type, name, open, close, read, write, seek, get, set, timeout)
536 </pre>
541 type - is the SM_FILE_T being filled-in
544 name - a human readable character string for human identification purposes
547 open - the vector to the open function
550 close - the vector to the close function
553 read - the vector to the read function
556 write - the vector to the write function
559 seek - the vector to the seek function
562 set - the vector to the set function
565 get - the vector to the get function
568 timeout - the default to be used for a timeout when SM_TIME_DEFAULT specified
618 All of the "int" functions should return -1 (minus one) on failure
630 <pre>
638 return(-1);
639 </pre>
647 We have also specified read-only access (SM_IO_RDONLY) and that no <i>rpool</i>
648 will be used. The <i>timeout</i> has been set to 1000 milliseconds which
651 <pre>
667 sm_io_snprintf(path, PATH_MAX, "%s/%s", pw->pw_dir, info);
670 ** Okay. Now the path pass-in has been prefixed with the
674 fp->cookie = sm_io_open(SmFtStdio, path, flags, rpools);
675 if (fp->cookie == NULL)
676 return(-1) /* errno set by sm_io_open call */
680 </pre>
684 <pre>
706 return(sm_io_write(fp->cookie, buf, size));
708 </pre>
709 As a thought-exercise for the fair reader: how would you modify the
737 argument. Many of the <i>sm_io</i> function take a <i>timeout</i>