getpt(3) Library Functions Manual getpt(3)

getpt - Ouvrir un nouveau pseudoterminal maître (PTM)

Bibliothèque C standard (libc-lc)

#define _GNU_SOURCE             /* Consultez feature_test_macros(7) */
#include <stdlib.h>
int getpt(void);

getpt() opens a new pseudoterminal device and returns a file descriptor that refers to that device. It is equivalent to opening the pseudoterminal multiplexer device


open("/dev/ptmx", O_RDWR);

on Linux systems, though the pseudoterminal multiplexer device is located elsewhere on some systems that use the GNU C library.

getpt() renvoie un descripteur de fichier ouvert s'il réussit. Sinon, il renvoie -1 et définit errno pour indiquer l'erreur.

getpt() peut échouer avec diverses erreurs décrites dans open(2).

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

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

Utilisez plutôt posix_openpt(3).

GNU.

glibc 2.1.

grantpt(3), posix_openpt(3), ptsname(3), unlockpt(3), ptmx(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.

26 décembre 2025 Pages du manuel de Linux 6.17