📄 ioslib.html
字号:
<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.htm"><i>VxWorks API Reference : OS 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><a href="./iosLib.html#iosInit">iosInit</a>( )</b> - initialize the I/O system<br><b><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a>( )</b> - install an I/O driver<br><b><a href="./iosLib.html#iosDrvRemove">iosDrvRemove</a>( )</b> - remove an I/O driver<br><b><a href="./iosLib.html#iosDevAdd">iosDevAdd</a>( )</b> - add a device to the I/O system<br><b><a href="./iosLib.html#iosDevDelete">iosDevDelete</a>( )</b> - delete a device from the I/O system<br><b><a href="./iosLib.html#iosDevFind">iosDevFind</a>( )</b> - find an I/O device in the device list<br><b><a href="./iosLib.html#iosFdValue">iosFdValue</a>( )</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><a href="./iosLib.html#iosInit">iosInit</a>( )</b>, before callingany other routines in <b><a href="./iosLib.html#top">iosLib</a></b>. Each driver then installs itself by calling<b><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a>( )</b>. The devices serviced by each driver are added to the I/Osystem with <b><a href="./iosLib.html#iosDevAdd">iosDevAdd</a>( )</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="./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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosInit( )</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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosDrvInstall( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosDrvInstall( )</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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosDrvRemove( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosDrvRemove( )</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><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a>( )</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><a href="./iosLib.html#iosDrvInstall">iosDrvInstall</a>( )</b><hr><a name="iosDevAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosDevAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosDevAdd( )</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 */ /* iosDrvInstall() */ )</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><a href="./ioLib.html#open">open</a>( )</b> and <b><a href="./ioLib.html#creat">creat</a>( )</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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosDevDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosDevDelete( )</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><a href="./ioLib.html#open">open</a>( )</b> or <b><a href="./ioLib.html#creat">creat</a>( )</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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosDevFind( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosDevFind( )</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><a href="./iosLib.html#iosDevFind">iosDevFind</a>( )</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><a href="./iosLib.html#iosDevFind">iosDevFind</a>( )</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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>iosFdValue( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>iosFdValue( )</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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -