#ifdef VMS
#define _POSIX_EXIT 1
+#define HOST_EXECUTABLE_SUFFIX ".exe"
+#define HOST_OBJECT_SUFFIX ".obj"
#endif
#ifdef IN_RTS
/* Header files and definitions for __gnat_set_file_time_name. */
-#include <rms.h>
-#include <atrdef.h>
-#include <fibdef.h>
-#include <stsdef.h>
-#include <iodef.h>
+#include <vms/rms.h>
+#include <vms/atrdef.h>
+#include <vms/fibdef.h>
+#include <vms/stsdef.h>
+#include <vms/iodef.h>
#include <errno.h>
-#include <descrip.h>
+#include <vms/descrip.h>
#include <string.h>
#include <unixlib.h>
strcat (args[0], args_0);
strcat (args[0], "\"");
- status = spawnvp (P_WAIT, args_0, (char* const*)args);
+ status = spawnvp (P_WAIT, args_0, (const char* const*)args);
/* restore previous value */
free (args[0]);
}
/* Make newfd be the copy of oldfd, closing newfd first if necessary.
- Return -1 if an error occured. */
+ Return -1 if an error occurred. */
int
__gnat_dup2 (int oldfd, int newfd)
return pid;
}
-int
-__gnat_waitpid (int pid)
-{
- int status = 0;
-
-#if defined (_WIN32)
- cwait (&status, pid, _WAIT_CHILD);
-#elif defined (__EMX__) || defined (MSDOS) || defined (__vxworks)
- /* Status is already zero, so nothing to do. */
-#else
- waitpid (pid, &status, 0);
- status = WEXITSTATUS (status);
-#endif
-
- return status;
-}
-
void
__gnat_os_exit (int status)
{
}
/* Translate a VMS syntax file specification into Unix syntax.
- If no indicators of VMS syntax found, return input string. */
+ If no indicators of VMS syntax found, check if its an uppercase
+ alphanumeric_ name and if so try it out as an environment
+ variable (logical name). If all else fails return the
+ input string. */
char *
__gnat_to_canonical_file_spec (char *filespec)
{
+ char *filespec1;
+
strncpy (new_canonical_filespec, "", MAXPATH);
if (strchr (filespec, ']') || strchr (filespec, ':'))
{
strncpy (new_canonical_filespec,
- (char *) decc$translate_vms (filespec),
- MAXPATH);
+ (char *) decc$translate_vms (filespec), MAXPATH);
+ }
+ else if ((strlen (filespec) == strspn (filespec,
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"))
+ && (filespec1 = getenv (filespec)))
+ {
+ strncpy (new_canonical_filespec,
+ (char *) decc$translate_vms (filespec1), MAXPATH);
}
else
{
&& ! (defined (linux) && defined (i386)) \
&& ! defined (__FreeBSD__) \
&& ! defined (__hpux__) \
+ && ! defined (__APPLE__) \
&& ! defined (_AIX) \
&& ! (defined (__alpha__) && defined (__osf__)) \
&& ! defined (__MINGW32__) \
}
int
-__gnat_set_close_on_exec (int fd, int close_on_exec_p)
+__gnat_set_close_on_exec (int fd ATTRIBUTE_UNUSED,
+ int close_on_exec_p ATTRIBUTE_UNUSED)
{
#if defined (F_GETFD) && defined (FD_CLOEXEC) && ! defined (__vxworks)
int flags = fcntl (fd, F_GETFD, 0);