sysctl() and kvm_getfiles() changed in Panther?
sysctl() and kvm_getfiles() changed in Panther?
- Subject: sysctl() and kvm_getfiles() changed in Panther?
- From: Martin Akesson <email@hidden>
- Date: Tue, 9 Mar 2004 18:06:23 +0100
Hello all!
I'm experiencing some errors using kvm_getfiles on Panther. Actually
it is simply not working as advertised any more. So I checked the
sources and found that kvm_getfiles() used sysctl() with a [CTL_KERN,
KERN_FILE] mib to get this data from the kernel.
I quickly wrote a small program that would replicate the kvm_getfiles()
call and tested it on both Jaguar and Panther, output is below:
-------------------------
JAGUAR
Call sysctl() ask for size of [CTL_KERN, KERN_FILE]
sysctl() returned 0 and gives size = 15772 bytes
Allocating data pointer with size 15772 bytes
Call sysctl() and ask to have [CTL_KERN, KERN_FILE] data copied to our
data pointer
sysctl() returned 0 and says 15412 bytes were copied
Initial filehead.ls_first = 0x209E30C
PANTHER
Call sysctl() ask for size of [CTL_KERN, KERN_FILE]
sysctl() returned 0 and gives size = 17392 bytes
Allocating data pointer with size 17392 bytes
Call sysctl() and ask to have [CTL_KERN, KERN_FILE] data copied to our
data pointer
sysctl() returned 0 and says 4 bytes were copied
Initial filehead.ls_first = 0x0
-------------------------
Obviously something has changed as sysctl() now only returns 4 bytes
which is nothing more than a null pointer, eg. there are no open files.
Is there a new api for this or what should I do to fix this? I really
need a list of open files in the system.
Thank you,
Martin
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.