Commit | Line | Data |
---|---|---|
bb40e6aa KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" %sccs.include.redist.man% | |
5 | .\" | |
6 | .\" @(#)ctermid.3 5.1 (Berkeley) %G% | |
7 | .\" | |
8 | .TH CTERMID 3 "" | |
9 | .UC 7 | |
10 | .SH NAME | |
11 | ctermid \- generate terminal pathname | |
12 | .SH SYNOPSIS | |
13 | .nf | |
14 | .ft B | |
15 | #include <stdio.h> | |
16 | .sp | |
17 | char *ctermid(char *buf); | |
18 | .ft R | |
19 | .fi | |
20 | .SH DESCRIPTION | |
21 | The | |
22 | .I ctermid | |
23 | function generates a string, that, when used as a pathname, refers to | |
24 | the current controlling terminal for the current process. | |
25 | .PP | |
26 | If | |
27 | .I buf | |
28 | is a NULL pointer, a pointer to a static area is returned. | |
29 | Otherwise, the pathname is copied into the memory referenced by | |
30 | .IR buf . | |
31 | .I Buf | |
32 | is assumed to be at least L_ctermid (as defined in the include | |
33 | file <stdio.h>) bytes long. | |
34 | .PP | |
35 | The current implementation simply returns ``/dev/tty''. | |
36 | .SH RETURN | |
37 | Upon successful completion, a non-NULL pointer is returned. | |
38 | Otherwise, a NULL pointer is returned and | |
39 | .I errno | |
40 | is set to indicate the error. | |
41 | .SH ERRORS | |
42 | The current implementation detects no error conditions. | |
43 | .SH "SEE ALSO" | |
44 | ttyname(3) | |
45 | .SH STANDARDS | |
46 | .I Ctermid | |
47 | conforms to IEEE Std 1003.1-1988 (``POSIX''). | |
48 | .SH BUGS | |
49 | By default, all information is contained in a static buffer which is | |
50 | overwritten by each new call. | |
51 | It must be copied elsewhere to be retained. |