Re: O_RDONLY|O_TRUNC, truncate() semantics (was: Silly question...?

Bill Hawes (whawes@star.net)
Mon, 02 Feb 1998 08:00:11 -0500


Hans-Joachim Widmaier wrote:
>
> Peter Moulder:
> >
> > Hans-Joachim Widmaier <hjwidmai@foxboro.com> sent a month ago a patch
> > to allow i_op->truncate() to return error codes. I have to admit I
> > haven't applied his patch (it overlaps with another patch), but I'd
> > like for his patch to be applied. truncate() can fail, and the user
> > ought to be informed if it has failed. I think tht the Single Unix
> > Specification requires this: "Upon successful completion, ftruncate()
> > and truncate() return 0. Otherwise a -1 is returned, and errno is set
> > to indicate the error."
>
> I've redone the patch for 2.1.78 and sent it to Bill Hawes, who
> requested it from me (he wanted to change the truncate() functions
> to use dentries). Seems he hasn't got around doing it yet.

Yes, I haven't forgotten, but haven't done it yet either :-( One of the file
systems needs to have a dentry for the truncate operation, and there's no reason
not to do it.

Regards,
Bill