dorne/cursetree/pty/_pty.h

31 lines
829 B
C
Raw Normal View History

2025-09-09 15:43:54 +10:00
#ifndef DORNE_MKPTY_H
#define DORNE_MKPTY_H
2025-09-09 21:03:40 +10:00
#include <errno.h>
#include <limits.h>
2025-09-09 15:43:54 +10:00
#include <sys/types.h>
2025-09-09 21:03:40 +10:00
#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) \
;
2025-09-09 15:43:54 +10:00
2025-09-09 19:43:54 +10:00
/* Custom implementation of glibc::openpty() */
2025-09-09 15:43:54 +10:00
int mkpty(int *fdmx, int *fds);
2025-09-09 19:43:54 +10:00
/* Custom implementation of glibc::login_tty() */
2025-09-09 21:03:40 +10:00
void bindpty(const int fdty);
2025-09-09 19:43:54 +10:00
/* Custom implementation of glibc::forkpty() */
2025-09-09 21:03:40 +10:00
pid_t forkmkpty(int *fdmx);
2025-09-09 15:43:54 +10:00
2025-09-09 21:03:40 +10:00
int setptsxy(const unsigned short rows, const unsigned short cols,
const int fds);
2025-09-09 15:43:54 +10:00
int getptsxy(unsigned short *rows, unsigned short *cols, const int fds);
#endif /* DORNE_MKPTY_H */