[Patch]: Create Global Privilege
Pierre A. Humblet
Thu Dec 4 05:29:00 GMT 2003
At 10:26 AM 12/2/2003 +0100, you wrote:
>On Mon, Dec 01, 2003 at 10:55:46PM -0500, Pierre A. Humblet wrote:
>> Also, the utmp/wtmp functions use mutexes to insure safe access.
>> That creates two problems, particularly on servers:
>> - When users have private copies of Cygwin with different mounts,
>> there can be several utmp/wtmp files. Having a global mutex isn't
>> - If the utmp/wtmp files are unique, a user may not be have the
>> privilege to create a global mutex, so that no mutual protection
>> is achieved.
>> Both problems could be solved very simply by using file locking.
>> Should I do that some day?
>Sure, go ahead.
Getting there, but I have questions.
1) Because I am inside cygwin, I assume I should use explicitly
struct __flock64 and fcntl64().
Or should I call fcntl_worker directly?
2) Why does struct __flock64 have a "_off_t l_start"
but a "_off64_t l_len" (in cygwin/types.h) ?
3) If I use fcntl64, shouldn't I use lseek64 as well?
But then why does the rest of the utmp/wtmp code use lseek?
More information about the Cygwin-patches