diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
commit | 4e506c9aefe5b89970ae6894d05ad53c81af0d83 (patch) | |
tree | 2fac98df209e72eaba773cad2d7b90c99d9d9249 /mdk-stage1/dietlibc/libugly/openpty.c | |
parent | 793707b39bf2e9df40a6d2d60b83b3061088ae9e (diff) | |
download | drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.gz drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.bz2 drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.xz drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.zip |
use installed dietlibc, not our forked cvs version
Diffstat (limited to 'mdk-stage1/dietlibc/libugly/openpty.c')
-rw-r--r-- | mdk-stage1/dietlibc/libugly/openpty.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/mdk-stage1/dietlibc/libugly/openpty.c b/mdk-stage1/dietlibc/libugly/openpty.c deleted file mode 100644 index 8d06f329c..000000000 --- a/mdk-stage1/dietlibc/libugly/openpty.c +++ /dev/null @@ -1,54 +0,0 @@ -#include <unistd.h> -#include <pty.h> -#include <fcntl.h> -#include <termios.h> -#include <sys/ioctl.h> -#include <errno.h> -#include <string.h> - -extern int __ltostr(char *s, int size, unsigned long i, int base, char UpCase); - -int openpty(int *amaster, int *aslave, char *name, struct termios - *termp, struct winsize *winp) { - int fd; - char buf[20]; -#if 0 - This is what glibc does: - open("/dev/ptmx", O_RDWR) = 4 - statfs("/dev/pts", {f_type=0x1cd1, f_bsize=1024, f_blocks=0, f_bfree=0, f_files=0, f_ffree=0, f_namelen=255}) = 0 - ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0 - ioctl(4, 0x80045430, [0]) = 0 - stat("/dev/pts/0", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 - statfs("/dev/pts/0", {f_type=0x1cd1, f_bsize=1024, f_blocks=0, f_bfree=0, f_files=0, f_ffree=0, f_namelen=255}) = 0 - ioctl(4, 0x40045431, [0]) = 0 - ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0 - ioctl(4, 0x80045430, [0]) = 0 - stat("/dev/pts/0", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 - open("/dev/pts/0", O_RDWR|O_NOCTTY) = 5 -#endif - if ((fd=open("/dev/ptmx",O_RDWR))<0) return -1; -#if 0 - if (ioctl(fd,TCGETS,&ts)<0) goto kaputt; -#endif - { - int unlock=0; - while (ioctl(fd,TIOCSPTLCK, &unlock)<0) if (errno!=EINTR) goto kaputt; - } - { - int ptyno; - while (ioctl(fd,TIOCGPTN,&ptyno)<0) if (errno!=EINTR) goto kaputt; - strcpy(buf,"/dev/pts/"); - __ltostr(buf+9,10,ptyno,10,0); - } - *aslave=open(buf,O_RDWR|O_NOCTTY); - if (*aslave<0) goto kaputt; - *amaster=fd; - if (name) strcpy(name,buf); - if (termp) - while (tcsetattr(*aslave,TCSAFLUSH,termp) && errno==EINTR); - if (winp) while (ioctl(*aslave, TIOCSWINSZ, winp) && errno==EINTR); - return 0; -kaputt: - close(fd); - return -1; -} |