getpt

Section: C Library Functions (3)
Updated: 2025-12-26
Index JM Home Page roff page
 

名前

getpt - 新規の擬似端末マスタをオープンする  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#define _GNU_SOURCE             /* 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() はオープンしたファイルのディスクリプターを返す。 そうでない場合、-1 を返し、 errno にエラーを示す値がセットされる。  

エラー

getpt() は open(2) で説明されている種々のエラーで失敗する可能性がある。  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
getpt() Thread safetyMT-Safe
 

バージョン

Use posix_openpt(3) instead.  

標準規格

GNU.  

歴史

glibc 2.1.  

関連項目

grantpt(3), posix_openpt(3), ptsname(3), unlockpt(3), ptmx(4), pty(7)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
バージョン
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.