]> Savannah Git Hosting - gnulib.git/commitdiff
Android doesn't define RLIM_SAVED_*
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 Feb 2015 03:07:46 +0000 (19:07 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 Feb 2015 03:08:12 +0000 (19:08 -0800)
Portability problem reported by Kevin Cernekee in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-02/msg00122.html
* doc/posix-headers/sys_resource.texi (sys/resource.h):
Mention the portability problem.
* lib/getdtablesize.c (RLIM_SAVED_CUR, RLIM_SAVED_MAX):
Define if not defined.
* m4/dup2.m4 (gl_FUNC_DUP2):
* m4/fcntl.m4 (gl_FUNC_FCNTL):
Likewise.

ChangeLog
doc/posix-headers/sys_resource.texi
lib/getdtablesize.c
m4/dup2.m4
m4/fcntl.m4

index ffd51bee3725a0eef09da70da74185c004d0df2c..3dccee643cbe49bb9a9cb16291cf9e71de4b3363 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2015-02-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Android doesn't define RLIM_SAVED_*
+       Portability problem reported by Kevin Cernekee in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2015-02/msg00122.html
+       * doc/posix-headers/sys_resource.texi (sys/resource.h):
+       Mention the portability problem.
+       * lib/getdtablesize.c (RLIM_SAVED_CUR, RLIM_SAVED_MAX):
+       Define if not defined.
+       * m4/dup2.m4 (gl_FUNC_DUP2):
+       * m4/fcntl.m4 (gl_FUNC_FCNTL):
+       Likewise.
+
 2015-02-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        vasnprintf-posix-tests: use consistent test
index afcf3b462d22a503917452dea614e945073a9bb8..316423f659c7b8a6d3e4033ca50a8f1b29497bd0 100644 (file)
@@ -18,4 +18,8 @@ FreeBSD 5.0.
 
 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}.
 @end itemize
index bad45f7e32f94b3ad3e57ffad785fa28de612554..03eb7ef1bffd1e793a5b802eb6f2ab4d6dc4b9cf 100644 (file)
@@ -89,6 +89,13 @@ getdtablesize (void)
 # include <limits.h>
 # include <sys/resource.h>
 
+# ifndef RLIM_SAVED_CUR
+#  define RLIM_SAVED_CUR RLIM_INFINITY
+# endif
+# ifndef RLIM_SAVED_MAX
+#  define RLIM_SAVED_MAX RLIM_INFINITY
+# endif
+
 # ifdef __CYGWIN__
   /* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it
      hits the compile-time constant hard limit of 3200.  We might as
index 9aa2ea85ebd0f47089aa4ad8c9a63636b53bb5fa..ae87002e8ae134376e5cb18d46a2ed2ab9f99e03 100644 (file)
@@ -1,4 +1,4 @@
-#serial 22
+#serial 23
 dnl Copyright (C) 2002, 2005, 2007, 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,6 +25,12 @@ AC_DEFUN([gl_FUNC_DUP2],
              #include <limits.h>
              #include <sys/resource.h>
              #include <unistd.h>
+             #ifndef RLIM_SAVED_CUR
+             # define RLIM_SAVED_CUR RLIM_INFINITY
+             #endif
+             #ifndef RLIM_SAVED_MAX
+             # define RLIM_SAVED_MAX RLIM_INFINITY
+             #endif
            ]],
            [[int result = 0;
              int bad_fd = INT_MAX;
index 218e78628ba059c91eb4969544c413ed7809f671..76dd86711b224814c592fb73ce8a04ef8484aaaf 100644 (file)
@@ -1,4 +1,4 @@
-# fcntl.m4 serial 7
+# fcntl.m4 serial 8
 dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -34,6 +34,12 @@ AC_DEFUN([gl_FUNC_FCNTL],
               #include <limits.h>
               #include <sys/resource.h>
               #include <unistd.h>
+              #ifndef RLIM_SAVED_CUR
+              # define RLIM_SAVED_CUR RLIM_INFINITY
+              #endif
+              #ifndef RLIM_SAVED_MAX
+              # define RLIM_SAVED_MAX RLIM_INFINITY
+              #endif
             ]],
             [[int result = 0;
               int bad_fd = INT_MAX;