home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8843 < prev    next >
Encoding:
Text File  |  1992-08-15  |  2.5 KB  |  84 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!emba-news.uvm.edu!sadye!wollman
  3. From: wollman@sadye (Garrett Wollman)
  4. Subject: Re: xterm: no available ptys
  5. Message-ID: <1992Aug16.014547.5054@uvm.edu>
  6. Sender: news@uvm.edu
  7. Organization: University of Vermont, EMBA Computer Facility
  8. References: <BIS.92Aug14124438@maud.ifi.uio.no>
  9. Date: Sun, 16 Aug 1992 01:45:47 GMT
  10. Lines: 72
  11.  
  12. In article <BIS.92Aug14124438@maud.ifi.uio.no> bis@ifi.uio.no (Bjorn Ivar Stark) writes:
  13. >When I try to start more than a certain limit of xterms I get
  14. >this error-message:
  15. >    fosli@asterix: xterm
  16. >    xterm: no available ptys
  17.  
  18. Get X11R5 and apply the following patch in the xterm directory.  After
  19. we did this, we never had to worry about pty problems again.  (In a
  20. nutshell: Xterm didn't know how to use /dev/ptc to allocate a PTY from
  21. whole cloth, so it use /dev/[pt]ty[pqrs]? instead.  Eventually, it ran
  22. out.  Even worse, it would occasionally pick up a PTY that still had
  23. someone else's program running on it!  This seems to have fixed both
  24. problems when we were running AIX 3.1, and it hasn't hurt anything in
  25. 3.2.  As a general rule, replace all your IBM X programs (except
  26. Xibm!) with the X11R5 versions and you'll be much happier.)
  27.  
  28. -GAWollman
  29.  
  30. *** xterm-main.c.orig    Thu Mar 12 11:59:56 1992
  31. --- xterm-main.c    Thu Mar 12 12:08:33 1992
  32. ***************
  33. *** 974,982 ****
  34.       /* got one! */
  35.       return(0);
  36.   #else /* sgi or umips */
  37.   
  38. !     return pty_search(pty);
  39.   
  40.   #endif /* sgi or umips else */
  41.   }
  42.   
  43. --- 974,1008 ----
  44.       /* got one! */
  45.       return(0);
  46.   #else /* sgi or umips */
  47. +     /*
  48. +      * AIX special case by G. Wollman, University of Vermont,
  49. +      * 12.3.-92
  50. +      */
  51. + #if defined(_AIX)
  52. +     *pty = open("/dev/ptc", O_RDWR);
  53. +     if (*pty < 0) {
  54. +       return(1);
  55. +     }
  56.   
  57. !     strcpy (ttydev, ttyname(*pty));
  58. !     strcpy (ptydev, ttydev);
  59. !     ptydev[7] = 'c';    /* change "/dev/pts" to "/dev/ptc" */
  60. !     if((*tty = open (ttydev, O_RDWR)) < 0) {
  61. !       close (*pty);
  62. !       return (1);
  63. !     }
  64.   
  65. +     /* The AIX manual isn't clear on whether or not this
  66. +      * is necessary.  Judging from the results we've seen,
  67. +      * I would suspect that it may be.
  68. +      */
  69. +     frevoke(*tty);        /* revoke all other access to this tty */
  70. +     return (0);
  71. + #else /* _AIX */
  72. +     return pty_search(pty);
  73. + #endif /* _AIX */
  74.   #endif /* sgi or umips else */
  75.   }
  76.   
  77. -- 
  78.    Garrett A. Wollman  = wollman@emba.uvm.edu = UVM is welcome to my opinions
  79.                        =    uvm-gen!wollman   =
  80.    That's what being alive is all about.  No deity, no higher goal
  81.    exists, than to bring joy to another person.    - Elf Sternberg
  82.