[sane-devel] Fnctl Functions

Gerald Murray gmurray at cloudnet.com
Tue Jun 12 20:55:57 UTC 2007


> sanei_usb.c: In function `sanei_usb_open':
> sanei_usb.c:1049: warning: implicit declaration of function `fcntl'
> sanei_usb.c:1049: error: `F_GETFL' undeclared (first use in this function)
                                        ^ typo
> sanei_usb.c:1049: error: (Each undeclared identifier is reported only once
> sanei_usb.c:1049: error: for each function it appears in.)
> sanei_usb.c:1052: error: `F_SETFD' undeclared (first use in this function)
> sanei_usb.c:1052: error: `FD_CLOEXEC' undeclared (first use in this function)


Be sure that your Makefile includes "-I/usr/include" in its flags
(check your platform ( MinGW?) for similar dependencies)
On linux all are included in normal Makefile.  Mine are:

sanei_usb.c:
#include <fcntl.h>

/usr/include/fcntl.h:
#include <bits/fcntl.h>

/usr/include/bits/fcntl.h:
#ifndef _FCNTL_H
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
..
#define F_GETFD   1 /* Get file descriptor flags.  */
#define F_SETFD   2 /* Set file descriptor flags.  */
..
#define FD_CLOEXEC  1 /* actually anything with low bit set goes */

regards,
Gerald





More information about the sane-devel mailing list