Optimize cygwin on recent windows version (Vista and Seven)

Andy Koppe andy.koppe@gmail.com
Tue Jun 16 00:28:00 GMT 2009


2009/6/15 Christopher Faylor:
>>One issue that I've noticed on Windows 7, both with Cygwin 1.5 and
>>1.7, is that trying to log a utmp entry when starting a terminal can
>>take up to half a minute, presumably due to waiting for some sort of
>>timeout.
>
> Sorry but this isn't a much more useful report.

You're right, sorry. Here's how I got it: repeatedly invoke rxvt,
xterm, or 'mintty -u'. The first invocation would usually be fine, but
subsequent invocations would hang for something like half a minute.

When disabling the utmp entry, using 'rxvt -ut', 'xterm -ut', or
mintty without -u, there'd be no delay.

In MinTTY, the -u option activates the following bit of code. fd is
the master side of its pseudo terminal:

static struct utmp ut;
...
      ut.ut_type = USER_PROCESS;
      ut.ut_pid = pid;
      ut.ut_time = time(0);
      char *dev = ptsname(fd);
      if (dev) {
        if (strncmp(dev, "/dev/", 5) == 0)
          dev += 5;
        strncpy(ut.ut_line, dev ?: "?", sizeof ut.ut_line);
        if (strncmp(dev, "pty", 3) == 0 || strncmp(dev, "tty", 3) == 0)
          dev += 3;
        strncpy(ut.ut_id, dev ?: "?", sizeof ut.ut_id);
      }
      strncpy(ut.ut_user, (pw ? pw->pw_name : 0) ?: "?", sizeof ut.ut_user);
      login(&ut);

Unfortunately my Windows 7 machine went belly-up, so I can't look into
this further at the moment.

Andy

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list