blob: 20ee90a1dcb8716c5d5da9fdcc32b183ebd84425 [file] [log] [blame]
Damien Millerd4a8b7e1999-10-27 13:42:43 +10001/*
2
3pty.h
4
5Author: Tatu Ylonen <ylo@cs.hut.fi>
6
7Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 All rights reserved
9
10Created: Fri Mar 17 05:03:28 1995 ylo
11
12Functions for allocating a pseudo-terminal and making it the controlling
13tty.
14
15*/
16
17/* RCSID("$Id: pty.h,v 1.1 1999/10/27 03:42:44 damien Exp $"); */
18
19#ifndef PTY_H
20#define PTY_H
21
22/* Allocates and opens a pty. Returns 0 if no pty could be allocated,
23 or nonzero if a pty was successfully allocated. On success, open file
24 descriptors for the pty and tty sides and the name of the tty side are
25 returned (the buffer must be able to hold at least 64 characters). */
26int pty_allocate(int *ptyfd, int *ttyfd, char *ttyname);
27
28/* Releases the tty. Its ownership is returned to root, and permissions to
29 0666. */
30void pty_release(const char *ttyname);
31
32/* Makes the tty the processes controlling tty and sets it to sane modes.
33 This may need to reopen the tty to get rid of possible eavesdroppers. */
34void pty_make_controlling_tty(int *ttyfd, const char *ttyname);
35
36/* Changes the window size associated with the pty. */
37void pty_change_window_size(int ptyfd, int row, int col,
38 int xpixel, int ypixel);
39
40#endif /* PTY_H */