📄 ptydrv.html
字号:
<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.html"><i>VxWorks Reference Manual : 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><i><a href="./ptyDrv.html#ptyDrv">ptyDrv</a></i>( )</b> - initialize the pseudo-terminal driver<br><b><i><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a></i>( )</b> - create a pseudo terminal<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><i><a href="./ptyDrv.html#ptyDrv">ptyDrv</a></i>( )</b> toinitialize the driver, and <b><i><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a></i>( )</b> to create devices.<p></blockquote><h4>INITIALIZING THE DRIVER</h4><blockquote><p>Before using the driver, it must be initialized by calling <b><i><a href="./ptyDrv.html#ptyDrv">ptyDrv</a></i>( )</b>.This routine must be called before any reads, writes, or calls to<b><i><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a></i>( )</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><i><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a></i>( )</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><i><a href="./ptyDrv.html#ptyDevCreate">ptyDevCreate</a></i>( )</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><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</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></blockquote><h4>IOCTL FUNCTIONS</h4><blockquote><p>Pseudo-terminal drivers respond to the same <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b> functions used bytty devices. These functions are defined in <b>ioLib.h</b> and documented inthe manual entry for tyLib.<p></blockquote><h4>CAVEAT</h4><blockquote><p>Pseudo-terminal devices cannot be deleted and the associated memory cannotbe reclaimed.<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="./ptyDrv.html#top">ptyDrv</a></b>, <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.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ptyDrv</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ptyDrv</i>( )</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.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ptyDevCreate</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ptyDevCreate</i>( )</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></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -