¡@

Home 

c++ Programming Glossary: fcntl

How to simulate “Press any key to continue?”

http://stackoverflow.com/questions/1449324/how-to-simulate-press-any-key-to-continue

stdio.h #include termios.h #include unistd.h #include fcntl.h int kbhit void struct termios oldt newt int ch int oldf tcgetattr.. ~ ICANON ECHO tcsetattr STDIN_FILENO TCSANOW newt oldf fcntl STDIN_FILENO F_GETFL 0 fcntl STDIN_FILENO F_SETFL oldf O_NONBLOCK.. TCSANOW newt oldf fcntl STDIN_FILENO F_GETFL 0 fcntl STDIN_FILENO F_SETFL oldf O_NONBLOCK ch getchar tcsetattr STDIN_FILENO..

How to handle execvp(…) errors after fork()?

http://stackoverflow.com/questions/1584956/how-to-handle-execvp-errors-after-fork

can be adapted for this purpose. #include errno.h #include fcntl.h #include stdio.h #include string.h #include sys wait.h #include.. pid_t child if pipe pipefds perror pipe return EX_OSERR if fcntl pipefds 1 F_SETFD fcntl pipefds 1 F_GETFD FD_CLOEXEC perror.. perror pipe return EX_OSERR if fcntl pipefds 1 F_SETFD fcntl pipefds 1 F_GETFD FD_CLOEXEC perror fcntl return EX_OSERR switch..

High delay in RS232 communication on a PXA270

http://stackoverflow.com/questions/4667141/high-delay-in-rs232-communication-on-a-pxa270

Force read call to block if no data available int f fcntl mPhysicalComPort F_GETFL 0 f ~O_NONBLOCK fcntl mPhysicalComPort.. int f fcntl mPhysicalComPort F_GETFL 0 f ~O_NONBLOCK fcntl mPhysicalComPort F_SETFL f Get the current options for the port.....

BSD Sockets - How to use non-blocking sockets?

http://stackoverflow.com/questions/6699488/bsd-sockets-how-to-use-non-blocking-sockets

char buf 80 void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags 1 fcntl socket F_SETFL flags O_NONBLOCK.. int flags flags fcntl socket F_GETFL 0 assert flags 1 fcntl socket F_SETFL flags O_NONBLOCK int main int agrc char argv.. sockaddr name void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags 1 fcntl socket F_SETFL flags O_NONBLOCK..

Using select() for non-blocking sockets

http://stackoverflow.com/questions/6715736/using-select-for-non-blocking-sockets

sockaddr name void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags 1 fcntl socket F_SETFL flags O_NONBLOCK.. int flags flags fcntl socket F_GETFL 0 assert flags 1 fcntl socket F_SETFL flags O_NONBLOCK get sockaddr IPv4 or IPv6 void.. sockaddr name void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags 1 fcntl socket F_SETFL flags O_NONBLOCK..

Blocking socket returns EAGAIN

http://stackoverflow.com/questions/735249/blocking-socket-returns-eagain

m_Socket set the socket as nonblocking IO const int flags fcntl sock F_GETFL 0 fcntl sock F_SETFL flags O_NONBLOCK errno 0 we.. as nonblocking IO const int flags fcntl sock F_GETFL 0 fcntl sock F_SETFL flags O_NONBLOCK errno 0 we connect but it will.. 1 done We change the socket options back to blocking IO if fcntl sock F_SETFL flags 1 return 1 return 0 The idea is that I set..

Using std:fstream how to deny access (read and write) to the file

http://stackoverflow.com/questions/839856/using-stdfstream-how-to-deny-access-read-and-write-to-the-file

or LockFileEx . On Linux there is flock lockf and fcntl as the previous commenter said . If you are using MSVC you can..