The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-02-2006
Frank2004 Frank2004 is offline
Registered User
  
 

Join Date: Jun 2004
Location: Beijing, China
Posts: 54
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;
  
  ...
on the above codes, when the data changes in the file specified by 'path',
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0