[<prev] [next>] [day] [month] [year] [list]
Message-ID: <887400.15277.qm@web8715.mail.in.yahoo.com>
Date: Mon, 23 Jun 2008 14:08:49 +0530 (IST)
From: palani saravanan <busybeesaravanan0072003@...oo.co.in>
To: David Newall <davidn@...idnewall.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: Behavior of lseek() on a fd opened with 'RDONLY' flag, when seeking goes beyond file size.
Thanks David for clarification !
I ran this program in the kernel version, 'Linux 2.6.9-42.7.ELsmp'.
However, In a recent kernel version, 'Linux 2.6.24-19 ', the error EINVAL is returned as you mentioned.
Thanks,
Saravanan
----- Original Message ----
From: David Newall <davidn@...idnewall.com>
To: palani saravanan <busybeesaravanan0072003@...oo.co.in>
Cc: linux-kernel@...r.kernel.org
Sent: Sunday, 22 June, 2008 7:36:12 AM
Subject: Re: Behavior of lseek() on a fd opened with 'RDONLY' flag, when seeking goes beyond file size.
palani saravanan wrote:
> Does lseek() permits -ve value as offset, with SEEK_SET mode? ...
> errno = 0;
> rd_rc = lseek(rd_fd, -10, SEEK_SET);
> returns rd_rc = -10 and errno remains 0.
>
No, lseek does not permit negative file offsets, and should return
EINVAL in your example. You may have discovered a bug. For reference,
on my system lseek returns -1 and sets errno to EINVAL, as it should.
If you're running a recent kernel it might be worth looking closer into
this; for older kernels it's probably not worth the effort.
Save all your chat conversations. Find them online at http://in.messenger.yahoo.com/webmessengerpromo.php
--
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