[uClibc] Re: shm funkiness

David Wuertele dave-gnus at bfnet.com
Sat Aug 2 20:32:29 UTC 2003


Erik> Yep.  If you grab the latest and greatest from CVS, it should
Erik> now be working,

I've grabbed the latest uclibc snapshot from CVS, and built the entire
system from scratch.  Other than placing my #include <sys/shm.h> in an
extern "C" block, I made no other changes.  Here is my test program
output, and ipcs output as well:

  # test-shm 1234
  id = 0
          shm_perm.uid = 0
          shm_perm.gid = 0
          shm_perm.cuid = 0
          shm_perm.cgid = 0
          shm_perm.mode = 0
          shm_segsz = 0
          shm_lpid = 1
          shm_cpid = -2144272384
          shm_nattch = 1234
          shm_atime = Fri Dec 31 17:00:23 1999
          shm_dtime = Wed Dec 31 17:01:11 1969
          shm_ctime = Wed Dec 31 17:00:00 1969

  Mapping...      shm_perm.uid = 0
          shm_perm.gid = 0
          shm_perm.cuid = 0
          shm_perm.cgid = 0
          shm_perm.mode = 0
          shm_segsz = 0
          shm_lpid = -2144278560
          shm_cpid = 1
          shm_nattch = 17056
          shm_atime = Fri Dec 31 17:00:23 1999
          shm_dtime = Wed Dec 31 17:01:11 1969
          shm_ctime = Wed Dec 31 17:01:11 1969

  Unmapping...    shm_perm.uid = 0
          shm_perm.gid = 0
          shm_perm.cuid = 0
          shm_perm.cgid = 0
          shm_perm.mode = 0
          shm_segsz = 946684827
          shm_lpid = -2114628952
          shm_cpid = 0
          shm_nattch = 21164
          shm_atime = Fri Dec 31 17:00:23 1999
          shm_dtime = Wed Dec 31 17:01:11 1969
          shm_ctime = Wed Dec 31 17:01:11 1969

  / # ipcs

  ------ Shared Memory Segments --------
  key        shmid      owner      perms      bytes      nattch     status      
  0x000004d2 0          root      0          946684827  31074                   

  ------ Semaphore Arrays --------
  key        semid      owner      perms      nsems     

  ------ Message Queues --------
  key        msqid      owner      perms      used-bytes   messages    

  / # 

Again, the size and nattch reported to the program and the size and
nattch reported by ipcs are both wrong and for the most part do not
match.

Dave




More information about the uClibc mailing list