public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* IPC_STAT on ia64
@ 2004-05-04  9:34 ARADHYA, CHINMAYA TM (STSD)
  2004-05-04 15:07 ` n0ano
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ARADHYA, CHINMAYA TM (STSD) @ 2004-05-04  9:34 UTC (permalink / raw)
  To: linux-ia64

hello,

I noticed that when a 32bit application running on a ia64 system 
makes a shmctl call  with IPC_STAT flag junk data will be filled 
in the shmid_ds structure.
This is on the kernel version - 2.4.18-e.12smp

Sample program to reproduce the problem:

#include <stdio.h>
#include <errno.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/types.h>
#define errmsg(s,no) { printf("*** %s - %s ***\n",s,strerror(no)); 
exit(1); }
#define FTOK_FILENAME "/sbin"
#define PRJ_NO 419
int main()
{
        key_t shmkey;
        int shmid;
        char *shmt=NULL;
        struct shmid_ds shdata;
        if ((shmkey = ftok(FTOK_FILENAME,PRJ_NO)) = -1)
                errmsg("ftok error",errno);
        if ((shmid = shmget(shmkey,1048700,IPC_CREAT|IPC_EXCL|0666)) 
= -1)
                errmsg("shmget error",errno);
        if((shmt=(char*)shmat(shmid,NULL,0)) = -1)
                errmsg("shmat error", errno);
        if(shmctl(shmid,IPC_STAT,&shdata) = 0)
        {
                printf("=Shared mem size=%d=\n",shdata.shm_segsz);
        }
        shmdt(shmt);
        shmctl(shmid,IPC_RMID,0);
}
  
Actual results:
=Shared mem size=1073832704=
Expected results:
=Shared mem size=1048700=


Could anybody tell me how to go about addressing this problem.

TIA
Chinmaya 
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-04 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-04  9:34 IPC_STAT on ia64 ARADHYA, CHINMAYA TM (STSD)
2004-05-04 15:07 ` n0ano
2004-05-04 15:22 ` Bjorn Helgaas
2004-05-04 15:36 ` Matthew Wilcox
2004-05-04 15:45 ` ARADHYA, CHINMAYA TM (STSD)
2004-05-04 19:01 ` Jason Baron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox