.\" -*- coding: UTF-8 -*- .\" Copyright (C) 2006 Michael Kerrisk .\" .\" %%%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 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH MQ_RECEIVE 3 "13 août 2020" Linux "Manuel du programmeur Linux" .SH NOM mq_receive, mq_timedreceive \- Recevoir un message d'une file de messages .SH SYNOPSIS .nf \fB#include \fP .PP \fBssize_t mq_receive(mqd_t \fP\fImqdes\fP\fB, char *\fP\fImsg_ptr\fP\fB,\fP \fB size_t \fP\fImsg_len\fP\fB, unsigned int *\fP\fImsg_prio\fP\fB);\fP .PP \fB#include \fP \fB#include \fP .PP \fBssize_t mq_timedreceive(mqd_t \fP\fImqdes\fP\fB, char *\fP\fImsg_ptr\fP\fB,\fP \fB size_t \fP\fImsg_len\fP\fB, unsigned int *\fP\fImsg_prio\fP\fB,\fP \fB const struct timespec *\fP\fIabs_timeout\fP\fB);\fP .fi .PP Éditer les liens avec \fI\-lrt\fP. .PP .ad l .RS -4 Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7))\ : .RE .PP \fBmq_timedreceive\fP()\ : .RS 4 _POSIX_C_SOURCE\ >=\ 200112L .RE .ad .SH DESCRIPTION \fBmq_receive\fP() removes the oldest message with the highest priority from the message queue referred to by the message queue descriptor \fImqdes\fP, and places it in the buffer pointed to by \fImsg_ptr\fP. The \fImsg_len\fP argument specifies the size of the buffer pointed to by \fImsg_ptr\fP; this must be greater than or equal to the \fImq_msgsize\fP attribute of the queue (see \fBmq_getattr\fP(3)). If \fImsg_prio\fP is not NULL, then the buffer to which it points is used to return the priority associated with the received message. .PP Si la file est vide, alors par défaut, \fBmq_receive\fP() bloque tant qu'aucun message n'est disponible, ou que l'appel n'est pas interrompu par un gestionnaire de signaux. Si le drapeau \fBO_NONBLOCK\fP est activé dans la description de file de messages, alors l'appel échouera immédiatement avec l'erreur \fBEAGAIN\fP. .PP \fBmq_timedreceive\fP() behaves just like \fBmq_receive\fP(), except that if the queue is empty and the \fBO_NONBLOCK\fP flag is not enabled for the message queue description, then \fIabs_timeout\fP points to a structure which specifies how long the call will block. This value is an absolute timeout in seconds and nanoseconds since the Epoch, 1970\-01\-01 00:00:00 +0000 (UTC), specified in the following structure: .PP .in +4n .EX struct timespec { time_t tv_sec; /* secondes */ long tv_nsec; /* nanosecondes */ }; .EE .in .PP Si aucun message n'est disponible et si le délai d'attente a déjà expiré pendant la durée de l'appel, \fBmq_timedreceive\fP() s'achève immédiatement. .SH "VALEUR RENVOYÉE" En cas de succès, \fBmq_receive\fP() et \fBmq_timedreceive\fP() renvoient le nombre d'octets du message reçu. En cas d'erreur, \-1 est renvoyé et \fIerrno\fP indique l'erreur. .SH ERREURS .TP \fBEAGAIN\fP La file est vide et le drapeau \fBO_NONBLOCK\fP était défini pour la file de messages référencée par le descripteur \fImqdes\fP. .TP \fBEBADF\fP The descriptor specified in \fImqdes\fP was invalid or not opened for reading. .TP \fBEINTR\fP L'appel a été interrompu par un gestionnaire de signal\ ; consultez \fBsignal\fP(7). .TP \fBEINVAL\fP L'appel devrait être bloqué, et \fIabs_timeout\fP n'est pas valable, soit car \fItv_sec\fP est inférieur à zéro, ou soit car \fItv_nsec\fP est inférieur à zéro ou plus grand que 1000\ millions. .TP \fBEMSGSIZE\fP \fImsg_len\fP était plus petit que l'attribut \fImq_msgsize\fP de la file de messages. .TP \fBETIMEDOUT\fP Le délai d'attente de l'appel a expiré avant que le message ait été transféré. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbw31 lb lb l l l. Interface Attribut Valeur T{ \fBmq_receive\fP(), \fBmq_timedreceive\fP() T} Sécurité des threads MT\-Safe .TE .SH CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008. .SH NOTES Sous Linux, \fBmq_timedreceive\fP() est un appel système et \fBmq_receive\fP() est une fonction de bibliothèque au dessus de la couche des appels systèmes. .SH "VOIR AUSSI" \fBmq_close\fP(3), \fBmq_getattr\fP(3), \fBmq_notify\fP(3), \fBmq_open\fP(3), \fBmq_send\fP(3), \fBmq_unlink\fP(3), \fBmq_overview\fP(7), \fBtime\fP(7) .SH COLOPHON Cette page fait partie de la publication\ 5.10 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier et David Prévot . Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .