Hello,
Does anyone know why I get the message on the subject line when I execute the following code on Linux and/or how to fix it?
The routine appears to run nicely on SGI!
Note: The program compiles on Linux with the -lrt option.
Thank you, Christopher Lusardi
------------------------- Routine ---------------------------
#include #include #include #include #include #include #include #include
int initialize () { int my_size; void *my_ptr; int my_memory;
my_size = 0x100000; /* number of bytes */
my_memory = shm_open ("/var/tmp/my_memory", (O_RDWR | O_CREAT), (S_IRWXO | S_IRWXG | S_IRWXU)); /* r/w others group users */
chmod ("/var/tmp/my_memory",(S_IRWXG | S_IRWXU)); /* g/u */
ftruncate (my_memory,my_size); /* Truncate CREATE file! */ if ( my_memory == -1 ) { perror (shm_open:"); exit (1); }
ptr = (void *) mmap (NULL,my_size,(PROT_READ | PROT_WRITE), (MAP_SHARED),my_memory,0); /* memory */
if ( ptr == MAP_FAILED ) { perror ("mmap"); exit (1); }
if ( close (shmd) ) { perror ("close"); exit (1); }
return (ptr); }
/********************* Caller Routine **********************/
int main () { (void) initialize (); /* check stubbed routine */ }