c++ Programming Glossary: stdin_fileno
using QTextStream to read stdin in a non-blocking fashion http://stackoverflow.com/questions/1271784/using-qtextstream-to-read-stdin-in-a-non-blocking-fashion looks like this QSocketNotifier pNot new QSocketNotifier STDIN_FILENO QSocketNotifier Read this connect pNot SIGNAL activated int.. QString str forever fd_set stdinfd FD_ZERO stdinfd FD_SET STDIN_FILENO stdinfd struct timeval tv tv.tv_sec 0 tv.tv_usec 0 int ready..
Read a password from std::cin http://stackoverflow.com/questions/1413445/read-a-password-from-stdcin hStdin mode #else struct termios tty tcgetattr STDIN_FILENO tty if enable tty.c_lflag ~ECHO else tty.c_lflag ECHO void tcsetattr..
How to simulate “Press any key to continue?” http://stackoverflow.com/questions/1449324/how-to-simulate-press-any-key-to-continue void struct termios oldt newt int ch int oldf tcgetattr STDIN_FILENO oldt newt oldt newt.c_lflag ~ ICANON ECHO tcsetattr STDIN_FILENO.. oldt newt oldt newt.c_lflag ~ ICANON ECHO tcsetattr STDIN_FILENO TCSANOW newt oldf fcntl STDIN_FILENO F_GETFL 0 fcntl STDIN_FILENO.. ICANON ECHO tcsetattr STDIN_FILENO TCSANOW newt oldf fcntl STDIN_FILENO F_GETFL 0 fcntl STDIN_FILENO F_SETFL oldf O_NONBLOCK ch getchar..
Is there a replacement for unistd.h for Windows (Visual C)? http://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c to call e.g. closesocket . #define ssize_t int #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 should be..
Linux C++ run and communicate with new process http://stackoverflow.com/questions/4127567/linux-c-run-and-communicate-with-new-process 1 STDOUT_FILENO close out_fd 1 close in_fd 1 dup2 in_fd 0 STDIN_FILENO close in_fd 0 Now launch your child whichever way you want see..
BOOST ASIO - How to write console server http://stackoverflow.com/questions/5210796/boost-asio-how-to-write-console-server a separate thread use a posix stream_descriptor and assign STDIN_FILENO to it. Use async_read and handle the requests in the read handlers... io_service io_service _input io_service _input.assign STDIN_FILENO void read async_read _input boost asio buffer _command sizeof..
Using select() for non-blocking sockets http://stackoverflow.com/questions/6715736/using-select-for-non-blocking-sockets etc. Here's what I would do FD_SET sock read_flags FD_SET STDIN_FILENO read_flags .. snip .. if FD_ISSET STDIN_FILENO read_flags fgets.. FD_SET STDIN_FILENO read_flags .. snip .. if FD_ISSET STDIN_FILENO read_flags fgets out len stdin This will monitor stdin and read..
Linux 3.0: Executing child process with piped stdin/stdout http://stackoverflow.com/questions/9405985/linux-3-0-executing-child-process-with-piped-stdin-stdout continues here redirect stdin if dup2 aStdinPipe PIPE_READ STDIN_FILENO 1 perror redirecting stdin return 1 redirect stdout if dup2..
|