source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/misc/pty.c@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 595 bytes
Line 
1#include <stdlib.h>
2#include <sys/ioctl.h>
3#include <stdio.h>
4#include <fcntl.h>
5#include <errno.h>
6#include "libc.h"
7#include "syscall.h"
8
9int posix_openpt(int flags)
10{
11 return open("/dev/ptmx", flags);
12}
13
14int grantpt(int fd)
15{
16 return 0;
17}
18
19int unlockpt(int fd)
20{
21 int unlock = 0;
22 return ioctl(fd, TIOCSPTLCK, &unlock);
23}
24
25int __ptsname_r(int fd, char *buf, size_t len)
26{
27 int pty, err;
28 if (!buf) len = 0;
29 if ((err = __syscall(SYS_ioctl, fd, TIOCGPTN, &pty))) return -err;
30 if (snprintf(buf, len, "/dev/pts/%d", pty) >= len) return ERANGE;
31 return 0;
32}
33
34weak_alias(__ptsname_r, ptsname_r);
Note: See TracBrowser for help on using the repository browser.