summaryrefslogtreecommitdiffstats
path: root/man2/truncate.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/truncate.2')
-rw-r--r--man2/truncate.226
1 files changed, 13 insertions, 13 deletions
diff --git a/man2/truncate.2 b/man2/truncate.2
index 02a12e5..13ebec0 100644
--- a/man2/truncate.2
+++ b/man2/truncate.2
@@ -12,7 +12,7 @@
.\" Modified 2002-04-06 by Andries Brouwer <aeb@cwi.nl>
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
-.TH truncate 2 2023-03-30 "Linux man-pages 6.05.01"
+.TH truncate 2 2023-10-31 "Linux man-pages 6.7"
.SH NAME
truncate, ftruncate \- truncate a file to a specified length
.SH LIBRARY
@@ -21,16 +21,16 @@ Standard C library
.SH SYNOPSIS
.nf
.B #include <unistd.h>
-.PP
+.P
.BI "int truncate(const char *" path ", off_t " length );
.BI "int ftruncate(int " fd ", off_t " length );
.fi
-.PP
+.P
.RS -4
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.RE
-.PP
+.P
.BR truncate ():
.nf
_XOPEN_SOURCE >= 500
@@ -38,7 +38,7 @@ Feature Test Macro Requirements for glibc (see
|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
|| /* glibc <= 2.19: */ _BSD_SOURCE
.fi
-.PP
+.P
.BR ftruncate ():
.nf
_XOPEN_SOURCE >= 500
@@ -58,20 +58,20 @@ or referenced by
to be truncated to a size of precisely
.I length
bytes.
-.PP
+.P
If the file previously was larger than this size, the extra data is lost.
If the file previously was shorter, it is extended, and
the extended part reads as null bytes (\[aq]\e0\[aq]).
-.PP
+.P
The file offset is not changed.
-.PP
+.P
If the size changed, then the st_ctime and st_mtime fields
(respectively, time of last status change and
time of last modification; see
.BR inode (7))
for the file are updated,
and the set-user-ID and set-group-ID mode bits may be cleared.
-.PP
+.P
With
.BR ftruncate (),
the file must be open for writing; with
@@ -148,7 +148,7 @@ The named file resides on a read-only filesystem.
.TP
.B ETXTBSY
The file is an executable file that is being executed.
-.PP
+.P
For
.BR ftruncate ()
the same errors apply, but instead of things that can be wrong with
@@ -197,7 +197,7 @@ and
to be used to extend a file beyond its current length:
a notable example on Linux is VFAT.
.\" At the very least: OSF/1, Solaris 7, and FreeBSD conform, mtk, Jan 2002
-.PP
+.P
On some 32-bit architectures,
the calling signature for these system calls differ,
for the reasons described in
@@ -212,13 +212,13 @@ POSIX.1-2001,
.\" POSIX.1-2001 also has
.\" .BR truncate (),
.\" as an XSI extension.
-.\" .LP
+.\" .P
.\" SVr4 documents additional
.\" .BR truncate ()
.\" error conditions EMFILE, EMULTIHP, ENFILE, ENOLINK. SVr4 documents for
.\" .BR ftruncate ()
.\" an additional EAGAIN error condition.
-.PP
+.P
The original Linux
.BR truncate ()
and