开发者

Why doesn't lsof show that libstdc++ is loaded on Mac OS X?

I have an application that I know uses libstdc++, but even as the super user, I cannot see /usr/lib/libstdc++.6.0.9.dylib on my Mac OS X 10.6 Snow Leopard system?

lsof | grep libstdc++

If I use DYLD_LIBRARY_PATH to use my own copy of libstdc++ it shows up in the full path while my app is running:

fooo 1701 foooo  txt      REG               14,5     2439888   54431 /path/to/shared/libstdc++.6.0.9.dylib

This is after a 开发者_高级运维fruitless google search. On a linux system, any user can see which applications are using the library in /usr/lib.


I guess the reason is libstdc++ is considered a system library in OS X and is treated differently than other user libraries.

If you want the system to load it just like a user supplied library use something like:

export DYLD_SHARED_REGION=avoid
./your_program_name

man dyld for more information on what the above environment setting means.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜