Florian's annoying compile errors: CVS HEAD 1999-04-11 13:00 CEST

Paul PELaufer at csupomona.edu
Mon Apr 12 00:26:39 GMT 1999

On Mon, 12 Apr 1999, Florian Laws wrote:

> The next one:
> --- snip ---
> Compiling client/smbmount.c
> client/smbmount.c: In function `close_our_files':
> client/smbmount.c:242: `NR_OPEN' undeclared (first use in this function)
> client/smbmount.c:242: (Each undeclared identifier is reported only once
> client/smbmount.c:242: for each function it appears in.)
> make: *** [client/smbmount.o] Error 1

This is a glibcism again. See, NR_OPEN is defined in linux/limits.h.
Glibc's limits.h includes linux/limits.h BUT undefines NR_OPEN if NR_OPEN
was not previously defined (their comments claim it pollutes the

Two ways to solve this. Add an #include <linux/limits.h> before any other
#includes, or add a #define NR_OPEN 1 before #including the headers since
linux/limits.h will redefine NR_OPEN to the correct value.

Actually, the third solution is to get rid of close_our_files() in
smbmount.c. It is the only place NR_OPEN is used, and it's currently

Paul Laufer

More information about the samba-technical mailing list