9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / tell.3c
blobc5bb2f33b794a879428cffb52b0b0c951dfdcaa0
1 '\" te
2 .\"  Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TELL 3C "Jan 28, 1998"
7 .SH NAME
8 tell \- return a file offset for a file descriptor
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <unistd.h>
14 \fBoff_t\fR \fBtell\fR(\fBint\fR \fIfd\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBtell()\fR function obtains the current value of the file-position
21 indicator for the file descriptor \fIfd\fR.
22 .SH RETURN VALUES
23 .sp
24 .LP
25 Upon successful completion, \fBtell()\fR returns the current value of the
26 file-position indicator for \fIfd\fR measured in bytes from the beginning of
27 the file.
28 .sp
29 .LP
30 Otherwise, it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
31 .SH ERRORS
32 .sp
33 .LP
34 The \fBtell()\fR function will fail if:
35 .sp
36 .ne 2
37 .na
38 \fB\fBEBADF\fR\fR
39 .ad
40 .RS 13n
41 The file descriptor \fIfd\fR is not an open file descriptor.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fBEOVERFLOW\fR\fR
48 .ad
49 .RS 13n
50 The current file offset cannot be represented correctly in an object of type
51 \fBoff_t\fR.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fBESPIPE\fR\fR
58 .ad
59 .RS 13n
60 The file descriptor \fIfd\fR is associated with a pipe or FIFO.
61 .RE
63 .SH USAGE
64 .sp
65 .LP
66 The \fBtell()\fR function is equivalent to \fBlseek(\fR\fIfd\fR\fB, 0,
67 SEEK_CUR)\fR.
68 .SH ATTRIBUTES
69 .sp
70 .LP
71 See \fBattributes\fR(5) for descriptions of the following attributes:
72 .sp
74 .sp
75 .TS
76 box;
77 c | c
78 l | l .
79 ATTRIBUTE TYPE  ATTRIBUTE VALUE
81 MT-Level        MT-Safe
82 .TE
84 .SH SEE ALSO
85 .sp
86 .LP
87 \fBlseek\fR(2), \fBattributes\fR(5)