Guest User

Untitled

a guest
Aug 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "uv.h"
  3. static void cb(uv_write_t* req, int status) {
  4. printf("Hello from Callback.\n");
  5. uv_unref(uv_default_loop());
  6. }
  7. int main() {
  8. uv_tty_t tty;
  9. uv_write_t req;
  10. int ret = uv_tty_init(uv_default_loop(), &tty, 1, 0);
  11. uv_buf_t bufs[] = {uv_buf_init("Hello UV!\n",10)};
  12. ret = uv_write(&req, (uv_stream_t*)&tty, bufs, 1, cb);
  13. uv_run(uv_default_loop());
  14. return 0;
  15. }
Add Comment
Please, Sign In to add comment