struct flock {
...
short l_type; /* Type of lock: F_RDLCK,
F_WRLCK, F_UNLCK */
short l_whence; /* How to interpret l_start:
SEEK_SET, SEEK_CUR, SEEK_END */
off_t l_start; /* Starting offset for lock */
off_t l_len; /* Number of bytes to lock */
pid_t l_pid; /* PID of process blocking our lock
(F_GETLK only) */
...
};
So you're saying that the size of off_t, which appears from /usr/include to be a long, depends on the system I'm running on, and the only way to be sure is to compile a program which includes the definition of this type, and see what size it is in the result.
Does perl not know what this type is, as it's been compiled for the system on which it's running? If not (or there's no way for my script to get the information from the interpreter), I guess there's no portable pure perl solution? That's a bit of a pain - I need to lock files on NFS, flock doesn't work there and manually managing lockfiles seems a bit of a crummy solution.
On my systems, doing or not doing the eval consistenly makes the program work or not work - is this just some fluke side effect of uninitialised memory?
Thanks again,
Pete |