2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
10 #include "kern_constants.h"
11 #include "kern_util.h"
21 static void grantpt_cb(void *arg
)
23 struct grantpt_info
*info
= arg
;
25 info
->res
= grantpt(info
->fd
);
31 struct grantpt_info info
;
34 fd
= open("/dev/ptmx", O_RDWR
);
37 printk(UM_KERN_ERR
"get_pty : Couldn't open /dev/ptmx - "
43 initial_thread_cb(grantpt_cb
, &info
);
47 printk(UM_KERN_ERR
"get_pty : Couldn't grant pty - "
48 "errno = %d\n", -info
.err
);
52 if (unlockpt(fd
) < 0) {
54 printk(UM_KERN_ERR
"get_pty : Couldn't unlock pty - "
55 "errno = %d\n", errno
);