Rev | Line | |
---|
[9] | 1 | /* ctermid(3)
|
---|
| 2 | *
|
---|
| 3 | * Author: Terrence Holm Aug. 1988
|
---|
| 4 | *
|
---|
| 5 | *
|
---|
| 6 | * Ctermid(3) returns a pointer to a string naming the controlling
|
---|
| 7 | * terminal. If <name_space> is NULL then local PRIVATE storage
|
---|
| 8 | * is used, otherwise <name_space> must point to storage of at
|
---|
| 9 | * least L_ctermid characters.
|
---|
| 10 | *
|
---|
| 11 | * Returns a pointer to "/dev/tty".
|
---|
| 12 | */
|
---|
| 13 |
|
---|
| 14 | #include <lib.h>
|
---|
| 15 | #include <string.h>
|
---|
| 16 | #include <stdio.h>
|
---|
| 17 |
|
---|
| 18 | _PROTOTYPE( char *ctermid, (char *name_space));
|
---|
| 19 |
|
---|
| 20 | #ifndef L_ctermid
|
---|
| 21 | #define L_ctermid 9
|
---|
| 22 | #endif
|
---|
| 23 |
|
---|
| 24 | char *ctermid(name_space)
|
---|
| 25 | char *name_space;
|
---|
| 26 | {
|
---|
| 27 | PRIVATE char termid[L_ctermid];
|
---|
| 28 |
|
---|
| 29 | if (name_space == (char *)NULL) name_space = termid;
|
---|
| 30 | strcpy(name_space, "/dev/tty");
|
---|
| 31 | return(name_space);
|
---|
| 32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.