31 #include <sys/ioctl.h>
33 #if defined(__MVS__) && !defined(IMAXBEL)
53 static int isreallyatty(
int file) {
57 if (!rc && errno !=
EBADF)
62 #define isatty(fd) isreallyatty(fd)
71 #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
75 #elif defined(__APPLE__)
78 result =
ioctl(
fd, TIOCPTYGNAME, &dummy) != 0;
79 #elif defined(__NetBSD__)
94 static devmajor_t pts = NODEVMAJOR;
96 if (pts == NODEVMAJOR) {
97 pts = getdevmajor(
"pts", S_IFCHR);
98 if (pts == NODEVMAJOR)
107 if (!S_ISCHR(
sb.st_mode))
111 if (
major(
sb.st_rdev) == NODEVMAJOR)
114 result = (pts ==
major(
sb.st_rdev));
118 result = ptsname(
fd) ==
NULL;
147 while (saved_flags == -1 && errno ==
EINTR);
149 if (saved_flags == -1)
163 if (
type == UV_TTY) {
184 if (
r < 0 &&
r != UV_EINVAL) {
206 #if defined(__APPLE__)
215 while (
r == -1 && errno ==
EINTR);
234 #if defined __sun || defined __MVS__
259 if (tcgetattr(
fd, &
tty->orig_termios))
303 while (
err == -1 && errno ==
EINTR);
333 if (S_ISCHR(
s.st_mode))
336 if (S_ISFIFO(
s.st_mode))
337 return UV_NAMED_PIPE;
339 if (!S_ISSOCK(
s.st_mode))
347 if (getsockname(
file, &sa, &
len))
355 #if defined(_AIX) || defined(__DragonFly__)
361 return UV_NAMED_PIPE;
367 return UV_NAMED_PIPE;
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset fstat
static static sync static getppid static getegid const char static filename ioctl
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags fcntl
void skip(file *in, unsigned n)
assert(limit<=UINT32_MAX/2)
static struct sockaddr static addrlen static backlog const void static flags void flags
#define UV_SPINLOCK_INITIALIZER
int uv__open_cloexec(const char *path, int flags)
int uv__dup2_cloexec(int oldfd, int newfd)
int uv__stream_open(uv_stream_t *, int fd, int flags)
#define uv__stream_fd(handle)
void uv__stream_init(uv_loop_t *loop, uv_stream_t *stream, uv_handle_type type)
static int orig_termios_fd
static struct termios orig_termios
static int uv__tty_is_slave(const int fd)
uv_handle_type uv_guess_handle(uv_file file)
void uv_tty_set_vterm_state(uv_tty_vtermstate_t state)
static uv_spinlock_t termios_spinlock
int uv_tty_get_winsize(uv_tty_t *tty, int *width, int *height)
int uv_tty_set_mode(uv_tty_t *tty, uv_tty_mode_t mode)
int uv_tty_get_vterm_state(uv_tty_vtermstate_t *state)
static void uv__tty_make_raw(struct termios *tio)
int uv_tty_init(uv_loop_t *loop, uv_tty_t *tty, int fd, int unused)
int uv_tty_reset_mode(void)
@ UV_HANDLE_BLOCKING_WRITES
static const z80_opcode fd[]