--- libaitio/inc/aitio.h 2011/09/19 23:30:50 1.11.2.17 +++ libaitio/inc/aitio.h 2011/09/22 22:29:01 1.11.2.20 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.h,v 1.11.2.17 2011/09/19 23:30:50 misho Exp $ +* $Id: aitio.h,v 1.11.2.20 2011/09/22 22:29:01 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -764,11 +764,12 @@ int io_Blowfish(unsigned char *pInput, int inLen, unsi inline int ioAllocPTY(int *ptyfd, int *ttyfd, char * __restrict name, int namesiz, struct termios * __restrict term, struct winsize * __restrict winz); /* - * ioFreeTTY() Release TTY + * ioFreePTY() Release PTY and TTY device + * @ptyfd = master fd, pty (==-1 skip closing pty) * @ttyname = tty filename * return: none */ -inline void ioFreeTTY(const char *ttyname); +inline void ioFreePTY(int ptyfd, const char *ttyname); /* * ioChgWinPTY() Change window size of PTY * @ptyfd = master fd, pty @@ -808,6 +809,18 @@ inline int ioSetRAWMode(int fd, struct termios *otio); * return: -1 error or 0 ok */ inline int ioRestoreMode(int fd, struct termios tio); +/* + * ioForkPTY() Fork new process with session leader and new TTY + * @ptyfd = master fd, pty + * @name = tty device name if not null + * @namesiz = name length, must be above 63 bytes. + * @term = termios for terminal + * @winz = winsize for terminal + * @otio = old termios structure for restore + * return: -1 error, 0 child process or >0 parent: pid of child + */ +pid_t ioForkPTY(int *ptyfd, char * __restrict name, int namesiz, struct termios * __restrict term, + struct winsize * __restrict winz, struct termios * __restrict otio); #endif