==
fd
==

.. This document is automatically generated. Don't edit it!

`Index <index>`_

----------

======================================= ======================================= ======================================= ======================================= 
`FD_Alloc()`_                           `FD_Check()`_                           `FD_Free()`_                            `FD_GetData()`_                         
`FD_GetOwner()`_                        `FD_Reserve()`_                         `FD_SetData()`_                         
======================================= ======================================= ======================================= ======================================= 

-----------

FD_Alloc()
==========

Synopsis
~~~~~~~~
::

 LONG FD_Alloc(
          LONG startfd,
          fd_owner_t owner,
          APTR data,
          LONG * outfd );

Function
~~~~~~~~
::

     Allocate a file descriptor slot for the specified owner.


Inputs
~~~~~~
::

     startfd - Starting descriptor number to search from.
     owner   - Descriptor owner identifier.
     data    - Optional owner data.
     outfd   - Pointer that receives the allocated descriptor.


Result
~~~~~~
::

     0 on success, or an errno-style error code.



See also
~~~~~~~~

`FD_Reserve()`_ 

----------

FD_Check()
==========

Synopsis
~~~~~~~~
::

 LONG FD_Check(
          LONG fd );

Function
~~~~~~~~
::

     Check whether a descriptor slot is available.


Inputs
~~~~~~
::

     fd - Descriptor number to check.


Result
~~~~~~
::

     0 if the slot is free, or an errno-style error code.



See also
~~~~~~~~

`FD_GetOwner()`_ 

----------

FD_Free()
=========

Synopsis
~~~~~~~~
::

 LONG FD_Free(
          LONG fd,
          fd_owner_t owner );

Function
~~~~~~~~
::

     Release a descriptor slot owned by a specific consumer.


Inputs
~~~~~~
::

     fd     - Descriptor number to release.
     owner  - Descriptor owner identifier.


Result
~~~~~~
::

     0 on success, or an errno-style error code.



See also
~~~~~~~~

`FD_Reserve()`_ 

----------

FD_GetData()
============

Synopsis
~~~~~~~~
::

 APTR FD_GetData(
          LONG fd );

Function
~~~~~~~~
::

     Query the owner data for a descriptor slot.


Inputs
~~~~~~
::

     fd - Descriptor number to query.


Result
~~~~~~
::

     Owner data pointer or NULL.



See also
~~~~~~~~

`FD_SetData()`_ 

----------

FD_GetOwner()
=============

Synopsis
~~~~~~~~
::

 fd_owner_t FD_GetOwner(
          LONG fd );

Function
~~~~~~~~
::

     Query the owner of a descriptor slot.


Inputs
~~~~~~
::

     fd - Descriptor number to query.


Result
~~~~~~
::

     Owner identifier or FD_OWNER_NONE.



See also
~~~~~~~~

`FD_Check()`_ 

----------

FD_Reserve()
============

Synopsis
~~~~~~~~
::

 LONG FD_Reserve(
          LONG fd,
          fd_owner_t owner,
          APTR data );

Function
~~~~~~~~
::

     Reserve a specific file descriptor slot for the specified owner.


Inputs
~~~~~~
::

     fd     - Descriptor number to reserve.
     owner  - Descriptor owner identifier.
     data   - Optional owner data.


Result
~~~~~~
::

     0 on success, or an errno-style error code.



See also
~~~~~~~~

`FD_Alloc()`_ 

----------

FD_SetData()
============

Synopsis
~~~~~~~~
::

 LONG FD_SetData(
          LONG fd,
          fd_owner_t owner,
          APTR data );

Function
~~~~~~~~
::

     Update the owner data for a descriptor slot.


Inputs
~~~~~~
::

     fd    - Descriptor number to update.
     owner - Descriptor owner identifier.
     data  - Owner data pointer.


Result
~~~~~~
::

     0 on success, or an errno-style error code.



See also
~~~~~~~~

`FD_GetData()`_ 

