4.4BSD/usr/share/man/cat3/ctermid.0

Compare this file to the similar file:
Show the results in this format:

CTERMID(3)                  BSD Programmer's Manual                 CTERMID(3)

NNAAMMEE
     cctteerrmmiidd - generate terminal pathname

SSYYNNOOPPSSIISS
     ##iinncclluuddee <<ssttddiioo..hh>>

     _c_h_a_r _*
     cctteerrmmiidd(_c_h_a_r _*_b_u_f);

DDEESSCCRRIIPPTTIIOONN
     The cctteerrmmiidd() function generates a string, that, when used as a pathname,
     refers to the current controlling terminal of the calling process.

     If _b_u_f is the NULL pointer, a pointer to a static area is returned.  Oth-
     erwise, the pathname is copied into the memory referenced by _b_u_f. The ar-
     gument _b_u_f is assumed to be at least L_ctermid (as defined in the include
     file <_s_t_d_i_o_._h>) bytes long.

     The current implementation simply returns `/dev/tty'.

RREETTUURRNN VVAALLUUEESS
     Upon successful completion, a non-NULL pointer is returned.  Otherwise, a
     NULL pointer is returned and the global variable _e_r_r_n_o is set to indicate
     the error.

EERRRROORRSS
     The current implementation detects no error conditions.

SSEEEE AALLSSOO
     ttyname(3)

SSTTAANNDDAARRDDSS
     The ctermid function conforms to IEEE Std1003.1-1988 (``POSIX'').

BBUUGGSS
     By default the cctteerrmmiidd() function writes all information to an internal
     static object.  Subsequent calls to cctteerrmmiidd() will modify the same ob-
     ject.

4.4BSD                           June 4, 1993                                1