📄 rawfslib.html
字号:
<pre> status = ioctl (fd, FIOFLUSH, 0);</pre><dt><b>FIOSYNC</b><dd>Performs the same function as FIOFLUSH.<p><dt><b>FIONREAD</b><dd>Copies to <i>unreadCount</i> the number of bytes from the current file positionto the end of the device:<pre> status = ioctl (fd, FIONREAD, &unreadCount);</pre></dl><p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>rawFsLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b>, <b><a href="./iosLib.html#top">iosLib</a></b>, <b><a href="./rawFsLib.html#top">rawFsLib</a></b>, <b><a href="./ramDrv.html#top">ramDrv</a></b>,<i>VxWorks Programmer's Guide: I/O System, Local File Systems </i><hr><a name="rawFsDevInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rawFsDevInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rawFsDevInit( )</strong> - associate a block device with raw volume functions</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>RAW_VOL_DESC *rawFsDevInit ( char * pVolName, /* volume name to be used with iosDevAdd */ BLK_DEV * pDevice /* a pointer to a BLK_DEV or a CBIO_DEV_ID */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes a block device created by a device driver anddefines it as a raw file system volume. As a result, when high-level I/O operations, such as <b><a href="./ioLib.html#open">open</a>( )</b> and <b><a href="./ioLib.html#write">write</a>( )</b>, are performed on thedevice, the calls will be routed through <b><a href="./rawFsLib.html#top">rawFsLib</a></b>.<p>This routine associates <i>pVolName</i> with a device and installs it inthe VxWorks I/O System's device table. The driver number used whenthe device is added to the table is that which was assigned to theraw library during <b><a href="./rawFsLib.html#rawFsInit">rawFsInit</a>( )</b>. (The driver number is kept inthe global variable <b>rawFsDrvNum</b>.)<p>The pDevice is a <b>CBIO_DEV_ID</b> or <b>BLK_DEV</b> ptr and contains configurationdata describing the device and the addresses of routines whichwill be called to access device. These routineswill not be called until they are required by subsequent I/O operations.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the volume descriptor (<b>RAW_VOL_DESC</b>),or NULL if there is an error.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rawFsLib.html#top">rawFsLib</a></b><hr><a name="rawFsInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rawFsInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rawFsInit( )</strong> - prepare to use the raw volume library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rawFsInit ( int maxFiles /* max no. of simultaneously open files */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the raw volume library. It must be called exactlyonce, before any other routine in the library. The argument specifies thenumber of file descriptors that may be open at once. This routine allocatesand sets up the necessary memory structures and initializes semaphores.<p>This routine also installs raw volume library routines in the VxWorks I/Osystem driver table. The driver number assigned to <b><a href="./rawFsLib.html#top">rawFsLib</a></b> is placed inthe global variable <b>rawFsDrvNum</b>. This number will later be associatedwith system file descriptors opened to rawFs devices.<p>To enable this initialization, define <b>INCLUDE_RAWFS</b> in <b>configAll.h</b>;<b><a href="./rawFsLib.html#rawFsInit">rawFsInit</a>( )</b> will then be called from the root task, <b><a href="./usrConfig.html#usrRoot">usrRoot</a>( )</b>, in <b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rawFsLib.html#top">rawFsLib</a></b><hr><a name="rawFsModeChange"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rawFsModeChange( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rawFsModeChange( )</strong> - modify the mode of a raw device volume</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void rawFsModeChange ( RAW_VOL_DESC * pVd, /* pointer to volume descriptor */ int newMode /* O_RDONLY/O_WRONLY/O_RDWR (both) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the device's mode to <i>newMode</i> by settingthe mode field inthe device structure. This routine should be called whenever the readand write capabilities are determined, usually after a ready change.<p>The driver's device initialization routine should initially set the modeto <b>O_RDWR</b> (i.e., both <b>O_RDONLY</b> and <b>O_WRONLY</b>).<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rawFsLib.html#top">rawFsLib</a></b>, <b><a href="./rawFsLib.html#rawFsReadyChange">rawFsReadyChange</a>( )</b><hr><a name="rawFsReadyChange"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rawFsReadyChange( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rawFsReadyChange( )</strong> - notify <b><a href="./rawFsLib.html#top">rawFsLib</a></b> of a change in ready status</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void rawFsReadyChange ( RAW_VOL_DESC * pVd /* pointer to volume descriptor */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the volume descriptor state to <b>RAW_VD_READY_CHANGED</b>.It should be called whenever a driver senses that a device has come on-lineor gone off-line, (e.g., a disk has been inserted or removed).<p>After this routine has been called, the next attempt to use the volumewill result in an attempted remount.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rawFsLib.html#top">rawFsLib</a></b><hr><a name="rawFsVolUnmount"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rawFsVolUnmount( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rawFsVolUnmount( )</strong> - disable a raw device volume</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rawFsVolUnmount ( RAW_VOL_DESC * pVd /* pointer to volume descriptor */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is called when I/O operations on a volume are to bediscontinued. This is commonly done before changing removable disks.All buffered data for the volume is written to the device (if possible),any open file descriptors are marked as obsolete, and the volume ismarked as not mounted.<p>Because this routine will flush data from memory to the physicaldevice, it should not be used in situations where the disk-change isnot recognized until after a new disk has been inserted. In thesecircumstances, use the ready-change mechanism. (See the manual entry for <b><a href="./rawFsLib.html#rawFsReadyChange">rawFsReadyChange</a>( )</b>.)<p>This routine may also be called by issuing an <b><a href="./ioLib.html#ioctl">ioctl</a>( )</b> call using theFIOUNMOUNT function code.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the routine cannot access the volume.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rawFsLib.html#top">rawFsLib</a></b>, <b><a href="./rawFsLib.html#rawFsReadyChange">rawFsReadyChange</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -