1 /* 2 * libslack - http://libslack.org/ 3 * 4 * Copyright (C) 1999-2001 raf <raf@raf.org> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * or visit http://www.gnu.org/copyleft/gpl.html 20 * 21 * 20011109 raf <raf@raf.org> 22 */ 23 24 /* 25 * Author: Tatu Ylonen <ylo@cs.hut.fi> 26 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 27 * All rights reserved 28 * Functions for allocating a pseudo-terminal and making it the controlling 29 * tty. 30 * 31 * As far as I am concerned, the code I have written for this software 32 * can be used freely for any purpose. Any derived versions of this 33 * software must be clearly marked as such, and if the derived work is 34 * incompatible with the protocol description in the RFC file, it must be 35 * called by a name other than "ssh" or "Secure Shell". 36 */ 37 38 #ifndef LIBSLACK_PSEUDO_H 39 #define LIBSLACK_PSEUDO_H 40 41 #include <termios.h> 42 #include <sys/ioctl.h> 43 #include <sys/types.h> 44 45 #define SLAVE_SIZE 64 46 47 int pty_open(int *masterfd, int *slavefd, char *slavename, size_t slavenamesize, 48 const struct termios *slave_termios, 49 const struct winsize *slave_winsize); 50 int pty_release(const char *slavename); 51 int pty_set_owner(const char *slavename, uid_t uid); 52 int pty_make_controlling_tty(int *slavefd, const char *slavename); 53 int pty_change_window_size(int masterfd, int row, int col, int xpixel, 54 int ypixel); 55 pid_t pty_fork(int *masterfd, char *slavename, size_t slavenamesize, 56 const struct termios *slave_termios, 57 const struct winsize *slave_winsize); 58 59 #endif 60