Bug 165427 - IOV_MAX not defined
Summary: IOV_MAX not defined
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc3
Version: 3.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL: http://groups.google.de/group/comp.un...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-09 08:59 UTC by A. Farber
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-08-09 09:35:38 UTC
Target Upstream Version:
Embargoed:


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

Description A. Farber 2005-08-09 08:59:49 UTC
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>

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

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

[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.

Regards
Alex

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

How reproducible:
Always

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

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 09:01:04 UTC
Created attachment 117567 [details]
The test program iovmax.c

Comment 2 Jakub Jelinek 2005-08-09 09:35:38 UTC
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
-D_XOPEN_SOURCE
-D_XOPEN_SOURCE=500
-D_XOPEN_SOURCE=600
-D_GNU_SOURCE
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.