nbuf man page on Ultrix

Man page or keyword search:  
man Server   3690 pages
apropos Keyword Search (all sections)
Output format
Ultrix logo
[printable version]

nbuf(4)								       nbuf(4)

       nbuf - select multiple-buffer operation to a raw device

       #include <sys/ioctl.h>

       ioctl(d, FIONBUF, count)
       int d;
       int *count;

       status=ioctl(d, FIONBDONE, buffer)
       int d, status;
       char **buffer;

       The  I/O operations to raw devices are usually performed through a sin‐
       gle buffer. This means that the issuing process must wait for a	buffer
       to  complete before the process can do anything else. An N-buffered I/O
       operation allows a process to begin an I/O operation and continue doing
       something else until the operation has finished. Once N-buffered opera‐
       tion is enabled, and acts as before except that	buffer	completion  is
       not  guaranteed when the call returns.  If the operation starts without
       errors, and return as if the operation were successful.	That  is,  the
       number  of  requested  bytes  have  transferred	and  file pointers are
       updated.	 On read operations, the process must not use the contents  of
       the started buffer until the buffer actually completes.	On write oper‐
       ations, the process must not reuse the buffer until the operation actu‐
       ally  completes.	  A  second  is used to check the status of previously
       issued N-buffered read/write requests to determine when	the  operation
       has really completed.

       N-buffered  I/O	is  used  through a set of calls.  Setting the request
       argument in an call to FIONBUF enables count buffers to	be  used  with
       the raw device associated with the file descriptor d.

       The  count  returns  the actual number of buffers allocated to the user
       process.	 You can set the maximum number of buffers  allowed  for  user
       processes  by  setting the value of the global definition in the system
       configuration file.  The global definition defines the upper bound  for
       the  number on N-buffered I/O buffer headers any user process can allo‐

       If count is zero, the N-buffered operation is terminated and any	 pend‐
       ing  buffers  are  completed.  A	 count less than zero is invalid.  Any
       started I/O buffer's status is checked by the  call  with  the  request
       argument	 set  to  FIONBDONE, with the address of the buffer used as an
       argument.  The status field returns the actual byte  count  transferred
       or any error encountered on the I/O operation. The FIONBDONE ioctl must
       be called before re-using a buffer. FIONBDONE blocks the process	 until
       the  given  buffer completes (unless FNDELAY has been specified with at
       which point EWOULDBLOCK is returned).  In addition,  a  signal  can  be
       generated  whenever  a buffer completes, if FIOASYNC has been specified

       The call is also useful in checking on the status of  pending  buffers.
       The  call  returns  immediately if less than count operations have been
       started on an  N-buffered  channel.  Otherwise,	blocks	the  specified
       amount  of  time	 for a buffer to become done. At this point, FIONBDONE
       must be used to return actual status of the pending buffer.

       The call fails if one or more of the following are true:

       [EBADF]	      The d argument is not a valid descriptor.

       [ENOTTY]	      The d argument is not associated with a  character  spe‐
		      cial device.

       [ENOTTY]	      The  specified  request  does  not  apply to the kind of
		      object which the descriptor d references.

       [EINVAL]	      The request or argp argument is not valid. Returned  for
		      FIONBDONE,  if  requested buffer was never started. Also
		      returned for FIONBUF, if this device does not support N-
		      buffered I/O.

See Also
       fcntl(2), ioctl(2), select(2)


List of man pages available for Ultrix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net