tcgetsid

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

tcgetsid - セッションID を取得する  

ライブラリ

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

書式

#define _XOPEN_SOURCE 500        /* See feature_test_macros(7) */
#include <termios.h>

pid_t tcgetsid(int fd);
 

説明

関数 tcgetsid() は、制御端末として fd に対応する端末を持つカレントセッションのセッションID を返す。 この端末は tcgetsid() の呼び出しを行うプロセスの制御端末で なければならない。  

返り値

When fd refers to the controlling terminal of our session, the function tcgetsid() will return the session ID of this session. Otherwise, -1 is returned, and errno is set to indicate the error.  

エラー

EBADF
fd が有効なファイルディスクリプターではない。
ENOTTY
呼び出しを行ったプロセスが制御端末を持っていない、もしくは 制御端末を持っているが fd で参照されるものとは異なる。
 

属性

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

標準規格

POSIX.1-2008.  

歴史

glibc 2.1. POSIX.1-2001.

この関数は TIOCGSID ioctl(2) 経由で実現されており、 Linux 2.1.71 以降で存在する。  

関連項目

getsid(2)


 

Index

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

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