[ale] more on pty

cfowler cfowler at outpostsentinel.com
Fri Jan 31 17:10:39 EST 2003


Here is the pty89 changes I made.  You no longer need to provide a
number.  System calls locate a pty that is available.




    if((mfd[pty] = open("/dev/ptmx", O_RDWR | O_NOCTTY)) == -1) {
        perror("Open master");
        exit(1);
    }

    grantpt(mfd[pty]);
    unlockpt(mfd[pty]);

    //snprintf(pName, sizeof(pName), "/dev/ttyp%d", pty);

    if((sfd[pty] = open((char *)ptsname(mfd[pty]), O_RDWR)) == -1) {
        fprintf(stderr, "Open %s:", (char *)ptsname(mfd[pty]));
        perror("");
        exit(1);
    }


_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list