I\'m trying to figure out how to use pseudo-terminal\'s in linux, essentially I want to create a telnetd clone, something I mentioned in an earlier question.
I under
#include
#include
#define _XOPEN_SOURCE
#include
int main(int argc, char **argv)
{
char *slavename;
int masterfd;
masterfd = open("/dev/ptmx", O_RDWR);
grantpt(masterfd);
unlockpt(masterfd);
slavename = ptsname(masterfd);
...
}
I posted simple example of demonstrating pseudo terminal master slave concept. please go through this link to get clear understanding of terminals in Linux http://www.linusakesson.net/programming/tty/