📄 c-fileaxs3.html
字号:
</dl><dl class="margin"><dd><div class="Indent"><a name="90194"> </a>Otherwise, specify a pointer to a <b class="symbol_UC">DOS_VOL_CONFIG</b> structure rather than <b class="symbol_UC">NULL</b> as the third argument to <b class="routine"><i class="routine">dosFsDevInit</i></b><b>( )</b>(see the <b class="library">dosFsLib</b> reference entry for details).</div><br></dl></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="93531"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>For NFS-exportable file systems, the device name must <i class="emphasis">not</i> end in a slash.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="90204">Exporting a File System through NFS</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="90206"> </a>After you have an exportable file system, call <b class="routine"><i class="routine">nfsExport</i></b><b>( )</b>to make it available to NFS clients on your network. Then mount the file system from the remote NFS client, using the facilities of that system. The following example shows how to export the new dosFs file system from a VxWorks platform called <b class="file">vxTarget</b>, and how to mount it from a typical UNIX system.</p></dl><dl class="margin"><p><ol class="List"><li value="1."><a name="90207"> </a>After the file system (<b class="file">/export</b> in this example) is initialized, the following function call specifies it as a file system to be exported with NFS:</li></ol></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="90208">nfsExport ("/export", 0, FALSE, 0);</a></b></pre></dl></dl><dl class="margin"><dd><div class="Indent"><a name="90209"> </a>The first three arguments specify the name of the file system to export; the VxWorks NFS export ID (0 means to assign one automatically); and whether to export the file system as read-only. The last argument is a place-holder for future extensions.</div><br></dl><p><ol class="List"><li value="2."><a name="90210"> </a>To mount the file system from another machine, see the system documentation for that machine. Specify the name of the VxWorks system that exports the file system, and the name of the desired file system. You can also specify a different name for the file system as seen on the NFS client.</li></ol></p></dl></dl><dl class="margin"><dd> <p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="93539"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>On UNIX systems, you normally need root access to mount file systems.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dl class="margin"><dd><div class="Indent"><a name="90220"> </a>For example, on a typical UNIX system, the following command (executed with root privilege) mounts the <b class="file">/export</b> file system from the VxWorks system <b class="file">vxTarget</b>, using the name <b class="file">/mnt</b> for it on UNIX:</div><br><dl class="margin"><dd><pre class="Code3"><b><a name="90221"></b><tt class="output"># </tt><b>/etc/mount vxTarget:/export /mnt</a></b></pre></dl></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="90223">Properties of NFS-Exported File Systems</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="90225"> </a>Several global variables allow you to specify dosFs facilities related to NFS support. Because these facilities use global variables, you can export previously existing dosFs file systems without altering the existing configuration stored with the file system data on disk. </p><dd><p class="Body"><a name="90226"> </a>However, because these are global variables, you must take care to avoid race conditions if more than one task initializes dosFs file systems. If your application initializes file systems for NFS on the fly, you may need mutual exclusion surrounding these global variable settings and the corresponding file system initialization.</p><dd><p class="Body"><a name="90228"> </a>You can specify a single user ID, group ID, and mode (permissions) for all files within a dosFs file system. To specify these values, define the following global variables before initializing a dosFs file system with either <b class="routine"><i class="routine">dosFsDevInit</i></b><b>( )</b> or <b class="routine"><i class="routine">dosFsMkfs</i></b><b>( )</b>:</p></dl><dl class="margin"><dd><div class="Item"><a name="90232"> </a><b class="symbol_lc">dosFsUserId</b> </div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="90233"> </a>Numeric user ID. Default: 65534.</div><br></dl></dl><dd><div class="Item"><a name="90235"> </a><b class="symbol_lc">dosFsGroupId</b> </div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="90236"> </a>Numeric group ID. Default: 65534.</div><br></dl></dl><dd><div class="Item"><a name="90238"> </a><b class="symbol_lc">dosFsFileMode</b> </div><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="90239"> </a>Numeric file access mode (that is, permissions with UNIX encoding). Default: 511 (octal, 777).</div><br></dl></dl></dl><dl class="margin"><dd><p class="Body"><a name="90240"> </a>These settings remain in effect for the file system until you reboot.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/warning.gif"></td><td><hr><div class="CalloutCell"><a name="92954"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">WARNING: </font></b></a><b class="symbol_lc">dosFsFileMode</b> controls only how the file access mode is reported to NFS clients; it does not override local access restrictions on the DOS file system. In particular, if any file in an exported file system has <b class="symbol_UC">DOS_ATTR_RDONLY</b> set in its file-attribute byte, no modifications to that file are permitted regardless of what <b class="symbol_lc">dosFsFileMode</b> says.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="90252"> </a>You can also set the current date and time for the DOS file system using <b class="routine"><i class="routine">dosFsDateSet</i></b><b>( )</b>and <b class="routine"><i class="routine">dosFsTimeSet</i></b><b>( )</b>. For a discussion of these routines and other standard dosFs facilities, see <i class="title">VxWorks Programmer's Guide: MS-DOS-Compatible File System: dosFs</i>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="90255">Limitations of the VxWorks NFS Server</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="90257"> </a>The VxWorks NFS Server can export only dosFs file systems, which leads to the following DOS limitations:</p></dl><dl class="margin"><p class="listspace"><ul class="Dash" type="circle"><li><a name="90258"> </a>File names in dosFs normally share the DOS limit of 8 characters with a three-character extension. An optional dosFs feature allows (at the expense of DOS compatibility) file names up to forty characters long. To enable this extension, create the file system with the <b class="symbol_UC">DOS_OPT_LONGNAMES</b> option (defined in <b class="file">dosFsLib.h</b>).</li></ul></p><p class="listspace"><ul class="Dash" type="circle"><li><a name="90260"> </a>DOS file systems do not provide for permissions, user IDs, and group IDs on individual files. You can provide a single user ID, a single group ID, and a single set of permissions for all files on an entire DOS file system by defining the global variables <b class="symbol_lc">dosFsUserId</b>, <b class="symbol_lc">dosFsGroupId</b>, and <b class="symbol_lc">dosFsFileMode</b>, described in the reference entry for <b class="library">dosFsLib</b>.</li></ul></p><p class="listspace"><ul class="Dash" type="circle"><li><a name="90265"> </a>Because the DOS file system does not provide file permissions, VxWorks does not normally provide authentication services for NFS requests. To authenticate incoming requests, write your own authentication functions and arrange to call them when needed. See the reference entries for <b class="routine"><i class="routine">nfsdInit</i></b><b>( )</b> and <b class="routine"><i class="routine">mountdInit</i></b><b>( )</b> for information on authorization hooks.</li></ul></p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-fileaxs.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-fileaxs.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-fileaxs2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-fileaxs4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -