Che materia stai cercando?

Sistemi operativi - Syscall shmat Appunti scolastici Premium

Appunti di sistemi operativi per l'esame dei professori Cotroneo e Natella. gli argomenti trattati sono i seguenti: System call shmat: name, sypnosis, description, return value, errors, examples, application usage, future directions, see also, derivation.

Esame di Sistemi operativi docente Prof. D. Cotroneo

Anteprima

ESTRATTO DOCUMENTO

shmat http://www.opengroup.org/onlinepubs/007908799/xsh/shmat.html

The Single UNIX ® Specification, Version 2

Copyright © 1997 The Open Group

NAME

shmat - shared memory attach operation

SYNOPSIS

#include <sys/shm.h>

void *shmat(int const void *shmaddr, int

shmid, shmflg);

DESCRIPTION

The shmat() function attaches the shared memory segment associated with the shared

memory identifier specified by shmid to the address space of the calling process. The segment

is attached at the address specified by one of the following criteria:

If shmaddr is a null pointer, the segment is attached at the first available address as

selected by the system.

If shmaddr is not a null pointer and (shmflg&SHM_RND) is non-zero, the segment is

attached at the address given by (shmaddr-((uintptr_t)shmaddr%SHMLBA)) The

character % is the C-language remainder operator.

If shmaddr is not a null pointer and (shmflg&SHM_RND) is 0, the segment is attached

at the address given by shmaddr.

The segment is attached for reading if (shmflg&SHM_RDONLY) is non-zero and the

calling process has read permission; otherwise, if it is 0 and the calling process has read

and write permission, the segment is attached for reading and writing.

RETURN VALUE

Upon successful completion, shmat() increments the value of shm_nattch in the data structure

associated with the shared memory ID of the attached shared memory segment and returns

the segment's start address.

Otherwise, the shared memory segment is not attached, shmat() returns -1 and errno is set to

indicate the error.

ERRORS

The shmat() function will fail if:

[EACCES]

Operation permission is denied to the calling process, see IPC.

[EINVAL]

The value of shmid is not a valid shared memory identifier; the shmaddr is not a null

pointer and the value of (shmaddr-((ptrdiff_t)shmaddr%SHMLBA)) is an illegal

address for attaching shared memory; or the shmaddr is not a null pointer,

1 di 2 21/04/2010 14:23


PAGINE

2

PESO

90.04 KB

AUTORE

N. A.

PUBBLICATO

+1 anno fa


DETTAGLI
Corso di laurea: Corso di laurea in ingegneria informatica
SSD:
A.A.: 2013-2014

I contenuti di questa pagina costituiscono rielaborazioni personali del Publisher N. A. di informazioni apprese con la frequenza delle lezioni di Sistemi operativi e studio autonomo di eventuali libri di riferimento in preparazione dell'esame finale o della tesi. Non devono intendersi come materiale ufficiale dell'università Napoli Federico II - Unina o del prof Cotroneo Domenico.

Acquista con carta o conto PayPal

Scarica il file tutte le volte che vuoi

Paga con un conto PayPal per usufruire della garanzia Soddisfatto o rimborsato

Recensioni
Ti è piaciuto questo appunto? Valutalo!

Altri appunti di Sistemi operativi

Sistemi Operativi
Dispensa
Sistemi Operativi
Dispensa
Sistemi operativi - schema suntivo per la prova pratica
Appunto
Tesine sui sistemi operativi
Appunto