| delorie.com/archives/browse.cgi | search | 
| X-Recipient: | archive-cygwin AT delorie DOT com | 
| X-SWARE-Spam-Status: | No, hits=-0.2 required=5.0 tests=AWL,BAYES_05,J_CHICKENPOX_44,J_CHICKENPOX_64,SPF_PASS | 
| X-Spam-Check-By: | sourceware.org | 
| Message-ID: | <20090430102535.74332.qmail@web4109.mail.ogk.yahoo.co.jp> | 
| Date: | Thu, 30 Apr 2009 19:25:31 +0900 (JST) | 
| From: | neomjp <neomjp AT yahoo DOT co DOT jp> | 
| Subject: | luit-1.0.3-1: Couldn't allocate pty: No such file or directory | 
| To: | cygwin AT cygwin DOT com | 
| MIME-Version: | 1.0 | 
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm | 
| List-Id: | <cygwin.cygwin.com> | 
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> | 
| List-Archive: | <http://sourceware.org/ml/cygwin/> | 
| List-Post: | <mailto:cygwin AT cygwin DOT com> | 
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> | 
| Sender: | cygwin-owner AT cygwin DOT com | 
| Mail-Followup-To: | cygwin AT cygwin DOT com | 
| Delivered-To: | mailing list cygwin AT cygwin DOT com | 
$ cygcheck -c luit
Cygwin Package Information
Package              Version        Status
luit                 1.0.3-1        OK
$ /usr/bin/luit.exe
Couldn't allocate pty: No such file or directory
This error is caused by trying to opening a pseudo terminal in a BSD
way (instead of in a SVR4 or Unix-98 way). Here are the relevant parts
in sys.c:
#if (defined(__GLIBC__) && \
     (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))) || \
    defined(SVR4)
#define HAVE_GRANTPT
#endif
...............................
int
allocatePty(int *pty_return, char **line_return)
{
   char name[12], *line = NULL;
    int pty = -1;
    char *name1 = "pqrstuvwxyzPQRST",
        *name2 = "0123456789abcdefghijklmnopqrstuv";
...............................
#ifdef HAVE_GRANTPT
................................
    pty = open("/dev/ptmx", O_RDWR);
.....................................
#endif /* HAVE_GRANTPT */
    strcpy(name, "/dev/pty??");
    for(p1 = name1; *p1; p1++) {
        name[8] = *p1;
        for(p2 = name2; *p2; p2++) {
            name[9] = *p2;
            pty = open(name, O_RDWR);
In cygwin, the absense of __GLIBC__ or SVR4 causes HAVE_GRANTPT to be
undefined, and so the codes to use SVR4 (or Unix-98) pseudo terminals
are not enabled.
	A simple fix is to add "|| defined(__CYGWIN__)",
but the recent master of luit has a better fix. It replaced "#if
(defined(__GLIBC__) && ..." with a real configure test for grantpt.
http://cgit.freedesktop.org/xorg/app/luit/commit/?h=4823838f77ab03cccd07860fdf8002bc577e0f04
--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
--
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/
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |