1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#ifndef POTD_PTY_H #define POTD_PTY_H 1 #include <stdlib.h> #include <pwd.h> #define TTYSZ 64 int pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen); void pty_release(const char *tty); void pty_make_controlling_tty(int *ttyfd, const char *tty); void pty_change_window_size(int ptyfd, unsigned int row, unsigned int col, unsigned int xpixel, unsigned int ypixel); void pty_setowner(struct passwd *pw, const char *tty); void disconnect_controlling_tty(void); #endif