execvp has to do ENOEXEC recovery even if `/' in the path
[unix-history] / usr / src / lib / libc / gen / ctermid.3
CommitLineData
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
11ctermid \- generate terminal pathname
12.SH SYNOPSIS
13.nf
14.ft B
15#include <stdio.h>
16.sp
17char *ctermid(char *buf);
18.ft R
19.fi
20.SH DESCRIPTION
21The
22.I ctermid
23function generates a string, that, when used as a pathname, refers to
24the current controlling terminal for the current process.
25.PP
26If
27.I buf
28is a NULL pointer, a pointer to a static area is returned.
29Otherwise, the pathname is copied into the memory referenced by
30.IR buf .
31.I Buf
32is assumed to be at least L_ctermid (as defined in the include
33file <stdio.h>) bytes long.
34.PP
35The current implementation simply returns ``/dev/tty''.
36.SH RETURN
37Upon successful completion, a non-NULL pointer is returned.
38Otherwise, a NULL pointer is returned and
39.I errno
40is set to indicate the error.
41.SH ERRORS
42The current implementation detects no error conditions.
43.SH "SEE ALSO"
44ttyname(3)
45.SH STANDARDS
46.I Ctermid
47conforms to IEEE Std 1003.1-1988 (``POSIX'').
48.SH BUGS
49By default, all information is contained in a static buffer which is
50overwritten by each new call.
51It must be copied elsewhere to be retained.