this little programm compiles on OpenBSD 3.7 (with gcc 3.3.5)
but fails on RedHat Linux 9 (with gcc 3.2.2):
bolinux72:afarber {516} cat iovmax.c
#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);
}
bolinux72:afarber {515} gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/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.2 20030222 (Red Hat Linux 3.2.2-5)
bolinux72:afarber {514} gcc -o iovmax iovmax.c
iovmax.c: In function `main':
iovmax.c:8: `IOV_MAX' undeclared (first use in this function)
iovmax.c:8: (Each undeclared identifier is reported only once
iovmax.c:8: for each function it appears in.)
bolinux72:afarber {517} gcc -o iovmax -D__USE_XOPEN=1 iovmax.c
iovmax.c: In function `main':
iovmax.c:8: `IOV_MAX' undeclared (first use in this function)
iovmax.c:8: (Each undeclared identifier is reported only once
iovmax.c:8: for each function it appears in.)
Does anybody please know, how to get it compiled on Linux?
Regards
Alex
bolinux72:/home/afarber> cat iovmax.c
#include <stdio.h>
#include <limits.h>
#include <sys/uio.h>
#include <bits/uio.h>
int
main(int argc, char *argv[])
{
struct iovec iov[IOV_MAX];
printf("IOV_MAX = %d\n", IOV_MAX);
exit(0);
}
bolinux72:/home/afarber> gcc -o iovmax iovmax.c
In file included from iovmax.c:4:
/usr/include/bits/uio.h:43: redefinition of `struct iovec'
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.)
AF> bolinux72:/home/afarber> cat iovmax.c
AF> #include <stdio.h>
AF> #include <limits.h>
AF> #include <sys/uio.h>
AF> #include <bits/uio.h>
AF> int
AF> main(int argc, char *argv[])
AF> {
AF> struct iovec iov[IOV_MAX];
AF> printf("IOV_MAX = %d\n", IOV_MAX);
AF> exit(0);
AF> }
Hm.. it's strange, as IOV_MAX is defined in /usr/include/bits/stdio_lim.h,
which is included by stdio.h
With best regards, Roman Mashak. E-mail: m...@tusur.ru
#ifdef UIO_MAXIOV
#define IOV_MAX UIO_MAXIOV
printf("UIO_MAXIOV is defined and its value is %d\n", UIO_MAXIOV);
printf("IOV_MAX = UIO_MAXIOV so IOV_MAX will be: %d\n", IOV_MAX)
#else
printf("UIO_MAXIOV is not defined\n");
#endif
I don't know if UIO_MAXIOV is same with IOV_MAX... But I think so...
"Alexander Farber" <Alexande...@gmail.com> wrote in message
news:1123573977....@g43g2000cwa.googlegroups.com...