home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!emba-news.uvm.edu!sadye!wollman
- From: wollman@sadye (Garrett Wollman)
- Subject: Re: xterm: no available ptys
- Message-ID: <1992Aug16.014547.5054@uvm.edu>
- Sender: news@uvm.edu
- Organization: University of Vermont, EMBA Computer Facility
- References: <BIS.92Aug14124438@maud.ifi.uio.no>
- Date: Sun, 16 Aug 1992 01:45:47 GMT
- Lines: 72
-
- In article <BIS.92Aug14124438@maud.ifi.uio.no> bis@ifi.uio.no (Bjorn Ivar Stark) writes:
- >When I try to start more than a certain limit of xterms I get
- >this error-message:
- > fosli@asterix: xterm
- > xterm: no available ptys
-
- Get X11R5 and apply the following patch in the xterm directory. After
- we did this, we never had to worry about pty problems again. (In a
- nutshell: Xterm didn't know how to use /dev/ptc to allocate a PTY from
- whole cloth, so it use /dev/[pt]ty[pqrs]? instead. Eventually, it ran
- out. Even worse, it would occasionally pick up a PTY that still had
- someone else's program running on it! This seems to have fixed both
- problems when we were running AIX 3.1, and it hasn't hurt anything in
- 3.2. As a general rule, replace all your IBM X programs (except
- Xibm!) with the X11R5 versions and you'll be much happier.)
-
- -GAWollman
-
- *** xterm-main.c.orig Thu Mar 12 11:59:56 1992
- --- xterm-main.c Thu Mar 12 12:08:33 1992
- ***************
- *** 974,982 ****
- /* got one! */
- return(0);
- #else /* sgi or umips */
-
- ! return pty_search(pty);
-
- #endif /* sgi or umips else */
- }
-
- --- 974,1008 ----
- /* got one! */
- return(0);
- #else /* sgi or umips */
- + /*
- + * AIX special case by G. Wollman, University of Vermont,
- + * 12.3.-92
- + */
- + #if defined(_AIX)
- + *pty = open("/dev/ptc", O_RDWR);
- + if (*pty < 0) {
- + return(1);
- + }
-
- ! strcpy (ttydev, ttyname(*pty));
- ! strcpy (ptydev, ttydev);
- ! ptydev[7] = 'c'; /* change "/dev/pts" to "/dev/ptc" */
- !
- ! if((*tty = open (ttydev, O_RDWR)) < 0) {
- ! close (*pty);
- ! return (1);
- ! }
-
- + /* The AIX manual isn't clear on whether or not this
- + * is necessary. Judging from the results we've seen,
- + * I would suspect that it may be.
- + */
- + frevoke(*tty); /* revoke all other access to this tty */
- +
- + return (0);
- + #else /* _AIX */
- + return pty_search(pty);
- + #endif /* _AIX */
- #endif /* sgi or umips else */
- }
-
- --
- Garrett A. Wollman = wollman@emba.uvm.edu = UVM is welcome to my opinions
- = uvm-gen!wollman =
- That's what being alive is all about. No deity, no higher goal
- exists, than to bring joy to another person. - Elf Sternberg
-