From: Ben Gras Date: Mon, 13 Feb 2006 12:53:50 +0000 (+0000) Subject: Added truncate/ftruncate manpage. X-Git-Tag: v3.1.2a~367 X-Git-Url: http://zhaoyanbai.com/repos/pkcs11-list.html?a=commitdiff_plain;h=f8e186e8b1df8d37914d2651dfe51c65e3641282;p=minix.git Added truncate/ftruncate manpage. --- diff --git a/man/man2/truncate.2 b/man/man2/truncate.2 new file mode 100644 index 000000000..4102e6d82 --- /dev/null +++ b/man/man2/truncate.2 @@ -0,0 +1,30 @@ +.TH TRUNCATE 2 "Feb 13, 2006" +.UC 4 +.SH NAME +truncate, ftruncate \- truncate a file to a specified length (may extend) +.SH SYNOPSIS +.ft B +.nf +#include + +int truncate(char *filename, off_t length); +int ftruncate(int fd, off_t length); +.fi +.ft R +.SH DESCRIPTION +.B Truncate +causes the file +.B filename +to be set to the length +.B length +causing data after that size to be lost. If the file is set to a +length larger than the current file size, the new region can be +written to but reads as zeroes. There will be no disk blocks reserved +for it. This is a hole. +.PP +.B Ftruncate +does the same thing as +.B truncate +but operates on a file descriptor instead of a filename. +.SH "SEE ALSO +.BR fcntl (2)