#define NO_INTR(var,cmd) do { (var) = (cmd); } while ((var) == -1 && errno == EINTR)
#define CLOSE_PIPE(p) do { close (p [0]); close (p [1]); } while (0)
-#if defined(__APPLE__) && !defined (__arm__)
+#if defined(__APPLE__) && !defined (__arm__) && !defined (__aarch64__)
/* Apple defines this in crt_externs.h but doesn't provide that header for
* arm-apple-darwin9. We'll manually define the symbol on Apple as it does
* in fact exist on all implementations (so far)
}
#ifndef G_OS_WIN32
-static int
-g_getdtablesize (void)
+int
+eg_getdtablesize (void)
{
#ifdef HAVE_GETRLIMIT
struct rlimit limit;
return getdtablesize ();
#endif
}
+#else
+int
+eg_getdtablesize (void)
+{
+ g_error ("Should not be called");
+}
#endif
gboolean
GError **error)
{
#ifdef G_OS_WIN32
+#elif !defined (HAVE_FORK) || !defined (HAVE_EXECV)
+ fprintf (stderr, "g_spawn_command_line_sync not supported on this platform\n");
+ return FALSE;
#else
pid_t pid;
gchar **argv;
close (stderr_pipe [0]);
dup2 (stderr_pipe [1], STDERR_FILENO);
}
- for (i = g_getdtablesize () - 1; i >= 3; i--)
+ for (i = eg_getdtablesize () - 1; i >= 3; i--)
close (i);
/* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */
GError **error)
{
#ifdef G_OS_WIN32
+#elif !defined (HAVE_FORK) || !defined (HAVE_EXECVE)
+ fprintf (stderr, "g_spawn_async_with_pipes is not supported on this platform\n");
+ return FALSE;
#else
pid_t pid;
int info_pipe [2];
}
if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
- for (i = g_getdtablesize () - 1; i >= 3; i--)
+ for (i = eg_getdtablesize () - 1; i >= 3; i--)
close (i);
}