[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] more on pty
- Subject: [ale] more on pty
- From: cfowler at outpostsentinel.com (cfowler)
- Date: 31 Jan 2003 17:10:39 -0500
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