Provided by: manpages-es-dev_4.27.0-1_all bug

NOMBRE

       msgget - devuelve un identificador System V para una cola de mensajes

BIBLIOTECA

       Biblioteca Estándar C (libc, -lc)

SINOPSIS

       #include <sys/msg.h>

       int msgget(key_t key, int msgflg);

DESCRIPCIÓN

       The  msgget()  system call returns the System V message queue identifier associated with the value of the
       key argument.  It may be used either to obtain the identifier of a previously created message queue (when
       msgflg is zero and key does not have the value IPC_PRIVATE), or to create a new set.

       A new message queue is created if key has the value IPC_PRIVATE or  key  isn't  IPC_PRIVATE,  no  message
       queue with the given key key exists, and IPC_CREAT is specified in msgflg.

       If msgflg specifies both IPC_CREAT and IPC_EXCL and a message queue already exists for key, then msgget()
       fails with errno set to EEXIST.  (This is analogous to the effect of the combination O_CREAT | O_EXCL for
       open(2).)

       Upon  creation,  the  least significant bits of the argument msgflg define the permissions of the message
       queue.  These permission bits have the same format and semantics as the  permissions  specified  for  the
       mode argument of open(2).  (The execute permissions are not used.)

       Si  se  crea  una  nueva  cola  de  mensajes, la llamada al sistema inicializa la estructura de datos del
       sistema (consulte msgctl(2)) para la cola msqid_ds como se muestra:

       •  msg_perm.cuid y msg_perm.uid son fijados al identificador del usuario efectivo del proceso invocador.

       •  msg_perm.cgid y msg_perm.gid son fijados al identificador de grupo efectivo del proveso invocador.

       •  Los 9 bits menos importantes de msg_perm.mode son fijados a los 9 bits menos significativos de msgflg.

       •  msg_qnum, msg_lspid, msg_lrpid, msg_stime y msg_rtime son puestos a 0.

       •  msg_ctime contendrá la hora actual.

       •  msg_qbytes será igual al límite impuesto por el sistema MSGMNB.

       Si la cola de mensajes ya existe, se verifican los permisos, y ser realiza  una  comprobación  a  fin  de
       verificar si está marcada para su destrucción.

VALOR DEVUELTO

       On  success,  msgget()   returns the message queue identifier (a nonnegative integer).  On failure, -1 is
       returned, and errno is set to indicate the error.

ERRORES

       EACCES A message queue exists for key, but the calling process does not have  permission  to  access  the
              queue,  and  does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC
              namespace.

       EEXIST IPC_CREAT and IPC_EXCL were specified in msgflg, but a message queue already exists for key.

       ENOENT No message queue exists for key and msgflg did not specify IPC_CREAT.

       ENOMEM Una cola de mensajes ha de ser creada pero el sistema no contiene suficiente memoria para la nueva
              estructura de datos.

       ENOSPC Una cola de mensajes ha de ser creada pero el límite del sistema para el máximo número de colas de
              mensajes (MSGMNI)  será superado.

ESTÁNDARES

       POSIX.1-2008.

HISTORIAL

       POSIX.1-2001, SVr4.

   Linux
       Until Linux 2.3.20, Linux would return EIDRM for a msgget()  on a message queue scheduled for deletion.

NOTAS

       IPC_PRIVATE isn't a flag field but a key_t type.  If this special value is used for key, the system  call
       ignores  everything  but  the  least  significant  9  bits  of msgflg and creates a new message queue (on
       success).

       Lo siguiente es una limitación en los recursos del sistema que afecta a la llamada msgget():

       MSGMNI System-wide limit on the number of message queues.  Before Linux 3.19, the default value for  this
              limit  was  calculated  using  a  formula based on available system memory.  Since Linux 3.19, the
              default  value  is  32,000.    On   Linux,   this   limit   can   be   read   and   modified   via
              /proc/sys/kernel/msgmni.

ERRORES

       La  elección  del  nombre  IPC_PRIVATE puede que fuera desafortunada, IPC_NEW mostraría más claramente su
       función.

VÉASE TAMBIÉN

       msgctl(2), msgrcv(2), msgsnd(2), ftok(3), capabilities(7), mq_overview(7), sysvipc(7)

TRADUCCIÓN

       La traducción al español de esta página del manual fue creada por Juan  Piernas  <piernas@ditec.um.es>  y
       Marcos Fouces <marcos@debian.org>

       Esta  traducción  es  documentación  libre;  lea  la GNU General Public License Version 3 o posterior con
       respecto a las condiciones de copyright.  No existe NINGUNA RESPONSABILIDAD.

       Si encuentra algún error en la traducción de esta página  del  manual,  envíe  un  correo  electrónico  a
       debian-l10n-spanish@lists.debian.org.

Páginas de Manual de Linux 6.9.1                   2 Mayo 2024                                         msgget(2)