X11R4 xterm problem

Bill Moran wlm at entwash.watson.ibm.com
Mon Oct 1 07:49:09 AEST 1990


Errrrr, the no access to tty means that you didn't port X11R4.
Porting means you got it *working* not that you made it compile.
Xload needs to be ported, as the AIX kernal doesn't keep the load average
information needed. My understanding is that is is due to the crazy
security classifications. To make xload work, you need to calculate the
load average yourself. If you have BSD sourcesm it is easy to look in
the kernel, figure out how they do it, and then you simply need to
do the same thing. I would include the code to do this, but since it is
derivative of the BSD kernel code, that would probably be a no-no.
As for xterm.... the changes needed are something like:

*** main.c      Thu Jul 26 23:03:23 1990
--- main.c.orig Thu Jul 26 18:37:12 1990
***************
*** 1,5 ****
  #ifndef lint
! static char rcs_id[] = "$XConsortium: main.c,v 1.145 90/01/11 14:22:31
jim Exp
 $";
  #endif        /* lint */

  /*
--- 1,5 ----
  #ifndef lint
! static char rcs_id[] = "$XConsortium: main.c,v 1.144 89/12/20 21:39:07
jim Exp
 $";
  #endif        /* lint */

  /*
***************
*** 79,89 ****
  #define HAS_UTMP_UT_HOST
  #define HAS_BSD_GROUPS
  #endif
- #ifdef AIXV3
- #define HAS_UTMP_UT_HOST
- #define HAS_BSD_GROUPS
- #define USE_SYSV_UTMP
- #endif
  #ifdef macII
  #define HAS_UTMP_UT_HOST
  #define HAS_BSD_GROUPS
--- 79,84 ----
***************
*** 931,951 ****
        /* got one! */
        return(0);
  #else /* not (umips && SYSTYPE_SYSV) */
- #ifdef AIXV3
-       struct stat fstat_buf;
-       char *name;
-       int temptty;
-
-       *pty = open ("/dev/ptc", O_RDWR);
-       if ((*pty < 0) || ((name = ttyname(*pty)) == NULL)) {
-         return(1);
-       }
-       strcpy( ttydev, name );
-       strcpy( ptydev, name );
-       ptydev[7] = 'c';
-       ttydev[7] = 's';
-       return(0);
- #else
  #ifdef CRAY
        for (; devindex < 256; devindex++) {
            sprintf (ttydev, "/dev/ttyp%03d", devindex);
--- 926,931 ----
***************
*** 980,986 ****
            (void) letter++;
        }
  #endif /* CRAY else not CRAY */
- #endif /* AIXV3 else not AIXV3
        /* We were unable to allocate a pty master!  Return an error
         * condition and let our caller terminate cleanly.
         */
--- 960,965 ----
***************
*** 1459,1468 ****
                (void) setpgrp();
  #endif        /* USE_SYSV_PGRP */
                while (1) {
- #ifdef AIXV3
-                       setsid();
- #endif
-
  #ifdef TIOCNOTTY
                        if ((tty = open ("/dev/tty", 2)) >= 0) {
                                ioctl (tty, TIOCNOTTY, (char *) NULL);
--- 1438,1443 ----
***************
*** 1806,1813 ****
                tslot = ttyslot();
                added_utmp_entry = False;
                {
!                       if ((pw = getpwuid(screen->uid)) &&
!                           !resource.utmpInhibit &&
                            (i = open(etc_utmp, O_WRONLY)) >= 0) {
                                bzero((char *)&utmp, sizeof(struct utmp));
                                (void) strncpy(utmp.ut_line,
--- 1781,1788 ----
                tslot = ttyslot();
                added_utmp_entry = False;
                {
!                       if (!resource.utmpInhibit &&
!                           (pw = getpwuid(screen->uid)) &&
                            (i = open(etc_utmp, O_WRONLY)) >= 0) {
                                bzero((char *)&utmp, sizeof(struct utmp));
                                (void) strncpy(utmp.ut_line,
***************
*** 1877,1883 ****

                (void) setgid (screen->gid);
  #ifdef HAS_BSD_GROUPS
!               if (geteuid() == 0 && pw)
                  initgroups (pw->pw_name, pw->pw_gid);
  #endif
                (void) setuid (screen->uid);
--- 1852,1858 ----

                (void) setgid (screen->gid);
  #ifdef HAS_BSD_GROUPS
!               if (geteuid() == 0)
                  initgroups (pw->pw_name, pw->pw_gid);
  #endif
                (void) setuid (screen->uid);
***************
*** 1963,1982 ****
                /* fix pts sh hanging around */
                signal (SIGHUP, SIG_DFL);
  #endif
! #ifdef AIXV3
!               /* The AIXV3.1 "rsh" command turns off INTR in sigmask. We
!                  must turn it back on.  No you cannot solve this by calling
!                  signal(SIGINT,SIG_DFL).  Tried.
!                  -- Dan Greening dgreen at ibm.com  */
!               {
!                 extern int sigprocmask();
!                 int mask;
!                 sigset_t set, oset;
!
!                 sigemptyset(&set);
!                 sigprocmask(SIG_SETMASK,&set,&oset);
!               }
! #endif /* AIXV3 */
  #ifdef UTMP
                if(((ptr = getenv("SHELL")) == NULL || *ptr == 0) &&
                 ((pw == NULL && (pw = getpwuid(screen->uid)) == NULL) ||
--- 1938,1944 ----
                /* fix pts sh hanging around */
                signal (SIGHUP, SIG_DFL);
  #endif
!
  #ifdef UTMP
                if(((ptr = getenv("SHELL")) == NULL || *ptr == 0) &&
                 ((pw == NULL && (pw = getpwuid(screen->uid)) == NULL) ||

-------------------

Bill Moran



More information about the Comp.unix.aix mailing list