代码拉取完成,页面将自动刷新
/* Copyright 2014-present Facebook, Inc.
* Licensed under the Apache License, Version 2.0 */
#include "watchman.h"
static inline int which_fd(w_stm_t stm);
static int stdio_close(w_stm_t) {
return -1;
}
static int stdio_read(w_stm_t stm, void *buf, int size) {
return read(which_fd(stm), buf, size);
}
static int stdio_write(w_stm_t stm, const void *buf, int size) {
return write(which_fd(stm), buf, size);
}
static void stdio_get_events(w_stm_t, w_evt_t*) {
w_log(W_LOG_FATAL, "calling get_events on a stdio stm\n");
}
static void stdio_set_nonb(w_stm_t, bool) {}
static bool stdio_rewind(w_stm_t) {
return false;
}
static bool stdio_shutdown(w_stm_t) {
return false;
}
static struct watchman_stream_ops stdio_ops = {
stdio_close,
stdio_read,
stdio_write,
stdio_get_events,
stdio_set_nonb,
stdio_rewind,
stdio_shutdown,
NULL
};
static struct watchman_stream stm_stdout = {
(void*)&stdio_ops,
&stdio_ops
};
static struct watchman_stream stm_stdin = {
(void*)&stdio_ops,
&stdio_ops
};
static inline int which_fd(w_stm_t stm) {
if (stm == &stm_stdout) {
return STDOUT_FILENO;
}
return STDIN_FILENO;
}
w_stm_t w_stm_stdout(void) {
return &stm_stdout;
}
w_stm_t w_stm_stdin(void) {
return &stm_stdin;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。