lkml.org 
[lkml]   [2001]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ftruncate not extending files?
On Fri, 2 Mar 2001, bert hubert wrote:

> > ftruncate() and truncate() may extend a file but they are not required to
> > do so.
>
> I would've sworn, based on the fact that I saw people do it, that ftruncate
> was a legitimate way to extend a file - especially useful in combination
> with mmap().

lseek and write does it already and need not to duplicate with truncate().
Using truncate() to extend a file sounds very strange.

About mmap() SUSv2 says:

If the size of the mapped file changes after the call to mmap() as a
result of some other operation on the mapped file, the effect of
references to portions of the mapped region that correspond to added or
removed portions of the file is unspecified.
^^^^^^^^^^^
What do you mean about "useful in combination with mmap()" ?


> I don't really care where it is done, in glibc or in the kernel - but let's
> honor this convention and not needlessly break code.

Let's don't connive to ill-formed programs.

--

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

\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.084 / U:2.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site