|
Packit |
6c4009 |
/* Support functions related to (pseudo)terminals.
|
|
Packit |
6c4009 |
Copyright (C) 2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _SUPPORT_TTY_H
|
|
Packit |
6c4009 |
#define _SUPPORT_TTY_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct termios;
|
|
Packit |
6c4009 |
struct winsize;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/** Open a pseudoterminal pair. The outer fd is written to the address
|
|
Packit |
6c4009 |
A_OUTER and the inner fd to A_INNER.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
If A_NAME is not NULL, it will be set to point to a string naming
|
|
Packit |
6c4009 |
the /dev/pts/NNN device corresponding to the inner fd; space for
|
|
Packit |
6c4009 |
this string is allocated with malloc and should be freed by the
|
|
Packit |
6c4009 |
caller when no longer needed. (This is different from the libutil
|
|
Packit |
6c4009 |
function 'openpty'.)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
If TERMP is not NULL, the terminal parameters will be initialized
|
|
Packit |
6c4009 |
according to the termios structure it points to.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
If WINP is not NULL, the terminal window size will be set
|
|
Packit |
6c4009 |
accordingly.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
Terminates the process on failure (like xmalloc). */
|
|
Packit |
6c4009 |
extern void support_openpty (int *a_outer, int *a_inner, char **a_name,
|
|
Packit |
6c4009 |
const struct termios *termp,
|
|
Packit |
6c4009 |
const struct winsize *winp);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif
|