tcgetsidのヘルプ・マニュアル
日本語 英語
tcgetsid --help
man tcgetsid
TCGETSID(3) Linux Programmer’s Manual TCGETSID(3)
名前
tcgetsid - セッションID を取得する
書式
#define _XOPEN_SOURCE 500
#include
pid_t tcgetsid(int fd);
説明
関 数 tcgetsid() は、制御端末として fd に対応する端末を持つカレント・セ
ッションのセッションID を返す。この端末は tcgetsid() の呼び出しを行うプ
ロセスの制御端末でなければならない。
返り値
fd が 呼 び 出 しを行ったセッションの制御端末を参照している場合、関数
tcgetsid() はこのセッションのセッションID を返す。そうでない場合 、 -1
が返され、 errno が適切に設定される。
エラー
EBADF fd は有効なファイル記述子でない。
ENOTTY 呼び出しを行ったプロセスが制御端末を持っていない、もしくは制御端
末を持っているが fd で参照されるものとは異なる。
バージョン
tcgetsid() は、バージョン 2.1 以降の glibc で提供されている。
準拠
POSIX.1-2001.
注意
この関数は TIOCGSID ioctl(2) 経由で実現されており、 Linux 2.1.71 以降で
存在する。
関連項目
getsid(2)
GNU 2008-06-14 TCGETSID(3)
TCGETSID(3) Linux Programmer’s Manual TCGETSID(3)
NAME
tcgetsid - get session ID
SYNOPSIS
#define _XOPEN_SOURCE 500
#include
pid_t tcgetsid(int fd);
DESCRIPTION
The function tcgetsid() returns the session ID of the current session
that has the terminal associated to fd as controlling terminal. This
terminal must be the controlling terminal of the calling process.
RETURN VALUE
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 appropriately.
ERRORS
EBADF fd is not a valid file descriptor.
ENOTTY The calling process does not have a controlling terminal, or it
has one but it is not described by fd.
VERSIONS
tcgetsid() is provided in glibc since version 2.1.
CONFORMING TO
POSIX.1-2001.
NOTES
This function is implemented via the TIOCGSID ioctl(2), present since
Linux 2.1.71.
SEE ALSO
getsid(2)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-06-14 TCGETSID(3)