#include <sys/types.h> #include "shmalloc.h" void* shmcreate (char* path, char ch, int nKB, mode_t mode, int off, int* id); void* shmattach (int shmid, void* addr); void shmlocate (int shmid, void* addr); void* shmalloc (int nbytes); void shmfree (void*); void* shmemdup (void* mem, int nbytes); void shmstat (FILE*); /* prints allocation map to file */
Shmattach grabs access to existing shared memory. The address is passed as argument to the shmat system call.
Shmlocate is used to initialize the allocator library in a newly loaded module (see load(2)). It should be called with the correct id and address preferably by the entry point function of the loaded module. The initialization is necessary because the allocator is not a shared library.
[ Research home page | IBM home page | Search | ContactIBM | Legal | Author ]