Re: Problem reading struct file on Mac 10.3.0
Re: Problem reading struct file on Mac 10.3.0
- Subject: Re: Problem reading struct file on Mac 10.3.0
- From: Terry Lambert <email@hidden>
- Date: Tue, 03 Jun 2008 10:49:58 -0700
On Jun 3, 2008, at 1:21 AM, Uli Kusterer
<email@hidden> wrote:
Am 14.05.2008 um 11:35 schrieb Manish Chaturvedi:
This time I can read struct proc, struct filedesc using kread()
which in turn uses kvm_read() to access the kernel virtual memory,
but when I am declaring struct file fl in method process_file() to
read individual file structures, I am getting compilation error “e
rror: aggregate `file fl' has incomplete type and cannot be define
d”. Unlike struct proc and struct filedesc I am not able to kread
the file structure, which is not private on Mac10.3.
lsof uses the structures successfully , then why it is not
accessible to my programme.
Is there is any special privilege required to do the same ? Please
help !
I would guess you just forgot the header that includes the "struct
file" deFINITion. You see, to not add too many dependencies that
cause a lot of recompiling, some people just deCLARE a struct in the
header, without including the other header that deFINEs it. That
way, the people who include that header and don't need to use that
struct directly don't have to include that header at all, and don't
get recompiled in that case.
As I said previously, "struct file" is forward declared in a couple of
headers, but is never used or instanced by the kernel, even privately.
It was deprecated when we did the fine grain locking of the proc
structure.
The mistake is in referring to it at all, which he already understands.
-- Terry _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden