grantpt(3) Library Functions Manual grantpt(3)

grantpt - Donner accès à un pseudoterminal esclave

Bibliothèque C standard (libc, -lc)

#include <stdlib.h>
int grantpt(int fd);
Exigences de macros de test de fonctionnalités pour la glibc (consulter feature_test_macros(7)) :

grantpt() :

    Depuis la glibc 2.24 :
        _XOPEN_SOURCE >= 500
    glibc 2.23 et antérieures :
        _XOPEN_SOURCE

La fonction grantpt() modifie le mode et l'appartenant du pseudoterminal esclave correspondant au pseudoterminal maître référencé par le descripteur de fichier fd. L'UID de l'esclave est rempli avec l'UID réel du processus appelant. Le GID est rempli avec une valeur non spécifiée (par exemple : tty). Le mode de l'esclave est mis à 0620 (crw--w----).

Le comportement de grantpt() est indéterminé si un gestionnaire de signal est installé pour capturer SIGCHLD.

Lorsqu'elle réussit, la fonction grantpt() renvoie 0. Sinon, elle renvoie -1 et errno est défini pour indiquer l'erreur.

Le pseudoterminal esclave n'est pas accessible.
L'argument fd n'est pas un descripteur valable.
L'argument fd est un descripteur mais pas associé avec un pseudoterminal maître.

Pour une explication des termes utilisés dans cette section, consulter attributes(7).

Interface Attribut Valeur
grantpt() Sécurité des threads MT-Safe locale

POSIX.1-2008.

glibc 2.1. POSIX.1-2001.

grantpt() fait partie de la prise en charge du pseudoterminal d'UNIX 98, (voir pts(4)).

Historical systems implemented this function via a set-user-ID helper binary called "pt_chown". glibc on Linux before glibc 2.33 could do so as well, in order to support configurations with only BSD pseudoterminals; this support has been removed. On modern systems this is either a no-op —with permissions configured on pty allocation, as is the case on Linux— or an ioctl(2).

open(2), posix_openpt(3), ptsname(3), unlockpt(3), pts(4), pty(7)

La traduction française de cette page de manuel a été créée par Christophe Blaess https://www.blaess.fr/christophe/, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org> et David Prévot <david@tilapin.org>

Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 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 à debian-l10n-french@lists.debian.org.

31 octobre 2023 Pages du manuel de Linux 6.06