HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tracing gethostbyname() calls
Operating System - HP-UX
1834015
Members
2759
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 06:45 AM
08-19-2008 06:45 AM
tracing gethostbyname() calls
Hello,
I've been looking for a way to find which process is called gethostbyname() and have have no luck on finding a solution.
I know that tusc can attach itself to an specific process and see the calls it makes, but i have so many processes for IBM UniData that i cant really do it to all of them.
So my question is: Is there any way to know which process is calling gethostbyname()...?
If i could attach tusc to gethostbyname() and then just wait to see who calls it, it would be terrific...
Any ideas..?
Thanks
I've been looking for a way to find which process is called gethostbyname() and have have no luck on finding a solution.
I know that tusc can attach itself to an specific process and see the calls it makes, but i have so many processes for IBM UniData that i cant really do it to all of them.
So my question is: Is there any way to know which process is calling gethostbyname()...?
If i could attach tusc to gethostbyname() and then just wait to see who calls it, it would be terrific...
Any ideas..?
Thanks
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 09:46 PM
08-19-2008 09:46 PM
Re: tracing gethostbyname() calls
You can have tusc only log specific system calls. Unfortunately I don't think gethostbyname is a system call but composed of parts.
Trying a small example, I only see opens:
open("/etc/nsswitch.conf"
open("/usr/lib/hpux32/libnss_files.so.1"
open("/etc/hosts"
And possibly:
open("/etc/resolv.conf"
socket(AF_INET, SOCK_DGRAM, 0)
connect(6, 0x76fe1050, 16)
send(6,
poll(0x7fffd318, 1, 5000)
recvfrom(6,
You might also be able to create a gethostbyname stub that prints out a message and then calls the real one, after using dlsym to find the real one.
Then you could just export LD_PRELOAD with the shlib that has the stub.
Trying a small example, I only see opens:
open("/etc/nsswitch.conf"
open("/usr/lib/hpux32/libnss_files.so.1"
open("/etc/hosts"
And possibly:
open("/etc/resolv.conf"
socket(AF_INET, SOCK_DGRAM, 0)
connect(6, 0x76fe1050, 16)
send(6,
poll(0x7fffd318, 1, 5000)
recvfrom(6,
You might also be able to create a gethostbyname stub that prints out a message and then calls the real one, after using dlsym to find the real one.
Then you could just export LD_PRELOAD with the shlib that has the stub.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP