Mercurial > gnulib
annotate lib/sys-limits.h @ 40231:9b3c79fdfe0b
strtod: fix clash with strtold
Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817).
* lib/strtod.c (compute_minus_zero, minus_zero):
Simplify by remving the macro / external variable,
and having just a function. User changed. This avoids
the need for an external variable that might clash.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 11 Mar 2019 16:40:29 -0700 |
parents | d9aa46720207 |
children |
rev | line source |
---|---|
19611
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
1 /* System call limits |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
2 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19611
diff
changeset
|
3 Copyright 2018-2019 Free Software Foundation, Inc. |
19611
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
4 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
5 This program is free software; you can redistribute it and/or modify |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
6 it under the terms of the GNU General Public License as published by |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
7 the Free Software Foundation; either version 2, or (at your option) |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
8 any later version. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
9 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
14 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
16 along with this program; if not, see <https://www.gnu.org/licenses/>. */ |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
17 |
40063
d9aa46720207
safe-read, safe-write: Fix conflict with Illumos-Joyent <sys/limits.h>.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
18 #ifndef _GL_SYS_LIMITS_H |
d9aa46720207
safe-read, safe-write: Fix conflict with Illumos-Joyent <sys/limits.h>.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
19 #define _GL_SYS_LIMITS_H |
19611
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
20 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
21 #include <limits.h> |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
22 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
23 /* Maximum number of bytes to read or write in a single system call. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
24 This can be useful for system calls like sendfile on GNU/Linux, |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
25 which do not handle more than MAX_RW_COUNT bytes correctly. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
26 The Linux kernel MAX_RW_COUNT is at least INT_MAX >> 20 << 20, |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
27 where the 20 comes from the Hexagon port with 1 MiB pages; use that |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
28 as an approximation, as the exact value may not be available to us. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
29 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
30 Using this also works around a serious Linux bug before 2.6.16; see |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
31 <https://bugzilla.redhat.com/show_bug.cgi?id=612839>. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
32 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
33 Using this also works around a Tru64 5.1 bug, where attempting |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
34 to read INT_MAX bytes fails with errno == EINVAL. See |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
35 <https://lists.gnu.org/r/bug-gnu-utils/2002-04/msg00010.html>. |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
36 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
37 Using this is likely to work around similar bugs in other operating |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
38 systems. */ |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
39 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
40 enum { SYS_BUFSIZE_MAX = INT_MAX >> 20 << 20 }; |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
41 |
970c998e00e3
sys-limits.h: new file for crypto and safe I/O
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
42 #endif |