[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <535337.98001.qm@web8712.mail.in.yahoo.com>
Date: Tue, 17 Jun 2008 19:36:53 +0530 (IST)
From: palani saravanan <busybeesaravanan0072003@...oo.co.in>
To: linux-kernel@...r.kernel.org
Subject: Behavior of lseek() on a fd opened with 'RDONLY' flag, when seeking goes beyond file size.
Hi,
[Forgive me if this is not correct alias for this question.
(Behavior of lseek() on a fd opened with 'RDONLY' flag, when seeking goes beyond file size.)]
In linux, I see that it just goes beyond the file size and returns the resulting offset.
For example, 'rc = lseek(fd, 4L, SEEK_END);' on a file which has 5 byte contents,
it returns rc as 9.
I expect that it would return size of the file, i.e.) 5.
I am not finding any posix documentation for this either.
May I know the rational behind this behavior?
Does the file pointer internally really points to the new location.?
Thanks,
Saravanan
Meet people who discuss and share your passions. Go to http://in.promos.yahoo.com/groups/bestofyahoo/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists