[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Truncated Email.
From: |
Lyndon Nerenberg |
Subject: |
Re: [Nmh-workers] Truncated Email. |
Date: |
Sun, 6 Mar 2016 14:39:31 -0800 |
> On Mar 6, 2016, at 10:31 AM, Ken Hornstein <address@hidden> wrote:
>
>>> (although I see that it uses creat() to truncate a file, rather than
>>> ftruncate(); that seems weird to me?).
>>
>> And it's a bug it closes creat's FD, freeing the lock.
>
> Oh, yes, that happens! Good catch!
Is this an instance of fcntl's completely braindead locking behaviour? To
quite FreeBSD fcntl(2):
> This interface follows the completely stupid semantics of System V and
> IEEE Std 1003.1-1988 (``POSIX.1'') that require that all locks associated
> with a file for a given process are removed when any file descriptor for
> that file is closed by that process. This semantic means that applica-
> tions must be aware of any files that a subroutine library may access
This is why I wanted to outlaw the use of fcntl() locking altogether.
Unfortunately, sometimes even that isn't good enough. Solaris' flock(3) calls
fcntl(2) internally. (I should see if Illumos has finally fixed this.)
You can't make this stuff up.
--lyndon
- [Nmh-workers] Truncated Email., (continued)
- [Nmh-workers] Truncated Email., Ralph Corderoy, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Ralph Corderoy, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Ken Hornstein, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Ralph Corderoy, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Ken Hornstein, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Ralph Corderoy, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Ken Hornstein, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Robert Elz, 2016/03/07
- Re: [Nmh-workers] Truncated Email.,
Lyndon Nerenberg <=
- Re: [Nmh-workers] Truncated Email., Ralph Corderoy, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Lyndon Nerenberg, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Robert Elz, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Lyndon Nerenberg, 2016/03/06
- Re: [Nmh-workers] Truncated Email., Andy Bradford, 2016/03/06