From 4abebc63f37ace44eb24044b2656c6d18571a8ee Mon Sep 17 00:00:00 2001 From: "John E. Malmberg" Date: Sat, 15 Jul 2017 17:30:13 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ doc/posix-headers/sys_resource.texi | 8 ++++++-- lib/sys_resource.in.h | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2634b3a6d8..0ae7337cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-07-15 John E. Malmberg + + 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. + 2017-07-15 John E. Malmberg Bruno Haible diff --git a/doc/posix-headers/sys_resource.texi b/doc/posix-headers/sys_resource.texi index 489a6625a5..e70223b4bb 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 and 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 POSIX@. For example, Android does not -define @code{RLIM_SAVED_CUR} or @code{RLIM_SAVED_MAX}. +symbolic constants required by POSIX@. 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 7fcc69f78a..ac747f47a2 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. */ -- 2.39.5