Re: BUG #14334: vacuumdb.c build failure on openbsd - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #14334: vacuumdb.c build failure on openbsd
Date
Msg-id 20160921175753.GA904218@alvherre.pgsql
Whole thread Raw
In response to BUG #14334: vacuumdb.c build failure on openbsd  (jungleboogie0+psql@gmail.com)
Responses Re: BUG #14334: vacuumdb.c build failure on openbsd  (jungle Boogie <jungleboogie0@gmail.com>)
List pgsql-bugs
jungleboogie0+psql@gmail.com wrote:

> gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
> -Wendif-labels -Wmissing-format-attribute -Wformat-security
> -fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
> -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include
> -I/usr/local/include  -c -o vacuumdb.o vacuumdb.c
> vacuumdb.c:70: error: expected declaration specifiers or '...' before
> 'fd_set'
> vacuumdb.c: In function 'main':
> vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
> function)

What does your select(2) manpage say about what includes are required?
My manpage says

       /* According to POSIX.1-2001 */
       #include <sys/select.h>

       /* According to earlier standards */
       #include <sys/time.h>
       #include <sys/types.h>
       #include <unistd.h>

and we're not including <sys/select.h> anywhere that I can see;
apparently we should add something like

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-bugs by date:

Previous
From: jungleboogie0+psql@gmail.com
Date:
Subject: BUG #14334: vacuumdb.c build failure on openbsd
Next
From: jungle Boogie
Date:
Subject: Re: BUG #14334: vacuumdb.c build failure on openbsd