ioslib.html

来自「vxworks相关论文」· HTML 代码 · 共 253 行

HTML
253
字号
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/iosLib.html - generated by refgen from iosLib.c --> <title> iosLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>iosLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>iosLib</strong> - I/O system library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./iosLib.html#iosInit">iosInit</a></i>(&nbsp;)</b>  -  initialize the I/O system<br><b><i><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a></i>(&nbsp;)</b>  -  install an I/O driver<br><b><i><a href="./iosLib.html#iosDrvRemove">iosDrvRemove</a></i>(&nbsp;)</b>  -  remove an I/O driver<br><b><i><a href="./iosLib.html#iosDevAdd">iosDevAdd</a></i>(&nbsp;)</b>  -  add a device to the I/O system<br><b><i><a href="./iosLib.html#iosDevDelete">iosDevDelete</a></i>(&nbsp;)</b>  -  delete a device from the I/O system<br><b><i><a href="./iosLib.html#iosDevFind">iosDevFind</a></i>(&nbsp;)</b>  -  find an I/O device in the device list<br><b><i><a href="./iosLib.html#iosFdValue">iosFdValue</a></i>(&nbsp;)</b>  -  validate an open file descriptor and return the driver-specific value<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library is the driver-level interface to the I/O system.  Itsprimary purpose is to route user I/O requests to the proper drivers, usingthe proper parameters.  To do this, <b><a href="./iosLib.html#top">iosLib</a></b> keeps tables describing theavailable drivers (e.g., names, open files).<p>The I/O system should be initialized by calling <b><i><a href="./iosLib.html#iosInit">iosInit</a></i>(&nbsp;)</b>, before callingany other routines in iosLib.  Each driver then installs itself by calling<b><i><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a></i>(&nbsp;)</b>.  The devices serviced by each driver are added to the I/Osystem with <b><i><a href="./iosLib.html#iosDevAdd">iosDevAdd</a></i>(&nbsp;)</b>.<p>The I/O system is described more fully in the <i>I/O System </i>chapter of the<i>Programmer's Guide. </i><p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>iosLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b>, <b><a href="./intLib.html#top">intLib</a></b>, <b><a href="./ioLib.html#top">ioLib</a></b>,  <i>VxWorks Programmer's Guide: I/O System</i><hr><a name="iosInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosInit</i>(&nbsp;)</strong> - initialize the I/O system</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS iosInit    (    int    max_drivers, /* maximum number of drivers allowed */    int    max_files,   /* max number of files allowed open at once */    char * nullDevName  /* name of the null device (bit bucket) */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the I/O system.It must be called before any other I/O system routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if memory is insufficient.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b><hr><a name="iosDrvInstall"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosDrvInstall</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosDrvInstall</i>(&nbsp;)</strong> - install an I/O driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int iosDrvInstall    (    FUNCPTR pCreate, /* pointer to driver create function */    FUNCPTR pDelete, /* pointer to driver delete function */    FUNCPTR pOpen,   /* pointer to driver open function */    FUNCPTR pClose,  /* pointer to driver close function */    FUNCPTR pRead,   /* pointer to driver read function */    FUNCPTR pWrite,  /* pointer to driver write function */    FUNCPTR pIoctl   /* pointer to driver ioctl function */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine should be called once by each I/O driver.  It hooks up thevarious I/O service calls to the driver service routines, assignsthe driver a number, and adds the driver to the driver table.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The driver number of the new driver, or ERROR if there is no room for thedriver.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b><hr><a name="iosDrvRemove"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosDrvRemove</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosDrvRemove</i>(&nbsp;)</strong> - remove an I/O driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS iosDrvRemove    (    int  drvnum,    /* no. of driver to remove, returned by iosDrvInstall() */    BOOL forceClose /* if TRUE, force closure of open files */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes an I/O driver (added by <b><i><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a></i>(&nbsp;)</b>) from the driver table.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the driver has open files.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b>, <b><i><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a></i>(&nbsp;)</b><hr><a name="iosDevAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosDevAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosDevAdd</i>(&nbsp;)</strong> - add a device to the I/O system</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS iosDevAdd    (    DEV_HDR * pDevHdr, /* pointer to device's structure */    char *    name,    /* name of device */    int       drvnum   /* no. of servicing driver, returned by */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a device to the I/O system device list, making thedevice available for subsequent <b><i><a href="./ioLib.html#open">open</a></i>(&nbsp;)</b> and <b><i><a href="./ioLib.html#creat">creat</a></i>(&nbsp;)</b> calls.<p>The parameter <i>pDevHdr</i> is a pointer to a device header, <b>DEV_HDR</b> (definedin <b>iosLib.h</b>), which is used as the node in the device list.  Usually thisis the first item in a larger device structure for the specific devicetype.  The parameters <i>name</i> and <i>drvnum</i> are entered in <i>pDevHdr</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if there is already a device with the specified name.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b><hr><a name="iosDevDelete"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosDevDelete</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosDevDelete</i>(&nbsp;)</strong> - delete a device from the I/O system</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void iosDevDelete    (    DEV_HDR * pDevHdr /* pointer to device's structure */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a device from the I/O system device list, making itunavailable to subsequent <b><i><a href="./ioLib.html#open">open</a></i>(&nbsp;)</b> or <b><i><a href="./ioLib.html#creat">creat</a></i>(&nbsp;)</b> calls.  No interaction withthe driver occurs, and any file descriptors open on the device or pendingoperations are unaffected.<p>If the device was never added to the device list, unpredictable resultsmay occur.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b><hr><a name="iosDevFind"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosDevFind</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosDevFind</i>(&nbsp;)</strong> - find an I/O device in the device list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>DEV_HDR *iosDevFind    (    char * name,      /* name of the device */    char * *pNameTail /* where to put ptr to tail of name */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches the device list for a device whose name matches thefirst portion of <i>name</i>.  If a device is found, <b><i><a href="./iosLib.html#iosDevFind">iosDevFind</a></i>(&nbsp;)</b> sets thecharacter pointer pointed to by <i>pNameTail</i> to point to the firstcharacter in <i>name</i>, following the portion which matched the device name.It then returns a pointer to the device.  If the routine fails, it returnsa pointer to the default device (that is, the device where the currentworking directory is mounted) and sets <i>pNameTail</i> to point to thebeginning of <i>name</i>.  If there is no default device, <b><i><a href="./iosLib.html#iosDevFind">iosDevFind</a></i>(&nbsp;)</b> returns NULL.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the device header, or NULL if the device is not found.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b><hr><a name="iosFdValue"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>iosFdValue</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>iosFdValue</i>(&nbsp;)</strong> - validate an open file descriptor and return the driver-specific value</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int iosFdValue    (    int fd /* file descriptor to check */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine checks to see if a file descriptor is valid andreturns the driver-specific value.<p></blockquote><h4>RETURNS</h4><blockquote><p>The driver-specific value, or ERROR if the file descriptor is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./iosLib.html#top">iosLib</a></b></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?