ptydrv.html

来自「Vxworks API操作系统和驱动程序设计API。压缩的HTML文件」· HTML 代码 · 共 172 行

HTML
172
字号
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ptyDrv.html - generated by refgen from ptyDrv.c --> <title> ptyDrv </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>ptyDrv</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ptyDrv</strong> - pseudo-terminal driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./ptyDrv.html#ptyDrv">ptyDrv</a>(&nbsp;)</b>  -  initialize the pseudo-terminal driver<br><b><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a>(&nbsp;)</b>  -  create a pseudo terminal<br><b><a href="./ptyDrv.html#ptyDevRemove">ptyDevRemove</a>(&nbsp;)</b>  -  destroy a pseudo terminal<br><b><a href="./ptyDrv.html#ptyShow">ptyShow</a>(&nbsp;)</b>  -  show the state of the Pty Buffers <br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>The pseudo-terminal driver provides a tty-like interface between a master andslave process, typically in network applications.  The master processsimulates the "hardware" side of the driver (e.g., a USART serial chip), whilethe slave process is the application program that normally talks to the driver.<p></blockquote><h4>USER-CALLABLE ROUTINES</h4><blockquote><p>Most of the routines in this driver are accessible only through the I/Osystem.  However, the following routines must be called directly: <b><a href="./ptyDrv.html#ptyDrv">ptyDrv</a>(&nbsp;)</b> toinitialize the driver, <b><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a>(&nbsp;)</b> to create devices, and <b><a href="./ptyDrv.html#ptyDevRemove">ptyDevRemove</a>(&nbsp;)</b>to remove an existing device.<p></blockquote><h4>INITIALIZING THE DRIVER</h4><blockquote><p>Before using the driver, it must be initialized by calling <b><a href="./ptyDrv.html#ptyDrv">ptyDrv</a>(&nbsp;)</b>.This routine must be called before any reads, writes, or calls to<b><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a>(&nbsp;)</b>.<p></blockquote><h4>CREATING PSEUDO-TERMINAL DEVICES</h4><blockquote><p>Before a pseudo-terminal can be used, it must be created by calling<b><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a>(&nbsp;)</b>:<pre>    STATUS ptyDevCreate        (        char  *name,      /* name of pseudo terminal      */        int   rdBufSize,  /* size of terminal read buffer */        int   wrtBufSize  /* size of write buffer         */        )</pre>For instance, to create the device pair "/pty/0.M" and "<b>/pty/0.S</b>",with read and write buffer sizes of 512 bytes, the proper call would be:<pre>   ptyDevCreate ("/pty/0.", 512, 512);</pre>When <b><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a>(&nbsp;)</b> is called, two devices are created, a master andslave.  One is called <i>name</i>M and the other <i>name</i>S.  They canthen be opened by the master and slave processes.  Data written to themaster device can then be read on the slave device, and vice versa.  Callsto <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b> may be made to either device, but they should only apply to theslave side, since the master and slave are the same device.<p>The <b><a href="./ptyDrv.html#ptyDevRemove">ptyDevRemove</a>(&nbsp;)</b> routine will delete an existing pseudo-terminal deviceand reclaim the associated memory. Any file descriptors associated withthe device will be closed.<p></blockquote><h4>IOCTL FUNCTIONS</h4><blockquote><p>Pseudo-terminal drivers respond to the same <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b> functions used bytty devices.  These functions are defined in <b>ioLib.h</b> and documented inthe manual entry for <b><a href="./tyLib.html#top">tyLib</a></b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>ioLib.h</b>, <b>ptyDrv.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tyLib.html#top">tyLib</a></b>,<i>VxWorks Programmer's Guide: I/O System </i><hr><a name="ptyDrv"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ptyDrv(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ptyDrv(&nbsp;)</strong> - initialize the pseudo-terminal driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ptyDrv (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the pseudo-terminal driver.It must be called before any other routine in this module.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the master or slave devices cannot be installed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ptyDrv.html#top">ptyDrv</a></b><hr><a name="ptyDevCreate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ptyDevCreate(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ptyDevCreate(&nbsp;)</strong> - create a pseudo terminal</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ptyDevCreate    (    char * name,              /* name of pseudo terminal */    int    rdBufSize,         /* size of terminal read buffer */    int    wrtBufSize         /* size of write buffer */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a master and slave device which can then be opened bythe master and slave processes.  The master process simulates the "hardware"side of the driver, while the slave process is the application program thatnormally talks to a tty driver.   Data written to the master device can thenbe read on the slave device, and vice versa.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if memory is insufficient.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ptyDrv.html#top">ptyDrv</a></b><hr><a name="ptyDevRemove"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ptyDevRemove(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ptyDevRemove(&nbsp;)</strong> - destroy a pseudo terminal</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ptyDevRemove    (    char * pName              /* name of pseudo terminal to remove */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes an existing master and slave device and releases allallocated memory. It will close any open files using either device.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if terminal not found<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ptyDrv.html#top">ptyDrv</a></b><hr><a name="ptyShow"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>ptyShow(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ptyShow(&nbsp;)</strong> - show the state of the Pty Buffers </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void ptyShow (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ptyDrv.html#top">ptyDrv</a></b></body></html>

⌨️ 快捷键说明

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