- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get number of referenced fd??
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
02-20-2005 11:07 PM
02-20-2005 11:07 PM
How to get number of referenced fd??
I want to know how many processes have a reference via open() to a given file. This file can be resist in an NFS-share or local.
I know that there must be a conter for that but i don't know how to access it..
Anybody for a good idea??
Thanks a lot!
Karsten
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2005 11:18 PM
02-20-2005 11:18 PM
Re: How to get number of referenced fd??
go to
http://hpux.connect.org.uk/
look at lsof and libevent-0.4
Ths sources should help
Steve Steel
- Tags:
- lsof
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2005 11:30 PM
02-20-2005 11:30 PM
Re: How to get number of referenced fd??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2005 11:59 PM
02-20-2005 11:59 PM
Re: How to get number of referenced fd??
lsof is verry mighty and total overdone for my (simple) request. To parse the source ( ~ 80.000 lines ) to get the necessary information is a little bit to hard for me :-)
Karsten
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2005 12:13 AM
02-21-2005 12:13 AM
Re: How to get number of referenced fd??
another method would be to use fcntl() with the f_getlk parameter to search for the lock on the file.
Using the l_type and l_pid from the flock structure would give you the process id.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2005 01:32 AM
02-21-2005 01:32 AM
Re: How to get number of referenced fd??
fuser filename
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2005 01:52 AM
02-21-2005 01:52 AM
Re: How to get number of referenced fd??
Well, F_GETLCK don't helps if the other process do not do a lock to the file. I played with this solution but i don't want to use file locks over NFS ( NEVER do this.. expactly with HP :-( we have a lot of verry bad experiences with it)
At least I need a save( realy save ) way to synchronise a process after a file is fully written by a external process ( 3D Application ) without lost seconds to wait if mtime/ctime isn't more changed.The write can take a lot of seconds ( big files over NFS which runs over smal leased Lines). The idea is to check the number of open references ( filedescriptors ) to this file. If it is zero
i know the write is done.
regards
Karsten
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2005 02:25 AM
02-21-2005 02:25 AM
Re: How to get number of referenced fd??
I got a hat!
:oD