Blame support/tty.h

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