- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: migration to 64-bit mode semctl
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-26-2004 08:44 PM
02-26-2004 08:44 PM
res = semctl(semid, 0, SETVAL, 1);
did not set the variable to 1.
while
union { int val; } arg;
arg.val = 1;
res = semctl(semid, 0, SETVAL, arg);
did.
Is that a 64-bitt issue?
The prototype is
int semclt(int, int, int, ...) in /sys/sem.h
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 04:01 AM
02-27-2004 04:01 AM
Re: migration to 64-bit mode semctl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 04:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 04:35 AM
02-27-2004 04:35 AM
Re: migration to 64-bit mode semctl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 04:54 AM
02-27-2004 04:54 AM
Re: migration to 64-bit mode semctl
/* --------- dummy.c -------------- */
#include
void bad(int semid)
{
int res = 0;
union
{
int val;
} un;
un.val = 1;
res = semctl(semid,0,SETVAL,1);
return;
} /* bad */
void good(int semid)
{
int res = 0;
union
{
int val;
} un;
un.val = 1;
res = semctl(semid,0,SETVAL,un);
return;
} /* good */
/* ------------------------------- */
Note that the two functions are made as identical as possible except for the last argument. I did this intentionally because I want you to examine the assembly code produced for both functions. The problem will then become instantly obvious when you assemble as 32-bit and 64-bit code.
cc +DD64 -S dummy.c
Now examine dummy.s and you will see the difference in the code. Repeat with +DD32.