X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 	tests=AWL,BAYES_00,J_CHICKENPOX_73,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20090615184059.GC23085@ednor.casa.cgf.cx>
References: <7c6dcbb9c797277cc8ffb1fc985844af@mail.smartmobili.com> 	 <416096c60906151139n45e0d967n8abee104fe194867@mail.gmail.com> 	 <20090615184059.GC23085@ednor.casa.cgf.cx>
Date: Mon, 15 Jun 2009 20:28:47 +0100
Message-ID: <416096c60906151228l19d8c458i9218708e7c7cf3cd@mail.gmail.com>
Subject: Re: Optimize cygwin on recent windows version (Vista and Seven)
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

