📄 67540
字号:
Path: cantaloupe.srv.cs.cmu.edu!magnesium.club.cc.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!noc.near.net!bigboote.WPI.EDU!sommerfeld!vinodFrom: vinod@sommerfeld.WPI.EDU (Vinod K Nair)Newsgroups: comp.windows.xSubject: using XTERM to display output {?}Date: 30 Apr 1993 22:28:38 GMTOrganization: Worcester Polytechnic Institute, Worcester, MALines: 46Distribution: worldMessage-ID: <1rs96m$l4v@bigboote.WPI.EDU>NNTP-Posting-Host: sommerfeld.wpi.eduHello, I am writing a program which forks of a number of child processesand each of the children printing things on the screen (quite messy inone window)... The "xterm -Sxxd" option seems to be the solution to opening upslave windows only to display output and I use the following code toopen up a pty (taken from Stevens)...and manage to open up an x-termsuccessfully.... The problem however is how do I write into this x-term ? Please help!static char pty_name[12];int pty_master( void );int pty_master( void ){ int i,fd; char* ptr; struct stat statbuff; static char ptychar[] = "pqrs"; static char hexdigit[] = "0123456789abcdef"; for( ptr = ptychar; *ptr!=0; ptr++ ) { strcpy( pty_name, "/dev/ttyXY" ); pty_name[8] = *ptr; pty_name[9] = '0'; if( stat( pty_name, &statbuff) < 0 ) break; for( i=0; i < 16; i++ ) { pty_name[9] = hexdigit[i]; if( (fd = open( pty_name, O_RDWR )) >= 0 ) return( fd ); } } return(-1);} -- Vinod email : vinod@ee.wpi.eduAn eye for an eye makes the whole world blind -Mohandas Karamchand Gandhi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -