Re: ftruncate returning EPERM on vfat filesystem

Richard Henderson (rth@twiddle.net)
Sun, 7 Jan 2001 13:03:11 -0800


On Sun, Jan 07, 2001 at 01:55:15PM +0000, Alan Cox wrote:
> > + return -EPERM;
>
> To stop a case where the fs gets corrupted otherwise. You can change that to
> return 0 which is more correct but most not remove it.

While I suppose "0" is covered under "the result is unspecified", I
would suggest that EINVAL is a better choice: "The filedes argument
does not refer to a file on which this operation is possible".

The reason being that the normal reason for an extending ftruncate
is so that you can mmap it and not get SIGBUS for accessing past the
end of the file.

r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/