Discussion:
[patch] sys_resource_h: OpenVMS needs RUSAGE constants
(too old to reply)
John E. Malmberg
2017-07-12 13:11:29 UTC
Permalink
Raw Message
This patch adds the RUSAGE_SELF and RUSAGE_CHILDREN defined constants
missing from the OpenVMS sys/resource.h file.

Regards,
-John
Bruno Haible
2017-07-15 15:33:04 UTC
Permalink
Raw Message
Post by John E. Malmberg
This patch adds the RUSAGE_SELF and RUSAGE_CHILDREN defined constants
missing from the OpenVMS sys/resource.h file.
Thanks. Well done. I rewrote the ChangeLog entry, but the rest was good.


2017-07-15 John E. Malmberg <***@gmail.com>

sys_resource: Add support for OpenVMS.
* lib/resource.in.h [__VMS]: Define RUSAGE_SELF, RUSAGE_CHILDREN.
* doc/posix-headers/sys_resource.texi: Mention OpenVMS issues.

diff --git a/doc/posix-headers/sys_resource.texi b/doc/posix-headers/sys_resource.texi
index 489a662..e70223b 100644
--- a/doc/posix-headers/sys_resource.texi
+++ b/doc/posix-headers/sys_resource.texi
@@ -14,12 +14,16 @@ mingw, MSVC 14.
On some platforms, this header file requires that <sys/types.h> and
<sys/time.h> already be included:
FreeBSD 5.0.
+@item
+On some platforms, this header file does not define the @code{RUSAGE_SELF} and
+@code{RUSAGE_CHILDREN} constants:
+OpenVMS.
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@item
On some platforms, this header does not define some or all of the
-symbolic constants required by ***@. For example, Android does not
-define @code{RLIM_SAVED_CUR} or @code{RLIM_SAVED_MAX}.
+symbolic constants required by ***@. For example, OpenVMS and Android do
+not define @code{RLIM_SAVED_CUR} or @code{RLIM_SAVED_MAX}.
@end itemize
diff --git a/lib/sys_resource.in.h b/lib/sys_resource.in.h
index 7fcc69f..ac747f4 100644
--- a/lib/sys_resource.in.h
+++ b/lib/sys_resource.in.h
@@ -79,6 +79,18 @@ struct rusage
}
# endif

+#else
+
+# ifdef __VMS /* OpenVMS */
+/* Define the RUSAGE_* constants. */
+# ifndef RUSAGE_SELF
+# define RUSAGE_SELF 0
+# endif
+# ifndef RUSAGE_CHILDREN
+# define RUSAGE_CHILDREN -1
+# endif
+# endif
+
#endif

/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */

Loading...