Bug 165427 - IOV_MAX not defined
IOV_MAX not defined
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc3 (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-08-09 04:59 EDT by A. Farber
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-08-09 05:35:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
The test program iovmax.c (197 bytes, text/plain)
2005-08-09 05:01 EDT, A. Farber
no flags Details

  None (edit)
Description A. Farber 2005-08-09 04:59:49 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040430

Description of problem:
This little program compiles on OpenBSD,
but not on RedHat (Linux 9 and NOEL 4):

#include <stdio.h>
#include <limits.h>
#include <sys/uio.h>

main(int argc, char *argv[])
        struct iovec iov[IOV_MAX];

        printf("IOV_MAX = %d\n", IOV_MAX);

[afarber@borcx079] > gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47)

[afarber@borcx079] >  cat /etc/redhat-release
Red Hat Enterprise Linux AS release 3 (Taroon Update 4)

[afarber@borcx079] > gcc -o iovmax iovmax.c 
iovmax.c: In function `main':
iovmax.c:9: `IOV_MAX' undeclared (first use in this function)
iovmax.c:9: (Each undeclared identifier is reported only once
iovmax.c:9: for each function it appears in.)

Adding #include <bits/uio.h> or -D__USE_XOPEN=1 doesn't help.


Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.gcc -o iovmax iovmax.c 

Actual Results:  s. above

Expected Results:  Some value between 16 and 1024
(which should be atomic for writev/readv)

Additional info:
Comment 1 A. Farber 2005-08-09 05:01:04 EDT
Created attachment 117567 [details]
The test program iovmax.c
Comment 2 Jakub Jelinek 2005-08-09 05:35:38 EDT
Please see
info libc --index-search="Feature Test Macros"
Without any feature set macros IOV_MAX is intentionally not defined to avoid
namespace pollution, as it is a XPG only macro.
You can use one of
to select it.  Don't include bits/uio.h though, that's a glibc private header
that should never be included directly.

Note You need to log in before you can comment on or make changes to this bug.