最初のページ 戻る 次へ 最後のページ 目次 図
実際のソースコードはどんな感じ?
#include <stdio.h>
 
#include <termios.h>
 
#include <sys/types.h>
 
#include <sys/ioctl.h>
 
#include <sys/wait.h>
 
#include <pty.h>
 
int main(int argc, char *argv[])
 
{
 
    struct termios t;
 
    struct winsize w;
 
    pid_t pid;
 
    int fd;
 
    u_char c;
 
    tcgetattr(0, &t);
 
    ioctl(0, TIOCGWINSZ, &w);
 
    pid = forkpty(&fd, NULL, &t, &w);
 
    if (!pid) {