HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- fcntl() fail ENOLCK , how to locate the error??
Operating System - HP-UX
1825761
Members
2152
Online
109687
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
02-13-2003 09:43 PM
02-13-2003 09:43 PM
fcntl() fail ENOLCK , how to locate the error??
when our programs execute , fcntl() fails , the error is ENOLCK .I know it means system locktable is full , but I think our programs free all locks .In order to sure whether our programs always lock but miss some free, I want to know how to spy on the system locktable , how can I know how many locks is idle at the current time?
The lock function is as following:
OMERROR OmFileLock(int i_fd)
{
struct flock lock;
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
char buf[200];
if(fcntl(i_fd,F_SETLKW,&lock) == -1)
exit(0);
return OM_SUCCESS
}
OMERROR OmFileUnlock(int i_fd)
{
struct flock lock;
lock.l_type = F_UNLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
fcntl(i_fd,F_SETLK,&lock);
return OM_SUCCESS;;
}
calling as following:
OmFileLock()
......(no exit)
OmUnFileLock();
Is there any errors ? Or can you tell me some methods to locate the error.
Now I am very troubled , thank you for you consideration and help !!!
The lock function is as following:
OMERROR OmFileLock(int i_fd)
{
struct flock lock;
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
char buf[200];
if(fcntl(i_fd,F_SETLKW,&lock) == -1)
exit(0);
return OM_SUCCESS
}
OMERROR OmFileUnlock(int i_fd)
{
struct flock lock;
lock.l_type = F_UNLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
fcntl(i_fd,F_SETLK,&lock);
return OM_SUCCESS;;
}
calling as following:
OmFileLock()
......(no exit)
OmUnFileLock();
Is there any errors ? Or can you tell me some methods to locate the error.
Now I am very troubled , thank you for you consideration and help !!!
little_eight
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 07:41 AM
02-14-2003 07:41 AM
Re: fcntl() fail ENOLCK , how to locate the error??
Hi shixinli,
I'm pretty sure there are programatic methods that would enable monitoring the system lock table, but I don't know how to do it. I usually just use Glance, and go into system tables, where the number of file locks is displayed.
Looking at the fcntl(2) manpage, I see that ENOLCK can be returned not only because of the lock table being full, but also because of NFS-related issues, so check to see if the object you're tyring to lock is in an NFS-mounted filesystem.
You could also try simply doubling the kernel parameter nflocks and see if that helps.
Best regards,
Bruce Laughlin
HPUX GSE
I'm pretty sure there are programatic methods that would enable monitoring the system lock table, but I don't know how to do it. I usually just use Glance, and go into system tables, where the number of file locks is displayed.
Looking at the fcntl(2) manpage, I see that ENOLCK can be returned not only because of the lock table being full, but also because of NFS-related issues, so check to see if the object you're tyring to lock is in an NFS-mounted filesystem.
You could also try simply doubling the kernel parameter nflocks and see if that helps.
Best regards,
Bruce Laughlin
HPUX GSE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 08:31 AM
02-14-2003 08:31 AM
Re: fcntl() fail ENOLCK , how to locate the error??
I agree with Bruce that if its across NFS then you may want to check it with a local file first just to eliminate one factor.
You may wish to check the return status of the command: fcntl(i_fd,F_SETLK,&lock) in your Unlock routine to see if that is working correctly (you dont appear to check it in the code above).
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP