[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] sys_resource_h: OpenVMS needs RUSAGE constants
From: |
Bruno Haible |
Subject: |
Re: [patch] sys_resource_h: OpenVMS needs RUSAGE constants |
Date: |
Sat, 15 Jul 2017 17:33:04 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-83-generic; KDE/5.18.0; x86_64; ; ) |
John E. Malmberg wrote:
> 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 <address@hidden>
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.
address@hidden
+On some platforms, this header file does not define the @code{RUSAGE_SELF} and
address@hidden 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 address@hidden For example, Android does not
-define @code{RLIM_SAVED_CUR} or @code{RLIM_SAVED_MAX}.
+symbolic constants required by address@hidden 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. */