Portál AbcLinuxu, 26. října 2025 13:11
fcntl(filedescriptor, F_SETFL, FNDELAY);Pri prohlizeni man stranky jsem nikde nenasel co dela volba FNDELAY
F_SETFL
Set the file status flags to the value specified by arg. File access mode (O_RDONLY, O_WRONLY,
O_RDWR) and file creation flags (i.e., O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC) in arg are ignored. On
Linux this command can only change the O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME, and O_NONBLOCK flags.
Pritom prekladac nehlasi zadnou chybu. Dale jsem narazil na FASYNC, a dalsi.
Vysvetlil by mi to nekdo prosim?
cerpal jsem z http://www.linux.org/docs/ldp/howto/Serial-Programming-HOWTO/x115.html
Dekuji Vam
#include <bits/fcntl.h>. V tom je # define FNDELAY O_NDELAY. Dalej v asm-generic/fcntl.h je #define O_NDELAY O_NONBLOCK a pravdepodobne by sa dala vystopovat retaz includov, ktora tam vedie. Takze podla mna je to proste alias za O_NONBLOCK.
this->SerialPortDescriptor = open(this->PortPath, O_RDWR |
O_NOCTTY |
O_NDELAY |
O_NONBLOCK);kde je O_NONBLOCK, tak uz pomoci fcntl> nemusim modifikovat file descriptor s parametrem FNDELAY...
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.