2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
10 #include <kern_util.h>
19 static void grantpt_cb(void *arg
)
21 struct grantpt_info
*info
= arg
;
23 info
->res
= grantpt(info
->fd
);
29 struct grantpt_info info
;
32 fd
= open("/dev/ptmx", O_RDWR
);
35 printk(UM_KERN_ERR
"get_pty : Couldn't open /dev/ptmx - "
41 initial_thread_cb(grantpt_cb
, &info
);
45 printk(UM_KERN_ERR
"get_pty : Couldn't grant pty - "
46 "errno = %d\n", -info
.err
);
50 if (unlockpt(fd
) < 0) {
52 printk(UM_KERN_ERR
"get_pty : Couldn't unlock pty - "
53 "errno = %d\n", errno
);