Inconsistent error 75 using fchmod on shared memory file descriptors (x64)
My C application initialization loops 14 times allocating 12MB blocks of shared memory, assigns each to the video group, and grants RW permissions to video members. This works for the first about 7-10 blocks (a little different each run), after which fchmod starts returning error 75 - "Value too large for defined data type"! The same steps work when run in a bash script. I tried inserting a 2 milli-sec delay and a fsync in before the call to fchmod to emulate running from a script, but the problem still occurs. The values passed to fchmod are a file descriptor (varied from 5 to 19 in this test) and the octal permissions (0664). This leaves me with three questions:
1> Which value does the error message refer to? The fd, the permissions, or some internal value I can't see?
2> Why does the fchmod call work properly for the first several calls then suddenly start failing after about ten calls?
3> What can I do in my code to get this working?
> I am using Fedora 15 with a 126.96.36.199-5.fc15.x86_64 kernel with 12 GB RAM.
> With the x32 kernel 12 MB shm buffers are difficult to get to work.
> I've tried increasing the maximum per process limit on file descriptors to 32K but it did not help with this problem.