Subject: Re: ftruncate: ENOSPC?
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 06/26/2006 18:22:28
In article <6CA8F6CB-A75B-4D6F-96C6-1B5E4B98600F@shagadelic.org>,
Jason Thorpe  <thorpej@shagadelic.org> wrote:
>
>On Jun 24, 2006, at 11:04 AM, Paul Drynoff wrote:
>
>> Hello.
>>
>> Accoring to truncate(2) ftruncate should not return
>> ENOSPC, but if looking at FFS implementation,
>> it can return ENOSPC if can not allocate space for last byte.
>> And I can easily reproduce this on my NetBSD 2.x box.
>
>Well, if it can't allocate the space, what else would you expect it  
>to do?

Well, opengroup does not list this as a valid error code to return,
neither do our man pages. The easy fix is to document this. The
difficult fix is to make sure it never returns ENOSPC...

christos