* *
* 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- *
/* 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; }
|| 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
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.
/* 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
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