Hi,
Using Ubuntu 24.04 with libc 6.
Trying to use blocking fwrite on a file, that is fully accessible by other programs, and after the first write any subsequent attempt fails with (11). Resource temporarily unavailable. Stream is always open. Relevant code:
fd = open("new.dmp", O_CREAT | O_TRUNC | O_WRONLY); res = fcntl(fd, F_GETFL); printf("res= %d, nonblock: %d\n", res, res&O_NONBLOCK);
Output:
res= 32769, nonblock: 0 if ((cnt = fwrite(awrite, 8, left, dumpfp)) != left) { int res = fcntl(fd, F_GETFL); error(log, "Short save of samples to \"new.dmp\". Asked for %d, got %d (%d). %s." "(%d, %d)\n", 0, FL, LN, FN, left, cnt, errno, strerror(errno), res, res&O_NONBLOCK); return(FAIL); }
Output:
Short save of data to "new.dmp".Asked for 1024, got 0 (11). Resource temporarily unavailable.(32769, 0) -> ls -la *.dmp -rw-rw-r-- 1 user user 8235 May 5 23:17 new.dmp
Any ideas?
TIA
Nikos