.\" -*- coding: UTF-8 -*- .\" Copyright 1993 Giorgio Ciucci .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" Added correction due to Nick Duffek , aeb, 960426 .\" Modified Wed Nov 6 04:00:31 1996 by Eric S. Raymond .\" Modified, 8 Jan 2003, Michael Kerrisk, .\" Removed EIDRM from errors - that can't happen... .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" Modified, 11 Nov 2004, Michael Kerrisk .\" Language and formatting clean-ups .\" Added notes on /proc files .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH msgget 2 "30 Marzo 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE msgget \- devuelve un identificador System V para una cola de mensajes .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBint msgget(key_t \fP\fIkey\fP\fB, int \fP\fImsgflg\fP\fB);\fP .fi .SH DESCRIPCIÓN The \fBmsgget\fP() system call returns the System\ V message queue identifier associated with the value of the \fIkey\fP argument. It may be used either to obtain the identifier of a previously created message queue (when \fImsgflg\fP is zero and \fIkey\fP does not have the value \fBIPC_PRIVATE\fP), or to create a new set. .PP A new message queue is created if \fIkey\fP has the value \fBIPC_PRIVATE\fP or \fIkey\fP isn't \fBIPC_PRIVATE\fP, no message queue with the given key \fIkey\fP exists, and \fBIPC_CREAT\fP is specified in \fImsgflg\fP. .PP If \fImsgflg\fP specifies both \fBIPC_CREAT\fP and \fBIPC_EXCL\fP and a message queue already exists for \fIkey\fP, then \fBmsgget\fP() fails with \fIerrno\fP set to \fBEEXIST\fP. (This is analogous to the effect of the combination \fBO_CREAT | O_EXCL\fP for \fBopen\fP(2).) .PP Upon creation, the least significant bits of the argument \fImsgflg\fP define the permissions of the message queue. These permission bits have the same format and semantics as the permissions specified for the \fImode\fP argument of \fBopen\fP(2). (The execute permissions are not used.) .PP Si se crea una nueva cola de mensajes, la llamada al sistema inicializa la estructura de datos del sistema (consulte \fBmsgctl\fP(2)) para la cola \fBmsqid_ds\fP como se muestra: .IP \[bu] 3 \fImsg_perm.cuid\fP y \fImsg_perm.uid\fP son fijados al identificador del usuario efectivo del proceso invocador. .IP \[bu] \fImsg_perm.cgid\fP y \fImsg_perm.gid\fP son fijados al identificador de grupo efectivo del proveso invocador. .IP \[bu] Los 9 bits menos importantes de \fImsg_perm.mode\fP son fijados a los 9 bits menos significativos de \fImsgflg\fP. .IP \[bu] \fImsg_qnum\fP, \fImsg_lspid\fP, \fImsg_lrpid\fP, \fImsg_stime\fP y \fImsg_rtime\fP son puestos a 0. .IP \[bu] \fImsg_ctime\fP contendrá la hora actual. .IP \[bu] \fImsg_qbytes\fP será igual al límite impuesto por el sistema \fBMSGMNB\fP. .PP 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. .SH "VALOR DEVUELTO" On success, \fBmsgget\fP() returns the message queue identifier (a nonnegative integer). On failure, \-1 is returned, and \fIerrno\fP is set to indicate the error. .SH ERRORES .TP \fBEACCES\fP A message queue exists for \fIkey\fP, but the calling process does not have permission to access the queue, and does not have the \fBCAP_IPC_OWNER\fP capability in the user namespace that governs its IPC namespace. .TP \fBEEXIST\fP \fBIPC_CREAT\fP and \fBIPC_EXCL\fP were specified in \fImsgflg\fP, but a message queue already exists for \fIkey\fP. .TP \fBENOENT\fP No message queue exists for \fIkey\fP and \fImsgflg\fP did not specify \fBIPC_CREAT\fP. .TP \fBENOMEM\fP Una cola de mensajes ha de ser creada pero el sistema no contiene suficiente memoria para la nueva estructura de datos. .TP \fBENOSPC\fP Una cola de mensajes ha de ser creada pero el límite del sistema para el máximo número de colas de mensajes (\fBMSGMNI\fP) será superado. .SH ESTÁNDARES POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, SVr4. .SS Linux Until Linux 2.3.20, Linux would return \fBEIDRM\fP for a \fBmsgget\fP() on a message queue scheduled for deletion. .SH NOTAS \fBIPC_PRIVATE\fP isn't a flag field but a \fIkey_t\fP type. If this special value is used for \fIkey\fP, the system call ignores everything but the least significant 9 bits of \fImsgflg\fP and creates a new message queue (on success). .PP Lo siguiente es una limitación en los recursos del sistema que afecta a la llamada \fBmsgget\fP(): .TP \fBMSGMNI\fP .\" commit 0050ee059f7fc86b1df2527aaa14ed5dc72f9973 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 \fI/proc/sys/kernel/msgmni\fP. .SH ERRORES La elección del nombre \fBIPC_PRIVATE\fP puede que fuera desafortunada, \fBIPC_NEW\fP mostraría más claramente su función. .SH "VÉASE TAMBIÉN" \fBmsgctl\fP(2), \fBmsgrcv\fP(2), \fBmsgsnd\fP(2), \fBftok\fP(3), \fBcapabilities\fP(7), \fBmq_overview\fP(7), \fBsysvipc\fP(7) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Juan Piernas y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .