Andrew Black wrote:
Ok.
Attached is take two on the patch.
Sorry I've been taking so long to look at this...
[...]
Index: cmdopt.h
===================================================================
--- cmdopt.h (revision 437752)
+++ cmdopt.h (working copy)
@@ -39,6 +39,27 @@
extern const char suffix_sep; /**< File suffix seperator. */
extern const size_t exe_suffix_len; /**< Length of executable suffix. */
+#if defined (_WIN32) || defined (_WIN64) || !defined (_XOPEN_UNIX)
You need to #include <unistd.h> before testing _XOPEN_UNIX.
(The patch fails to compile on Solaris because of this.) I'm also
not sure it's safe to assume struct rlimit is not defined when the
macro is undefined.
I think a better way to handle this might be to introduce rw_rlimit
and either make it a typedef for struct rlimit when the latter can
safely be assumed to exist (i.e., when _XOPEN_UNIX is #defined in
<unistd.h>), or define it identically to struct rlimit otherwise.
Also, I'm growing increasingly uneasy about the growing number of
global variables used throughout the program. I realize that some
may be unavoidable but I would welcome a patch to reduce their
number and consolidate the rest according their function (e.g.,
all those used to invoke the child process, including the new
child_limits).
Martin