[sane-devel] Fnctl Functions

Ilia Sotnikov hostcc at gmail.com
Wed Jun 13 08:43:29 UTC 2007


On 6/12/07, Gerald Murray <gmurray at cloudnet.com> wrote:
>
> > 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 */
>

As far as I know Win32 API doesn't have such definitions due to its
difference from Unix. Thus it's impossible to have them defined (and
the functionality they control implemented) using MinGW header files.

I had done limited porting of SANE under native Win32. How should I
submit my work for review - the patch alone, CVS branch etc?

-- 
 Ilia Sotnikov



More information about the sane-devel mailing list