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: 64-bit file operations (lseek64() etc) misbehaving


On Wed, 31 Mar 2004, Mike Brown wrote:

> Hi,
>
> cygwin 1.5.9-1 on Windows XP Service Pack 1.
>
> I need 64-bit versions of lseek() and friends.  No prototype exists for
> lseek64().  I've searched the archives on the list and many claim that
> 64-bit support is "automatic" and lseek() resolves at compile time to
> lseek64().  This isn't happening for me.  Is there a compile time
> define I need to make this happen?
>
> [snip]
> Here's a simple example app I'm using.  I run via:  a.out PhysicalDrive0

Michael,

I don't know if it's related to the problem you're having, but I'm sure
you've read <http://cygwin.com/cygwin-ug-net/using-specialnames.html>,
right?  Try compiling a Linux version with "#define lseek64 lseek", and
use ./a.exe /dev/sda (note that Cygwin gcc produces a.exe, not a.out, by
default, so I assume the above is a typo or the result of an explicit "-o"
flag).
	Igor

> -----------------------
> /* #define LINUX */
> #define WIN32
>
> [snip]
> #ifdef WIN32
>         /* automatically add the \\.\ crap in front */
>         sprintf(filename, "\\\\.\\%s", argv[1]);
> #else
>         sprintf(filename, "%s", argv[1]);
> #endif
> [snip]
> #ifdef WIN32
>         maxblock = lseek(fd, 0, SEEK_END);
> #else
>         maxblock = lseek64(fd, 0, SEEK_END);
> #endif

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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


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