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

📄 wdbtsfsdrv.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/wdbTsfsDrv.html - generated by refgen from wdbTsfsDrv.c --> <title> wdbTsfsDrv </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>wdbTsfsDrv</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>wdbTsfsDrv</strong> - virtual generic file I/O driver for the WDB agent </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./wdbTsfsDrv.html#wdbTsfsDrv">wdbTsfsDrv</a></i>(&nbsp;)</b>  -  initialize the TSFS device driver for a WDB agent<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This library provides a virtual file I/O driver for use with the WDBagent.  I/O is performed on this virtual I/O device exactly as it would beon any device referencing a VxWorks file system.  File operations, such as<b><i><a href="./ioLib.html#read">read</a></i>(&nbsp;)</b> and <b><i><a href="./ioLib.html#write">write</a></i>(&nbsp;)</b>, move data over a virtual I/O channel created between theWDB agent and the Tornado target server.  The operations are then executed on the host file system.  Because file operations are actually performed on the host file system by the target server, the file system presented by this virtual I/O device is known as the target-server file system, or TSFS.<p>The driver is installed with <b><i><a href="./wdbTsfsDrv.html#wdbTsfsDrv">wdbTsfsDrv</a></i>(&nbsp;)</b>, creating a device typicallycalled <b>/tgtsvr</b>.  See the manual page for <b><i><a href="./wdbTsfsDrv.html#wdbTsfsDrv">wdbTsfsDrv</a></i>(&nbsp;)</b> for more informationabout using this function.  The initialization is done automatically,enabling access to TSFS, when <b>INCLUDE_WDB_TSFS</b> is defined.The target server also must have TSFS enabled in order to use TSFS.  See the<i>WindView User's Guide: Data Upload </i>and the target server documentation.<p></blockquote><h4>TSFS SOCKETS</h4><blockquote><p>TSFS provides all of the functionality of other VxWorks file systems.For details, see the <i>VxWorks Programmer's Guide: I/O System and Local File Systems.</i>In addition to normalfiles, however, TSFS also provides basic access to TCP sockets.  Thisincludes opening the client side of a TCP socket, reading, writing, andclosing the socket.  Basic <b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> commands are also supported.<p>To open a TCP socket using TSFS, use a filename of the form:<pre>    TCP:<i>server_name</i> | <i>server_ip</i>:<i>port_number</i></pre>To open and connect a TCP socket to a server socket located on a server named <b>mongoose</b>, listening on port 2010, use the following:<pre>    fd = open ("/tgtsvr/TCP:mongoose:2010", 0, 0)</pre>The open flags and permission arguments to the open call are ignored whenopening a socket through TSFS.  If the server <b>mongoose</b> has an IPnumber of <b>144.12.44.12</b>, you can use the following equivalent form of the command:<pre>    fd = open ("/tgtsvr/TCP:144.12.44.12:2010", 0, 0)</pre></blockquote><h4>DIRECTORIES</h4><blockquote><p>All directory functions, such as <b><i><a href="./usrLib.html#mkdir">mkdir</a></i>(&nbsp;)</b>, <b><i><a href="./usrLib.html#rmdir">rmdir</a></i>(&nbsp;)</b>, <b><i><a href="./dirLib.html#opendir">opendir</a></i>(&nbsp;)</b>, <b><i><a href="./dirLib.html#readdir">readdir</a></i>(&nbsp;)</b>,<b><i><a href="./dirLib.html#closedir">closedir</a></i>(&nbsp;)</b>, and <b><i><a href="./dirLib.html#rewinddir">rewinddir</a></i>(&nbsp;)</b> are supported by TSFS, regardless ofwhether the target server providing TSFS is being run on a UNIX or Windows host.<p>While it is possible to open and close directories using <b><i><a href="./ioLib.html#open">open</a></i>(&nbsp;)</b> and <b><i><a href="./ioLib.html#close">close</a></i>(&nbsp;)</b>,it is not possible to read from a directory using <b><i><a href="./ioLib.html#read">read</a></i>(&nbsp;)</b>. Instead, <b><i><a href="./dirLib.html#readdir">readdir</a></i>(&nbsp;)</b> must be used.  It is also not possible to write to an open directory, and opening a directory for anything other than read-only results in an error, with <b>errno</b> set to <b>EISDIR</b>.  Calling <b><i><a href="./ioLib.html#read">read</a></i>(&nbsp;)</b> on a directory returns <b>ERROR</b> with <b>errno</b> set to <b>EISDIR</b>.<p></blockquote><h4>OPEN FLAGS</h4><blockquote><p>When the target server that is providing the TSFS is running on a Windowshost, the default file-translation mode is binary translation.  If texttranslation is required, then <b>WDB_TSFS_O_TEXT</b> can be included in the modeargument to <b><i><a href="./ioLib.html#open">open</a></i>(&nbsp;)</b>.  For example:<pre>    fd = open ("/tgtsvr/foo", O_CREAT | O_RDWR | WDB_TSFS_O_TEXT, 0777)</pre>If the target server providing TSFS services is running on a UNIX host, <b>WDB_TSFS_O_TEXT</b> is ignored.<p></blockquote><h4>TGTSVR</h4><blockquote><p>For general information on the target server, see the referenceentry for <b><a href="../../tornado/tools/tgtsvr.html#top" >tgtsvr</a></b>. In order to use this library, the target server mustsupport and be configured with the following options:<p><dl><dt>-R <i>root</i><dd>Specify the root of the host's file system that is visible to target processesusing TSFS.  This flag is required to use TSFS.  Files under this root are bydefault read only.  To allow read/write access, specify -RW.<p><dt>-RW<dd>Allow read and write access to host files by target processes usingTSFS.  When this option is specified, access to thetarget server is restricted as if <b>-L</b> were also specified.<p></dl></blockquote><h4>IOCTL SUPPORT</h4><blockquote><p><p>TSFS supports the following <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> functions for controlling filesand sockets. Details about each function can be found in the documentation listed below.<p><dl><dt><b>FIOSEEK</b><dd><p><dt><b>FIOWHERE</b><dd><p><dt><b>FIOMKDIR</b><dd>Create a directory.  The path, in this case <b>/tgtsvr/tmp</b>, must be anabsolute path prefixed with the device name. To create the directory <b>/tmp</b> on the root of the TSFS file system use the following:<pre>    status = ioctl (fd, FIOMKDIR, "/tgtsvr/tmp")</pre><dt><b>FIORMDIR</b><dd>Remove a directory.  The path, in this case <b>/tgtsvr/foo</b>, must be an absolute path prefixed with the device name.  To remove the directory <b>/foo</b> from the root of the TSFS file system, use the following:<pre>    status = ioctl (fd, FIORMDIR, "/tgtsvr/foo")</pre><dt><b>FIORENAME</b><dd>Rename the file or directory represented by <b>fd</b> to the name in the stringpointed to by <b>arg</b>.  The path indicated by <b>arg</b> may be prefixed with thedevice name or not.  Using this <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> function with the path <b>/foo/goo</b>produces the same outcome as the path <b>/tgtsvr/foo/goo</b>.  The path is notmodified to account for the current working directory, and therefore mustbe an absolute path.<pre>    char *arg = "/tgtsvr/foo/goo";     status = ioctl (fd, FIORENAME, arg);</pre><dt><b>FIOREADDIR</b><dd><p><dt><b>FIONREAD</b><dd>Return the number of bytes ready to read on a TSFS socket filedescriptor.<p><dt><b>FIOFSTATGET</b><dd><p><dt><b>FIOGETFL</b><dd> </dl><p>The following <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> functions can be used only on socket filedescriptors.  Using these functions with <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> provides similar behaviorto the <b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> and <b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b> functions usually used with socketdescriptors.  Each command's name is derived from a<b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b>/<b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> command and works in exactly the same way as therespective <b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b>/<b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> command.  The functions <b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b>and <b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b> can not be used with TSFS socket file descriptors.<p>For example, to enable recording of debugging information on the TSFS socketfile descriptor, call:<pre>    int arg = 1;    status = ioctl (fd, SO_SETDEBUG, arg);</pre>To determine whether recording of debugging information for the TSFS-socketfile descritptor is enabled or disabled, call:<pre>    int arg;    status = ioctl (fd, SO_GETDEBUG, &amp; arg);</pre>After the call to <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b>, <b>arg</b> contains the state of the debugging attribute.<p>The <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>(&nbsp;)</b> functions supported for TSFS sockets are:<p><dl><dt><b>SO_SETDEBUG</b><dd>Equivalent to <b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> with the <b>SO_DEBUG</b> command.<p><dt><b>SO_GETDEBUG</b><dd>Equivalent to <b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b> with the <b>SO_DEBUG</b> command.<p><dt><b>SO_SETSNDBUF</b><dd>This command changes the size of the send buffer of the host socket.  The configuration of the WDB channel between the host and target also affects thenumber of bytes that can be written to the TSFS file descriptor in a singleattempt.<p><dt><b>SO_SETRCVBUF</b><dd>This command changes the size of the receive buffer of the host socket.  The configuration of the WDB channel between the host and target also affects thenumber of bytes that can be read from the TSFS file descriptor in a singleattempt.<p><dt><b>SO_SETDONTROUTE</b><dd>Equivalent to <b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> with the <b>SO_DONTROUTE</b> command.<p><dt><b>SO_GETDONTROUTE</b><dd>Equivalent to <b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b> with the <b>SO_DONTROUTE</b> command.<p><dt><b>SO_SETOOBINLINE</b><dd>Equivalent to <b><i><a href="./sockLib.html#setsockopt">setsockopt</a></i>(&nbsp;)</b> with the <b>SO_OOBINLINE</b> command.<p><dt><b>SO_GETOOBINLINE</b><dd>Equivalent to <b><i><a href="./sockLib.html#getsockopt">getsockopt</a></i>(&nbsp;)</b> with the <b>SO_OOBINLINE</b> command.<p><dt><b>SO_SNDURGB</b><dd>The <b>SO_SNDURGB</b> command sends one out-of-band byte (pointed to by <b>arg</b>) through the socket.<p></dl></blockquote><h4>ERROR CODES</h4><blockquote><p><p>The routines in this library return the VxWorks error codes that most closely match the errnos generated by the corresponding host function.If an error is encountered that is due to a WDB failure, a WDB erroris returned instead of the standard VxWorks <b>errno</b>.  If an <b>errno</b> generatedon the host has no reasonable VxWorks counterpart, the host <b>errno</b> ispassed to the target calling routine unchanged.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wdbTsfsDrv.html#top">wdbTsfsDrv</a></b>, <i>Tornado User's Guide, </i><i>VxWorks Programmer's Guide: I/O System, Local File Systems </i><p><hr><a name="wdbTsfsDrv"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>wdbTsfsDrv</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>wdbTsfsDrv</i>(&nbsp;)</strong> - initialize the TSFS device driver for a WDB agent</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS wdbTsfsDrv    (    char * name /* root name in i/o system */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the VxWorks virtual I/O "2" driver and createsa TSFS device of the specified name.<p>This routine should be called exactly once, before any reads, writes, oropens.  Normally, it is called by <b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>(&nbsp;)</b> in <b>usrConfig.c</b>,and the device name created is <b>/tgtsvr</b>.<p>After this routine has been called, individual virtual I/O channelscan be opened by appending the host file name to the virtual I/Odevice name.  For example, to get a file descriptor for the hostfile <b>/etc/passwd</b>, call <b><i><a href="./ioLib.html#open">open</a></i>(&nbsp;)</b> as follows:<pre>    fd = open ("/tgtsvr/etc/passwd", O_RDWR, 0)</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the driver can not be installed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wdbTsfsDrv.html#top">wdbTsfsDrv</a></b></body></html>

⌨️ 快捷键说明

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