Skip to content

Commit f776458

Browse files
mbanckCommitfest Bot
authored andcommitted
Make sure IOV_MAX is defined.
We stopped defining IOV_MAX on non-Windows systems since 75357ab under the assumption that every non-Windows system defines it in limits.h already. However, the GNU (Hurd) system does not define this limit. As POSIX does not mandate IOV_MAX be defined, define it to 16 if it is undefined. Co-authored-by: Christoph Berg
1 parent c661341 commit f776458

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/include/port/pg_iovec.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121

2222
#else
2323

24-
/* POSIX requires at least 16 as a maximum iovcnt. */
25-
#define IOV_MAX 16
26-
2724
/* Define our own POSIX-compatible iovec struct. */
2825
struct iovec
2926
{
@@ -33,6 +30,11 @@ struct iovec
3330

3431
#endif
3532

33+
/* POSIX requires at least 16 as a maximum iovcnt. */
34+
#ifndef IOV_MAX
35+
#define IOV_MAX 16
36+
#endif
37+
3638
/*
3739
* Define a reasonable maximum that is safe to use on the stack in arrays of
3840
* struct iovec and other small types. The operating system could limit us to

0 commit comments

Comments
 (0)