Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / ada / terminals.c
index 18a4f2a..36b97a6 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *                     Copyright (C) 2008-2011, AdaCore                     *
+ *                     Copyright (C) 2008-2012, AdaCore                     *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -31,7 +31,8 @@
 
 /* First all usupported platforms. Add stubs for exported routines. */
 
-#if defined (VMS) || defined (__vxworks) || defined (__Lynx__)
+#if defined (VMS) || defined (__vxworks) || defined (__Lynx__) || \
+    defined (__ANDROID__)
 
 void * __gnat_new_tty (void) { return (void*)0; }
 char * __gnat_tty_name (void* t) { return (char*)0; }
@@ -976,12 +977,6 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
  || defined (__DragonFly__)
 #   define FREEBSD
 #endif
-#if defined (__alpha__) && defined (__osf__)
-#   define OSF1
-#endif
-#if defined (__mips) && defined (__sgi)
-#   define IRIX
-#endif
 
 /* Include every system header we need */
 #define _GNU_SOURCE
@@ -1028,7 +1023,6 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
       1- using a cloning device (USE_CLONE_DEVICE)
       2- getpt                  (USE_GETPT)
       3- openpty                (USE_OPENPTY)
-      4- _getpty                (USE_GETPTY)
 
    When using the cloning device method, the macro USE_CLONE_DEVICE should
    contains a full path to the adequate device.
@@ -1040,26 +1034,12 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
 /* Configurable part */
 #if defined (__APPLE__) || defined (FREEBSD)
 #define USE_OPENPTY
-#elif defined (IRIX)
-#define USE_GETPTY
 #elif defined (linux)
 #define USE_GETPT
 #elif defined (sun)
 #define USE_CLONE_DEVICE "/dev/ptmx"
 #elif defined (_AIX)
 #define USE_CLONE_DEVICE "/dev/ptc"
-#elif defined (OSF1)
-/* On Tru64, the systems offers various interfaces to open a terminal:
-    - /dev/ptmx: this the system V driver (stream based),
-    - /dev/ptmx_bsd: the non stream based clone device,
-    - the openpty function which use BSD interface.
-
-   Using directly /dev/ptmx_bsd on Tru64 5.1B seems to consume all the
-   available slave ptys (why ?). When using openpty it seems that the function
-   handles the creation of entries in /dev/pts when necessary and so avoid this
-   starvation issue. The pty man entry suggests also to use openpty.
-*/
-#define USE_OPENPTY
 #elif defined (__hpux__)
 /* On HP-UX we use the streamed version. Using the non streamed version is not
    recommanded (through "/dev/ptym/clone"). Indeed it seems that there are
@@ -1108,9 +1088,6 @@ allocate_pty_desc (pty_desc **desc) {
   master_fd = getpt ();
 #elif defined (USE_OPENPTY)
   status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
-#elif defined (USE_GETPTY)
-  slave_name = _getpty (&master_fd, O_RDWR | O_NDELAY, 0600, 0);
-  if (slave_name == NULL) status = -1;
 #elif defined (USE_CLONE_DEVICE)
   master_fd = open (USE_CLONE_DEVICE, O_RDWR | O_NONBLOCK, 0);
 #else