This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: lseek() returning Invalid Argument


Eric Blake wrote:
gballey <galley <at> ace-co.com> writes:

Anyone got an idea of what is going on here?

Yep.



Oh, you wanted to know what your bug is?


Thanks.

/* begin test.c */

#include <fcntl.h>
#include <stdio.h>

Oops - no #include <unistd.h>. lseek takes 64-bit type arguments, but without a declaration from the correct header, the compiler assumes it takes int arguments. Try compiling with -Wall.



Yep, adding the header fixed it. I'm porting some apps that originated in Xenix years back, and that header wasn't included. I'm more accustomed to coding in languages with stronger type checking, and incorrectly assumed that when the compiler didn't complain, the types were OK.


I appreciate your assistance.

-Gordon


-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]