⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nfsdrv.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/nfsDrv.html - generated by refgen from nfsDrv.c --> <title> nfsDrv </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>nfsDrv</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>nfsDrv</strong> - Network File System (NFS) I/O driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./nfsDrv.html#nfsDrv">nfsDrv</a>(&nbsp;)</b>  -  install the NFS driver<br><b><a href="./nfsDrv.html#nfsDrvNumGet">nfsDrvNumGet</a>(&nbsp;)</b>  -  return the IO system driver number for the nfs driver<br><b><a href="./nfsDrv.html#nfsMount">nfsMount</a>(&nbsp;)</b>  -  mount an NFS file system<br><b><a href="./nfsDrv.html#nfsMountAll">nfsMountAll</a>(&nbsp;)</b>  -  mount all file systems exported by a specified host<br><b><a href="./nfsDrv.html#nfsDevShow">nfsDevShow</a>(&nbsp;)</b>  -  display the mounted NFS devices<br><b><a href="./nfsDrv.html#nfsUnmount">nfsUnmount</a>(&nbsp;)</b>  -  unmount an NFS device<br><b><a href="./nfsDrv.html#nfsDevListGet">nfsDevListGet</a>(&nbsp;)</b>  -  create list of all the NFS devices in the system<br><b><a href="./nfsDrv.html#nfsDevInfoGet">nfsDevInfoGet</a>(&nbsp;)</b>  -  read configuration information from the requested NFS device<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This driver provides facilities for accessing files transparently over thenetwork via NFS (Network File System).  By creating a network devicewith <b><a href="./nfsDrv.html#nfsMount">nfsMount</a>(&nbsp;)</b>, files on a remote NFS system (such as a UNIX system) canbe handled as if they were local.<p></blockquote><h4>USER-CALLABLE ROUTINES</h4><blockquote><p>The <b><a href="./nfsDrv.html#nfsDrv">nfsDrv</a>(&nbsp;)</b> routine initializes the driver.  The <b><a href="./nfsDrv.html#nfsMount">nfsMount</a>(&nbsp;)</b> and <b><a href="./nfsDrv.html#nfsUnmount">nfsUnmount</a>(&nbsp;)</b>routines mount and unmount file systems.  The <b><a href="./nfsDrv.html#nfsMountAll">nfsMountAll</a>(&nbsp;)</b> routine mountsall file systems exported by a specified host.<p></blockquote><h4>INITIALIZATION</h4><blockquote><p>Before using the network driver, it must be initialized by calling <b><a href="./nfsDrv.html#nfsDrv">nfsDrv</a>(&nbsp;)</b>.This routine must be called before any reads, writes, or other NFS calls.This is done automatically when <b>INCLUDE_NFS</b> is defined..<p></blockquote><h4>CREATING NFS DEVICES</h4><blockquote><p>In order to access a remote file system, an NFS device must be created bycalling <b><a href="./nfsDrv.html#nfsMount">nfsMount</a>(&nbsp;)</b>.  For example, to create the device <b>/myd0/</b> for the filesystem <b>/d0/</b> on the host <b>wrs</b>, call:<pre>    nfsMount ("wrs", "/d0/", "/myd0/");</pre>The file <b>/d0/dog</b> on the host <b>wrs</b> can now be accessed as <b>/myd0/dog</b>.<p>If the third parameter to <b><a href="./nfsDrv.html#nfsMount">nfsMount</a>(&nbsp;)</b> is NULL, VxWorks creates a device withthe same name as the file system.  For example, the call:<pre>    nfsMount ("wrs", "/d0/", NULL);</pre>or from the shell:<pre>    nfsMount "wrs", "/d0/"</pre>creates the device <b>/d0/</b>.  The file <b>/d0/dog</b> is accessed by the same name,<b>/d0/dog</b>.<p>Before mounting a file system, the host must already have been createdwith <b><a href="./hostLib.html#hostAdd">hostAdd</a>(&nbsp;)</b>.  The routine <b><a href="./nfsDrv.html#nfsDevShow">nfsDevShow</a>(&nbsp;)</b> displays the mounted NFS devices.<p></blockquote><h4>IOCTL FUNCTIONS</h4><blockquote><p>The NFS driver responds to the following <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b> functions:<dl><dt><b>FIOGETNAME</b><dd>Gets the file name of <i>fd</i> and copies it to the buffer referenced by <i>nameBuf</i>:<pre>    status = ioctl (fd, FIOGETNAME, &amp;nameBuf);</pre><dt><b>FIONREAD</b><dd>Copies to <i>nBytesUnread</i> the number of bytes remaining in the filespecified by <i>fd</i>:<pre>    status = ioctl (fd, FIONREAD, &amp;nBytesUnread);</pre><dt><b>FIOSEEK</b><dd>Sets the current byte offset in the file to the position specified by<i>newOffset</i>.  If the seek goes beyond the end-of-file, the file grows.The end-of-file pointer gets moved to the new position, and the new spaceis filled with zeros:<pre>    status = ioctl (fd, FIOSEEK, newOffset);</pre><dt><b>FIOSYNC</b><dd>Flush data to the remote NFS file.  It takes no additional argument:<pre>    status = ioctl (fd, FIOSYNC, 0);</pre><dt><b>FIOWHERE</b><dd>Returns the current byte position in the file.  This is the byte offset ofthe next byte to be read or written.  It takes no additional argument:<pre>    position = ioctl (fd, FIOWHERE, 0);</pre><dt><b>FIOREADDIR</b><dd>Reads the next directory entry.  The argument <i>dirStruct</i> is a pointer toa directory descriptor of type DIR.  Normally, the <b><a href="./dirLib.html#readdir">readdir</a>(&nbsp;)</b> routine is used toread a directory, rather than using the FIOREADDIR function directly.  Seethe manual entry for <b><a href="./dirLib.html#top">dirLib</a></b>:<pre>    DIR dirStruct;    fd = open ("directory", O_RDONLY);    status = ioctl (fd, FIOREADDIR, &amp;dirStruct);</pre><dt><b>FIOFSTATGET</b><dd>Gets file status information (directory entry data).  The argument<i>statStruct</i> is a pointer to a stat structure that is filled with datadescribing the specified file.  Normally, the <b><a href="./dirLib.html#stat">stat</a>(&nbsp;)</b> or <b><a href="./dirLib.html#fstat">fstat</a>(&nbsp;)</b> routine isused to obtain file information, rather than using the FIOFSTATGETfunction directly.  See the manual entry for <b><a href="./dirLib.html#top">dirLib</a></b>:<pre>    struct stat statStruct;    fd = open ("file", O_RDONLY);    status = ioctl (fd, FIOFSTATGET, &amp;statStruct);</pre><dt><b>FIOFSTATFSGET</b><dd>Gets the file system parameters for and open file descriptor.  The argument<i>statfsStruct</i> is a pointer to a statfs structure that is filled with datadescribing the underlying filesystem.  Normally, the <b><a href="./dirLib.html#stat">stat</a>(&nbsp;)</b> or <b><a href="./dirLib.html#fstat">fstat</a>(&nbsp;)</b> routineis used to obtain file information, rather than using the FIOFSTATGET functiondirectly.  See the manual entry for <b><a href="./dirLib.html#top">dirLib</a></b>:<p><pre>    statfs statfsStruct;    fd = open ("directory", O_RDONLY);    status = ioctl (fd, FIOFSTATFSGET, &amp;statfsStruct);</pre> </dl></blockquote><h4>DEFICIENCIES</h4><blockquote><p>There is only one client handle/cache per task.Performance is poor if a task is accessing two or more NFS files.<p>Changing <i>nfsCacheSize</i> after a file is open could cause adverse effects.However, changing it before opening any NFS file descriptors should notpose a problem.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>nfsDrv.h</b>, <b>ioLib.h</b>, <b>dirent.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dirLib.html#top">dirLib</a></b>, <b><a href="./nfsLib.html#top">nfsLib</a></b>, <b><a href="./hostLib.html#hostAdd">hostAdd</a>(&nbsp;)</b>, <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b>,<hr><a name="nfsDrv"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>nfsDrv(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>nfsDrv(&nbsp;)</strong> - install the NFS driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS nfsDrv (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes and installs the NFS driver.  It must be called before any reads, writes, or other NFS calls.This is done automatically when <b>INCLUDE_NFS</b> is defined.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call this function from within the kernel protection domain only.  This restriction does not apply under non-AE versions of VxWorks.  <p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if there is no room for the driver.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./nfsDrv.html#top">nfsDrv</a></b><hr><a name="nfsDrvNumGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>nfsDrvNumGet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>nfsDrvNumGet(&nbsp;)</strong> - return the IO system driver number for the nfs driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int nfsDrvNumGet (void)</pre>

⌨️ 快捷键说明

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