ia64/xen-unstable

changeset 19790:01ad2654815a

minios: Use posix_openpt() rather than non-standard openpty().

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 18 10:19:25 2009 +0100 (2009-06-18)
parents cf6d3211ec59
children c0d2838fc10f
files extras/mini-os/include/lib.h extras/mini-os/lib/sys.c
line diff
     1.1 --- a/extras/mini-os/include/lib.h	Thu Jun 18 10:18:10 2009 +0100
     1.2 +++ b/extras/mini-os/include/lib.h	Thu Jun 18 10:19:25 2009 +0100
     1.3 @@ -101,7 +101,6 @@ char * strcat(char * dest, const char * 
     1.4  char  *strdup(const char *s);
     1.5  #endif
     1.6  #include <mini-os/console.h>
     1.7 -int openpty(void);
     1.8  
     1.9  #define RAND_MIX 2654435769U
    1.10  
     2.1 --- a/extras/mini-os/lib/sys.c	Thu Jun 18 10:18:10 2009 +0100
     2.2 +++ b/extras/mini-os/lib/sys.c	Thu Jun 18 10:19:25 2009 +0100
     2.3 @@ -167,15 +167,17 @@ int mkdir(const char *pathname, mode_t m
     2.4      return 0;
     2.5  }
     2.6  
     2.7 -int openpty(void)
     2.8 +int posix_openpt(int flags)
     2.9  {
    2.10      struct consfront_dev *dev;
    2.11  
    2.12 +    /* Ignore flags */
    2.13 +
    2.14      dev = init_consfront(NULL);
    2.15      dev->fd = alloc_fd(FTYPE_CONSOLE);
    2.16      files[dev->fd].cons.dev = dev;
    2.17  
    2.18 -    printk("fd(%d) = openpty\n", dev->fd);
    2.19 +    printk("fd(%d) = posix_openpt\n", dev->fd);
    2.20      return(dev->fd);
    2.21  }
    2.22  
    2.23 @@ -188,6 +190,8 @@ int open(const char *pathname, int flags
    2.24          printk("open(%s) -> %d\n", pathname, fd);
    2.25          return fd;
    2.26      }
    2.27 +    if (!strncmp(pathname, "/dev/ptmx", strlen("/dev/ptmx")))
    2.28 +        return posix_openpt(flags);
    2.29      printk("open(%s, %x)", pathname, flags);
    2.30      switch (flags & ~O_ACCMODE) {
    2.31          case 0:
    2.32 @@ -1341,6 +1345,9 @@ unsupported_function_crash(lockf);
    2.33  unsupported_function_crash(sysconf);
    2.34  unsupported_function(int, tcsetattr, -1);
    2.35  unsupported_function(int, tcgetattr, 0);
    2.36 +unsupported_function(int, grantpt, -1);
    2.37 +unsupported_function(int, unlockpt, -1);
    2.38 +unsupported_function(char *, ptsname, NULL);
    2.39  unsupported_function(int, poll, -1);
    2.40  
    2.41  /* net/if.h */