Amos Shapira wrote:

On 31/07/07, Ravid Baruch Naali <[EMAIL PROTECTED]> wrote:

I missed understood one thing do you want to add a system call to any file
descriptor
or just have a way to inquire some data or operate from/on the kernel?



The ideal system call interface would take an open file descriptor and an
additional parameter and operate on the open file descriptor.
Barring that, I suppose the ioctl will take the file descriptor and the
other parameter inside a struct pointed to by the ioctl parameter.

Thanks,

--Amos

 It's a POSIX matter when you open a file (being a block device or any
other) you get a file descriptor which is an index to an array which holds
pointers which in turns point to a vnode in the kernel, which among other
things point to the sys call specific implementation.
ioctl is one such sys call which operate according to it's parameters, one
of them is the ioctl number.
when you customize or develope your own device you can add to the function
ioctl any functionality you desire.

Sorry if all that I wrote so far is obvious, but continuing from here, if
you follow Gilad's suggestion, you may build your module (load it when
required) and use it as a back door to the kernel, one of the parameters you
want to give it is the file descriptor you wish to inquire about.
wrapping it all in shared object which you will load with your application
or an executable which can be executed from the shell, you can make it look
like a sys call.
  --
Ravid Baruch Naali
E-mail: [EMAIL PROTECTED]
Mobile: 052-5830021

Reply via email to