/home/nemo/foxyserver_strace_opt/lib
"在LD_LIBRARY_PATH
中作为搜索的第一条路径。
然后我使用strace来追踪我的程序。它显示如下:
10695 16:12:58.227132 open("/home/nemo/foxyserver_strace_opt/lib/tls/x86_64/libselinux.so.1", O_RDONLY) = 3 <0.000018>
10695 16:12:58.227486 open("/home/nemo/foxyserver_strace_opt/lib/tls/libselinux.so.1", O_RDONLY) = 3 <0.000023>
10695 16:12:58.227937 open("/home/nemo/foxyserver_strace_opt/lib/x86_64/libselinux.so.1", O_RDONLY) = 3 <0.000018>
10695 16:12:58.228360 open("/home/nemo/foxyserver_strace_opt/lib/libselinux.so.1", O_RDONLY) = 3 <0.000016>
见? libselinux.so.1是搜索成功的。它就在路径&#34; /home/nemo/foxyserver_strace_opt/lib
&#34;。
然后我继续看下面的内容:
11144 16:13:01.536915 open("/home/nemo/foxyserver/server/libselinux.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000014>
11144 16:13:01.537058 open("/home/nemo/foxyserver/extra/lib/tls/x86_64/libselinux.so.1", O_RDONLY) = 3 <0.000021>
11144 16:13:01.537391 open("/home/nemo/foxyserver/extra/lib/tls/libselinux.so.1", O_RDONLY) = 3 <0.000019>
11144 16:13:01.537679 open("/home/nemo/foxyserver/extra/lib/x86_64/libselinux.so.1", O_RDONLY) = 3 <0.000019>
11144 16:13:01.537990 open("/home/nemo/foxyserver/extra/lib/libselinux.so.1", O_RDONLY) = 3 <0.000017>
11144 16:13:01.538469 open("/lib64/libselinux.so.1", O_RDONLY) = 3 <0.000014>
见? linux搜索新路径&#34; /home/nemo/foxyserver/extra/lib/x86_64/
&#34;对于libselinux.so.1
,即使它可以搜索路径&#34; /home/nemo/foxyserver_strace_opt/lib
&#34;。
为什么?