lkml.org 
[lkml]   [1999]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: lseek("/dev/hda1", 0, SEEK_END) returns 0
Pavel Krauz wrote:
>
> Hi all
>
> I would like to ask you if the lseek with SEEK_END and offset of 0
> should return 0
> when used on raw devices like hard disk or cdrom.
> By example Solaris 2.5 returns the correct length of partiton but Linux
> 2.0 returns 0.
> What is the right behaviour?


How big is your hard drive? lseek() returns a 32 bit signed value, which
is probably too small for you (max of 2 gigs if my math is correct).
llseek() may work though I believe you need glibc to use it.

Also, you are calling lseek() on a filedescriptor, not the actual name
right? :)



Jordan

--
Jordan Mendelson : http://jordy.wserv.com
Web Services, Inc. : http://www.wserv.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.066 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site