.\" -*- coding: UTF-8 -*- .\" Copyright 1993 Giorgio Ciucci .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" 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 "2 Agosto 2019" Linux "Manual del Programador de Linux" .SH NOMBRE msgget \- devuelve un identificador System V para una cola de mensajes .SH SINOPSIS .nf \fB#include \fP \fB#include \fP \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 2 \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" Si ha funcionado correctamente, devuelve el idenficador para la cola de mensajes (un entero no negativo), en otro caso \-1 con \fIerrno\fP indicando el error. .SH ERRORES En caso de error, \fIerrno\fP tendrá uno de los siguientes valores: .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 "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, SVr4. .SH NOTAS .\" Like Linux, the FreeBSD man pages still document .\" the inclusion of these header files. The inclusion of \fI\fP and \fI\fP isn't required on Linux or by any version of POSIX. However, some old implementations required the inclusion of these header files, and the SVID also documented their inclusion. Applications intended to be portable to such old systems may need to include these header files. .PP \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. .SS "Notas de Linux" Hasta la versión 2.3.20 Linux devolvía \fBEIDRM\fP cuando se llamaba a \fBmsgget\fP() con una cola de mensajes planificada para ser borrada. .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) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .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 .