8000 Make sure IOV_MAX is defined. · postgres/postgres@d25d392 · GitHub
[go: up one dir, main page]

Skip to content

Commit d25d392

Browse files
tglsfdcdf7cb
andcommitted
Make sure IOV_MAX is defined.
We stopped defining IOV_MAX on non-Windows systems in 75357ab, on the assumption that every non-Windows system defines it in <limits.h> as required by X/Open. GNU Hurd, however, doesn't follow that standard either. Put back the old logic to assume 16 if it's not defined. Author: Michael Banck <mbanck@gmx.net> Co-authored-by: Christoph Berg <myon@debian.org> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/6862e8d1.050a0220.194b8d.76fa@mx.google.com Discussion: https://postgr.es/m/6846e0c3.df0a0220.39ef9b.c60e@mx.google.com Backpatch-through: 16
1 parent 3a2617e commit d25d392

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/include/port/pg_iovec.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
#else
2222

23-
/* POSIX requires at least 16 as a maximum iovcnt. */
24-
#define IOV_MAX 16
25-
2623
/* Define our own POSIX-compatible iovec struct. */
2724
struct iovec
2825
{
@@ -32,6 +29,15 @@ struct iovec
3229

3330
#endif
3431

32+
/*
33+
* If <limits.h> didn't define IOV_MAX, define our own. X/Open requires at
34+
* least 16. (GNU Hurd apparently feel that they're not bound by X/Open,
35+
* because they don't define this symbol at all.)
36+
*/
37+
#ifndef IOV_MAX
38+
#define IOV_MAX 16
39+
#endif
40+
3541
/* Define a reasonable maximum that is safe to use on the stack. */
3642
#define PG_IOV_MAX Min(IOV_MAX, 32)
3743

0 commit comments

Comments
 (0)
0