Messages in this thread | | | Date | Mon, 15 Mar 1999 18:15:47 +0900 (KST) | From | Koo KyoSeon <> | Subject | Unix98-pty problem |
| |
Hi,
I just try to use Unix98 PTYs and have a little problem here. I use the kernel 2.2.3-ac1 and glibc 2.1.1
1: get master using getpt() 2: get /dev/pts/<pty-number> using ptsname(master) 3: open /dev/pts/<pty-number> to use it as slave
If I use the code in glibc for getting a PTY I get an I/O Error at step 3.
It's the test code /*******************************************************/ #include <stdio.h> #include <fcntl.h> #include <sys/types.h>
main() { int master, slave; char *line; master = getpt(); if(master >=0) { line = (char *)ptsname(master); if(!line) { fprintf(stderr, "Get slave name error\n"); close(master); exit(0); } slave = open(line, O_RDWR); if(slave < 0) { perror(line); close(master); exit(1); } printf("%s -> %s\n", ttyname(master), line); close(slave); close(master); } } /*******************************************************/
What can I do?
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |