Go to the documentation of this file.
27 #include <sys/ioctl.h>
30 static int read_count;
34 static char slab[1024];
41 fprintf(
stdout,
"got data %d\n", ++read_count);
57 fd =
open(
"/dev/tty", O_RDONLY);
59 fprintf(
stderr,
"Cannot open /dev/tty as read-only: %s\n", strerror(errno));
70 str =
"got some input\n"
71 "with a couple of lines\n"
72 "feel pretty happy\n";
74 r = ioctl(fd, TIOCSTI,
str +
i);
93 struct sockaddr_in
addr;
110 fd =
open(
"/dev/tty", O_RDONLY);
112 fprintf(
stderr,
"Cannot open /dev/tty as read-only: %s\n", strerror(errno));
124 str =
"got some input\n"
125 "with a couple of lines\n"
126 "feel pretty happy\n";
128 r = ioctl(fd, TIOCSTI,
str +
i);
#define ARRAY_SIZE(array)
static void read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
static void alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
UV_EXTERN void uv_unref(uv_handle_t *)
UV_EXTERN int uv_tcp_bind(uv_tcp_t *handle, const struct sockaddr *addr, unsigned int flags)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
UV_EXTERN uv_loop_t * uv_default_loop(void)
UV_EXTERN int uv_read_start(uv_stream_t *, uv_alloc_cb alloc_cb, uv_read_cb read_cb)
UV_EXTERN int uv_tcp_init(uv_loop_t *, uv_tcp_t *handle)
#define MAKE_VALGRIND_HAPPY()
#define TEST_FILE_LIMIT(num)
UV_EXTERN int uv_tty_init(uv_loop_t *, uv_tty_t *, uv_file fd, int readable)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:30