01872d06d9
Pipes are unnamed FIFOs, so they're basically the same. The difference here is that open() blocks on opening a FIFO until both ends of the FIFO are opened. This helps us in synchronizing the two threads and thus ensuring that that the read() system call deep inside QFile does, indeed, block. We see this with strace -T on Linux: [pid 662956] openat(AT_FDCWD, "/run/user/1000/tst_qfile_fifo.2575572361", O_RDONLY|O_CLOEXEC <unfinished ...> ... aux starts up ... [pid 662957] prctl(PR_SET_NAME, "QThread") = 0 <0.000004> [pid 662957] openat(AT_FDCWD, "/run/user/1000/tst_qfile_fifo.2575572361", O_WRONLY|O_CLOEXEC <unfinished ...> [pid 662956] <... openat resumed>) = 4 <0.000133> [pid 662957] <... openat resumed>) = 6 <0.000011> [pid 662957] clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=500000000}, <unfinished ...> [pid 662956] read(4, <unfinished ...> [pid 662957] <... clock_nanosleep resumed>NULL) = 0 <0.500183> [pid 662957] write(6, "\2", 1) = 1 <0.000033> [pid 662956] <... read resumed>"\2", 1) = 1 <0.500311> Pick-to: 6.6 Change-Id: I63b988479db546dabffcfffd1766d7a48819b149 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> |
||
---|---|---|
.. | ||
resources | ||
stdinprocess | ||
.gitattributes | ||
.gitignore | ||
CMakeLists.txt | ||
copy-fallback.qrc | ||
dosfile.txt | ||
forCopying.txt | ||
forRenaming.txt | ||
noendofline.txt | ||
rename-fallback.qrc | ||
testfile.txt | ||
testlog.txt | ||
tst_qfile.cpp | ||
two.dots.file |