Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: 'fd_set' undeclared (first use in this function) #70

Closed
noloader opened this issue Mar 18, 2020 · 1 comment
Closed

error: 'fd_set' undeclared (first use in this function) #70

noloader opened this issue Mar 18, 2020 · 1 comment

Comments

@noloader
Copy link
Contributor

noloader commented Mar 18, 2020

Hi Everyone,

I working from nsd master on OpenBSD 6.6. Bootstrap and configure go well, but compile has a hiccup:

$ make -k
...
gcc  -I. -fasynchronous-unwind-tables -fexceptions -fstack-protector-strong -Wer
ror=implicit-function-declaration -fdata-sections -ffunction-sections -fPIC  -Wa
,--noexecstack -g -O2 -c ./popen3.c
./popen3.c: In function 'popen3':
./popen3.c:106: error: 'fd_set' undeclared (first use in this function)
./popen3.c:106: error: (Each undeclared identifier is reported only once
./popen3.c:106: error: for each function it appears in.)
./popen3.c:106: error: expected ';' before 'rfds'
./popen3.c:111: warning: implicit declaration of function 'FD_ZERO'
./popen3.c:111: error: 'rfds' undeclared (first use in this function)
./popen3.c:112: warning: implicit declaration of function 'FD_SET'
./popen3.c:113: warning: implicit declaration of function 'select'

I believe this is the OpenBSD doc of interest: select(2) - OpenBSD manual pages. It looks like OpenBSD puts the declaration in <sys/select.h>.

Another man page of interest is the Linux man page. Linux and libc put the declarations in either <sys/types.h> or <sys/select.h>.

Related, the source file also uses ssize_t. I believe that is defined in <sys/types.h>.

@wcawijngaards
Copy link
Member

Looks like that file was missing a bunch of other system includes. Those are fixed in the commit. I think that may solve the problem, since other code also uses fd_set and compiles, with those includes. If not, let me know, and I'll start testing and including sys/select.h, also for the other cases. Also ssize_t and other declarations should be covered by these extra includes.

Thanks for the test and report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants