Skip to contentSkip to conversation

lseek SEEK_END fails on a Toshiba 6007MB disk.

DISCUSSION Kallol Biswas 3 participants 3 messages Feb 20, 2002 – Feb 21, 2002

lore
Share & tools
lore
#0 lore raw

#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

#1 lore raw
Quoted 4 lines
# ./seek
lseek: Value too large for defined data type

The system runs 2.4.17 kernel.

This is correct behaviour