xterm problem with ioctl

Rick Stevenson rick at ptcburp.ptcbu.oz.au
Fri Apr 12 22:38:26 AEST 1991


wcm at geac.com (W Christopher Martin) writes:

>I've compiled the X11R4 package under the ucb universe on our Pyramid
>(att uname -a = "OSx120M pyrogy 5.1a-900725 0409e MIS-2/02") and
>everything works great except for xterm.  It complains about
>"Error 16, errno 25: Inappropriate I/O control operation" which I've
>tracked down to the TIOCGETC in main.c.

The only changes I had to make to R4 xterm to get it to run on our
machine (OS equivalent to OSx5.1) were as follows:

*** main.c-	Mon Apr  9 08:30:54 1990
--- main.c	Fri Oct 19 11:07:27 1990
***************
*** 115,120
  #define ttyslot() 1
  #endif /* apollo */
  
  #include <utmp.h>
  #ifdef LASTLOG
  #include <lastlog.h>

--- 115,125 -----
  #define ttyslot() 1
  #endif /* apollo */
  
+ #ifdef pyr
+ #define UTMP_FILENAME	"/etc/.ucbutmp"
+ #define WTMP_FILENAME	"/etc/.ucbwtmp"
+ #endif
+ 
  #include <utmp.h>
  #ifdef LASTLOG
  #include <lastlog.h>
***************
*** 1721,1727
  #endif
  		ioctl(0, TIOCSPGRP, (char *)&pgrp);
  		setpgrp(0,0);
! 		close(open(ttydev, O_WRONLY, 0));
  		setpgrp (0, pgrp);
  #endif /* USE_SYSV_PGRP */
  

--- 1726,1737 -----
  #endif
  		ioctl(0, TIOCSPGRP, (char *)&pgrp);
  		setpgrp(0,0);
! 		/*
! 		 * This open was previously O_WRONLY which caused problems
! 		 * because of OSx /dev/tty hole protection.
! 		 * Rick Stevenson, APRIL 90.
! 		 */
! 		close(open(ttydev, O_RDWR, 0));
  		setpgrp (0, pgrp);
  #endif /* USE_SYSV_PGRP */
  
The utmp/wtmp stuff stops ugly things happening if you invoke xterm from the ATT
universe (like corruption of the ATT utmp/wtmpfiles). From memory I think the
other mod fixes a problem with access to /dev/tty being denied. I don't recall
the symptoms of this being exactly as you describe. Mail me if this doesn't
help.

Rick.
--
Rick Stevenson
Pyramid Technology Corporation			+61 75 522475 FAX
Research Park, Bond University			+61 75 950249 VOICE
Gold Coast, Q 4229, AUSTRALIA			rick at ptcburp.oz.au



More information about the Comp.sys.pyramid mailing list