re: String Compare
re: String Compare
- Subject: re: String Compare
- From: Andrew Gallatin <email@hidden>
- Date: Mon, 11 Apr 2005 11:55:41 -0400 (EDT)
Carl Smith writes:
> Ah I see, said the blind man. Thanks Quinn, understand the concept a
> little more.
>
> Ok so I ran the % find /System/Library/Extensions/System.kext/PlugIns \
> -type f -a ! -name "*.plist" | xargs nm | grep strcmp
>
> and I get back:
> U _strcmp
> U _strcmp
> U _strcmp
>
> How does this tell me which KPI exports the symbol, I thought I was
> looking for something like, "com.apple.kernel.libkern" and so on?
Try adding -o to nm. Eg:
% find /System/Library/Extensions/System.kext/PlugIns -type f -a ! -name "*.plist" | xargs nm -o | grep strncmp
/System/Library/Extensions/System.kext/PlugIns/Libkern.kext/Libkern: U _strncmp
/System/Library/Extensions/System.kext/PlugIns/Mach.kext/Mach: U _strncmp
/System/Library/Extensions/System.kext/PlugIns/System6.0.kext/kernel.6.0: U _strncmp
Note the "U", which means it is importing the symbol...
>From some discussions I had off-list, these files generally contain
imported symbols which they also re-export. But not always, and
there isn't a 100% bullet proof way to figure out which "fake"
kext supplies which symbols.
> Also when I use strcmp, as my code is now, I get a warning of "implicit
> declaration of function 'strcmp'". Do I have to add the "#include
> string.h" to my file or does this have to do with adding the correct
> bundle identifier?
Compilation warnings like that refer to missing headers, so yes, add
string.h. Problems with your info.plist file are usually linking
errors and module load time.
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden