![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shared memory in shared library | DreamWarrior | High Level Programming | 12 | 05-30-2007 05:33 PM |
| memory sharing - not shared memory - | elzalem | High Level Programming | 9 | 05-02-2007 08:45 AM |
| memory problem in AIX shared libraries | abhinav05252 | AIX | 0 | 12-07-2006 06:39 AM |
| all about shared memory | vijaya2006 | Linux | 0 | 02-28-2006 04:14 AM |
| Shared memory shortage but lots of unused memory | cjcamaro | UNIX for Advanced & Expert Users | 1 | 10-13-2004 06:10 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
shared memory problem
Hi, there
On HP-UX, there is a problem about shared memory. The code open the data file and use the "mmap" system call to map into the shared memory, when the contents are make changes, there is no effective on shared memory. The codes look like the following: Code:
...
sysdb=shm_open(path,O_CREAT|O_RDWR,S_IRWXO|S_IRWXG|S_IRWXU);
if (sysdb==-1)
{
perror("main:shm_open system database error");
exit(1);
}
if(ftruncate(sysdb,SYSDB_SIZE)==-1)
{
perror("main:ftruncate sysdb failure");
exit(1);
}
sysdb_addr=(caddr_t)mmap(0,SYSDB_SIZE,PROT_READ|PROT_WRITE,MAP_SHARED,\
sysdb,0);
if(sysdb_addr==(caddr_t)-1)
{
perror("main:system database mmap error");
exit(1);
}
sysdb_header=(DB_HEADER *)sysdb_addr;
...
the value pointed by 'sysdb_addr' is still original. Anyone can give some suggestion? thanks. Last edited by blowtorch; 09-05-2006 at 03:31 AM.. Reason: put in code tags |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|