Anteprima
Vedrai una selezione di 1 pagina su 2
Sistemi operativi - Syscall msgget Pag. 1
1 su 2
D/illustrazione/soddisfatti o rimborsati
Disdici quando
vuoi
Acquista con carta
o PayPal
Scarica i documenti
tutte le volte che vuoi
Estratto del documento

msgget - get the message queue identifier

The Single UNIX ® Specification, Version 2

Copyright © 1997 The Open Group

NAME

msgget - get the message queue identifier

SYNOPSIS

#include <sys/msg.h>
int msgget(key_t intkey, msgflg);

DESCRIPTION

The msgget() function returns the message queue identifier associated with the argument key.

A message queue identifier, associated message queue and data structure, see <sys/msg.h>, are created for the argument key if one of the following is true:

  • The argument key is equal to IPC_PRIVATE.
  • The argument key does not already have a message queue identifier associated with it, and (msgflg & IPC_CREAT) is non-zero.

Upon creation, the data structure associated with the new message queue identifier is initialised as follows: and are set equal to msg_perm.cuid, msg_perm.uid, msg_perm.cgid msg_perm.gid the effective user ID and effective group ID, respectively, of the calling process. The low-order 9 bits of are set equal to

The low-order 9 bits of msg_perm.mode and msgflg are set equal to 0. msg_qnum, msg_lspid, msg_lrpid, msg_stime, and msg_rtime are set equal to the current time. msg_ctime is set equal to the system limit. msg_qbytes

RETURN VALUE

Upon successful completion, msgget() returns a non-negative integer, namely a message queue identifier. Otherwise, it returns -1 and errno is set to indicate the error.

ERRORS

The msgget() function will fail if:

  • [EACCES] A message queue identifier exists for the argument key, but operation permission as specified by the low-order 9 bits of msgflg would not be granted, see IPC.
Dettagli
Publisher
A.A. 2012-2013
2 pagine
SSD Scienze matematiche e informatiche INF/01 Informatica

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à Università degli studi di Napoli Federico II o del prof Cotroneo Domenico.