Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://itpm.msu.su/LDP/lpg-0.4/node70.html
Дата изменения: Sun Apr 18 13:37:01 1999 Дата индексирования: Mon Oct 1 21:03:10 2012 Кодировка: |
SYSTEM CALL: shmat(); PROTOTYPE: int shmat ( int shmid, char *shmaddr, int shmflg); RETURNS: address at which segment was attached to the process, or -1 on error: errno = EINVAL (Invalid IPC ID value or attach address passed) ENOMEM (Not enough memory to attach segment) EACCES (Permission denied) NOTES:
In addition, if the SHM_RDONLY flag is OR'd in with the flag argument, then the shared memory segment will be mapped in, but marked as readonly.
This call is perhaps the simplest to use. Consider this wrapper function, which is passed a valid IPC identifier for a segment, and returns the address that the segment was attached to:
char *attach_segment( int shmid ) { return(shmat(shmid, 0, 0)); }