• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: String Compare
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: String Compare
      • From: Dean Reece <email@hidden>
References: 
 >re: String Compare (From: "Carl Smith" <email@hidden>)

  • Prev by Date: re: String Compare
  • Next by Date: Re: String Compare
  • Previous by thread: re: String Compare
  • Next by thread: Re: String Compare
  • Index(es):
    • Date
    • Thread