30 lines
835 B
C
30 lines
835 B
C
#ifndef CURSETREE_PTY_H
|
|
#define CURSETREE_PTY_H
|
|
|
|
#include <errno.h>
|
|
#include <limits.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
|
|
#ifdef PATH_MAX
|
|
#define TTYNAME_MAX PATH_MAX
|
|
#else
|
|
#define TTYNAME_MAX 512
|
|
#endif /* PATH_MAX */
|
|
|
|
#define BIND(fdsrc, fddst) \
|
|
while (dup2(fdsrc, fddst) == -1 && errno == EBUSY) \
|
|
;
|
|
|
|
/* Custom implementation of glibc::openpty() */
|
|
int mkpty(int *fdmx, int *fds);
|
|
/* Custom implementation of glibc::login_tty() */
|
|
void bindpty(const int fdty);
|
|
/* Custom implementation of glibc::forkpty() */
|
|
pid_t forkmkpty(int *fdmx);
|
|
|
|
int setptsxy(const unsigned short rows, const unsigned short cols,
|
|
const int fds);
|
|
int getptsxy(unsigned short *rows, unsigned short *cols, const int fds);
|
|
|
|
#endif /* CURSETREE_PTY_H */
|