I need to find out if a binary is using epoll or select for socket handling on Linux. The binary is not stripped, but I can’t run it in my linux box so no strace.
I need to find out if a binary is using epoll or select for
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
nm <binary>will tell you which symbols are defined and, more importantly here, which symbols are used by the given binary. You can get a conservative guess by checking which ofpollorselectare listed in the output.You may find that your application is linked against both. In that case it may be making a run-time decision on which one to call, and you won’t be able to easily tell which one it would actually use if you ran it.
Depending on how the binary was built, you may have to run
nmwith the-Dflag; or you may need to ensure you don’t specify-D. Try both ways.If the program uses shared libraries, the actual call to
pollorselectcould be in a library it’s using. In that case, you may have to dig through all of its libraries runningnmon each of them. You can find out which libraries a program uses withldd, or if that doesn’t work, by looking for theNEEDEDentries in the output ofreadelf --dynamic.If the binary was built for a different platform than you’re currently running on, then
lddwon’t work, and also you may have to use a cross-compiler build ofbinutilsto get a version ofnmthat will work for you.