ctermid.3s
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3S 代码 · 共 60 行
3S
60 行
.\" SCCSID: @(#)ctermid.3s 8.1 9/11/90.TH ctermid 3s.SH Namectermid \- generate file name for terminal.SH Syntax.B #include <stdio.h>.PP.B char \(**ctermid(s).br.B char \(**s;.SH Description.NXR "ctermid subroutine".NXA "ctermid subroutine" "ttyname subroutine".NXR "terminal" "generating file name for"The.PN ctermidsubroutine generates the pathname of the controllingterminal for the current process, and stores it in a string..PPIf.I s\^is a NULLpointer, the string is stored in an internal static area,the contents of which are overwritten at the next call to.PN ctermid ,and the address of which is returned.Otherwise,.I s\^is assumed to point to a character array of at least.PN L_ctermidelements. The pathname is placed in this array and the value of.I s\^is returned.The constant.PN L_ctermidis defined in the <stdio.h> header file..NXR "ctermid subroutine" "compared with ttyname subroutine".NTThe difference between.PN ctermidand .MS ttyname 3is that.PN ttynamemust be handed a file descriptor and returns the actual name ofthe terminal associated with that file descriptor, while.PN ctermidreturns a string ( .PN /dev/tty) that will refer to theterminal if used as a file name.Thus.PN ttynamesubroutine is useful only if the process already has at least one file opento a terminal..NE.SH See Alsottyname(3)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?