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

Tim Potter Tim.Potter at anu.edu.au
Mon Apr 12 00:25:05 GMT 1999

Paul writes:

> > 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
> namespace).

It's actually a glibc 2.1'ism.  I didn't manage to snaffle a copy of
glibc 2.1 before it was withdrawn from the GNU archive.

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

How about replacing it with something like OPEN_MAX?


> Paul Laufer

Tim Potter, System Admin/Programmer, Head Bee Guy
Advanced Computational Systems CRC, RSISE Bldg Australian National University,
Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602

More information about the samba-technical mailing list