- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- semop not working
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
Discussions
Discussions
Discussions
Forums
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
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
тАО11-18-2010 02:23 AM
тАО11-18-2010 02:23 AM
When the code is ported to HP UX, the application is hanging at semop function.
sem_buf.sem_num = 0;
sem_buf.sem_op = LOCK; /* LOCK = -1*/
sem_buf.sem_flg = SEM_UNDO;
/*
** lock
*/
if ( semop(shms.sem_id, &sem_buf, 1) ) {
rc = IPC_ERROR_EXIT;
}
Is there any change in HP UX for semop
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-19-2010 04:52 AM
тАО11-19-2010 04:52 AM
Re: semop not working
How are you calling semctl(2)? Are you in 64 bit mode?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2010 12:38 AM
тАО11-20-2010 12:38 AM
Re: semop not working
Thanks for the response,
Yes, I am compiling in 64bit mode.
Creation of semaphore is done like this
semctl(*sem_id, 0, SETVAL, 1)
Once before calling semop I used "semctl(sem_id, 0, GETVAL, 0);" to get semaphore value
it returned me 0. So this means semaphore value is 0.
One more thing i noted is when i used IPC_NOWAIT for sem_flg the hanging issue was not there
Is it correct to use IPC_NOWAIT instead of SEM_UNDO. Or am i doing something functionally wrong due to which this problem is comming
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2010 02:50 AM
тАО11-20-2010 02:50 AM
SolutionAs I suspected on the 4th parm, that's your problem, this is illegal:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1137658
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1385188
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=472388
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=631198
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=847096
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1116632
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2010 05:09 AM
тАО11-20-2010 05:09 AM
Re: semop not working
Thanks for the solution Dennis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2010 12:38 AM
тАО11-21-2010 12:38 AM
Re: semop not working
If you are happy with the answers you have gotten, please read the following about how to assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33