Mercurial > hg > octave-nkf > gnulib-hg
comparison m4/fcntl.m4 @ 17930:71aba7a74c52
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.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sun, 22 Feb 2015 19:07:46 -0800 |
parents | 2b5c3699ac6f |
children |
comparison
equal
deleted
inserted
replaced
17929:7f19e7f2afa2 | 17930:71aba7a74c52 |
---|---|
1 # fcntl.m4 serial 7 | 1 # fcntl.m4 serial 8 |
2 dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. | 2 dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. |
3 dnl This file is free software; the Free Software Foundation | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | 4 dnl gives unlimited permission to copy and/or distribute it, |
5 dnl with or without modifications, as long as this notice is preserved. | 5 dnl with or without modifications, as long as this notice is preserved. |
6 | 6 |
32 [[#include <errno.h> | 32 [[#include <errno.h> |
33 #include <fcntl.h> | 33 #include <fcntl.h> |
34 #include <limits.h> | 34 #include <limits.h> |
35 #include <sys/resource.h> | 35 #include <sys/resource.h> |
36 #include <unistd.h> | 36 #include <unistd.h> |
37 #ifndef RLIM_SAVED_CUR | |
38 # define RLIM_SAVED_CUR RLIM_INFINITY | |
39 #endif | |
40 #ifndef RLIM_SAVED_MAX | |
41 # define RLIM_SAVED_MAX RLIM_INFINITY | |
42 #endif | |
37 ]], | 43 ]], |
38 [[int result = 0; | 44 [[int result = 0; |
39 int bad_fd = INT_MAX; | 45 int bad_fd = INT_MAX; |
40 struct rlimit rlim; | 46 struct rlimit rlim; |
41 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | 47 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 |