Re: Char device driver. Illegal seek.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I presume that llseek results from a seek() call ?
A seek() call implies (to me) the use of higher layer file I/O streams.
I don't think there's a way to inhibit the high level library from wanting
to call seek().
Also, note that some specific fread()/fwrite() sequences need a flush, or
at least a seek()
call to function properly.
Maybe, just maybe if you can intercept these calls with your own dummy
seek() or lseek() function,
you can bypass these 'illegal' calls, but that probably would still break
the functionality of the upper stream layer.

I think the only sound way would be to ensure that some sort of meaningful
data is returned from a seek()
call, unless your char device driver can guarantee that it doesn't rely on
low level seek calls to return something meaningful.

HTH
B rgds
Kris


On Thu, 5 Mar 2009 12:27:30 +0300, Denis Borisevich <dennisfen@xxxxxxxxx>
wrote:
> Hi!
> 
> My char device is not seekable and I try to disable seeking on it
> using nonseekable_open() in my open() function. But still I have
> Illegal seek returned by userspace application when performing actions
> on dev node connected to my device. Is there any way to _really_
> prevent llseek() to be performed on my device?
> 
> --
> Denis
> 
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux