📄 rawfslib.html
字号:
for the specified file descriptor.This is the byte offset of the next byte to be read or written.It takes no additional argument:<pre> position = ioctl (fd, FIOWHERE, 0);</pre><dt><b>FIOFLUSH</b><dd>Writes all modified file descriptor buffers to the physical device.<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="./rawFsLib.html#top">rawFsLib</a></b>, <b><a href="./ioLib.html#top">ioLib</a></b>, <b><a href="./iosLib.html#top">iosLib</a></b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./rt11FsLib.html#top">rt11FsLib</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.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>rawFsDevInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>rawFsDevInit</i>( )</strong> - associate a block device with raw volume functions</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>RAW_VOL_DESC *rawFsDevInit ( char * volName, /* volume name */ BLK_DEV * pBlkDev /* pointer to block device info */ )</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><i><a href="./ioLib.html#open">open</a></i>( )</b> and <b><i><a href="./ioLib.html#write">write</a></i>( )</b>, are performed on thedevice, the calls will be routed through rawFsLib.<p>This routine associates <i>volName</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><i><a href="./rawFsLib.html#rawFsInit">rawFsInit</a></i>( )</b>. (The driver number is kept inthe global variable <b>rawFsDrvNum</b>.)<p>The <b>BLK_DEV</b> structure specified by <i>pBlkDev</i> contains configurationdata describing the device and the addresses of five routines whichwill be called to read blocks, write blocks, reset the device, checkdevice status, and perform other control functions (<b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b>). 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.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>rawFsInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>rawFsInit</i>( )</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>This initialization is enabled when the configuration macro <b>INCLUDE_RAWFS</b> is defined; <b><i><a href="./rawFsLib.html#rawFsInit">rawFsInit</a></i>( )</b> is then called from the root task, <b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>( )</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.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>rawFsModeChange</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>rawFsModeChange</i>( )</strong> - modify the mode of a raw device volume</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void rawFsModeChange ( RAW_VOL_DESC * vdptr, /* 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 setting the mode field inthe <b>BLK_DEV</b> 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><i><a href="./rawFsLib.html#rawFsReadyChange">rawFsReadyChange</a></i>( )</b><hr><a name="rawFsReadyChange"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>rawFsReadyChange</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>rawFsReadyChange</i>( )</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 * vdptr /* 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.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>rawFsVolUnmount</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>rawFsVolUnmount</i>( )</strong> - disable a raw device volume</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rawFsVolUnmount ( RAW_VOL_DESC * vdptr /* 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><i><a href="./rawFsLib.html#rawFsReadyChange">rawFsReadyChange</a></i>( )</b>.)<p>This routine may also be called by issuing an <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</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><i><a href="./rawFsLib.html#rawFsReadyChange">rawFsReadyChange</a></i>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -