lseek SEEK_END fails on a Toshiba 6007MB disk.

Kallol Biswas (kallol@efi.com)
Wed, 20 Feb 2002 15:40:40 -0800


#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>

main(int argc, char *argv[])
{
int fd;
int offset;
int loffset;

fd = open("/dev/hda", O_RDONLY);

if (fd < 0) {
perror("open");
return;
}

offset = lseek(fd, 0, SEEK_END);

if (offset < 0) {
perror("lseek");
}

}

# ./seek
lseek: Value too large for defined data type

The system runs 2.4.17 kernel.

A fix may be found reading the source code, but if someone already knows

the solution, please reply to me.

Kallol

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