bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

posix_openpt on Minix


From: Bruno Haible
Subject: posix_openpt on Minix
Date: Thu, 20 Oct 2011 23:16:14 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

On Minix 3.1.8, there are several issues:

1) openpty() exists in libutil, but its declaration in <util.h> is #ifdefed
   out.
2) <util.h> is not self-contained, you need to write
     #include <stdarg.h>
     #define _BSD_VA_LIST_ va_list
     #include <util.h>
3) openpty() fails with error code ENOENT.
4) When I add this code to posix_openpt.c

# if defined __minix
  if (master < 0)
    {
      /* Try various master names of Minix: /dev/pty[p-q][0-9a-f]  */
      int char1;
      int char2;

      for (char1 = 'p'; char1 <= 'q'; char1++)
        for (char2 = '0'; char2 <= 'f'; (char2 == '9' ? char2 = 'a' : char2++))
          {
            char master_name[32];

            sprintf (master_name, "/dev/pty%c%c", char1, char2);
            master = open (master_name, O_RDONLY);
            if (master >= 0)
              return master;
          }
    }
# endif

   every open() call fails with EIO.

In summary, ttys on Minix appear to be completely broken, an no-one cares.

Bruno
-- 
In memoriam Eduard Brücklmeier <http://en.wikipedia.org/wiki/Eduard_Brücklmeier>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]