Re: Problem in reading struct file.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hi All, You'd get the same from attempting to compile: struct Manish; struct Manish ml; int main(int ac. char *av[]) { return 0; } -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On May 13, 2008, at 2:29 AM, Manish Chaturvedi wrote: I am Implementing my own lsof on Mac10.3.0 to get the list of open files for process ( i.e. file descriptors, file name). Below is the code snippet describing the problem. There is no such thing as "struct file" in 10.3 (Tiger); there are several legacy forward declarations of the struct for use by pointers (which are not used), but there is no such thing. You are probably getting this error because it's the error you get any time you make a forward declaration of a structure with no implementation behind it, and then try to declare an instance of it. There are library routines for getting the type of information that lsof normally provides from the kernel; they are considered unstable, however, and we may change them with every release, but they are less unstable than raw structure declarations. It's actually more stable to popen lsof itself. For the information that's there that lsof can't get via library routines, there's dtrace. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert