'\" te .\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved .\" 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. .\" 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. .\" 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] .TH tell 3C "28 Jan 1998" "SunOS 5.11" "Standard C Library Functions" .SH NAME tell \- return a file offset for a file descriptor .SH SYNOPSIS .LP .nf #include \fBoff_t\fR \fBtell\fR(\fBint\fR \fIfd\fR); .fi .SH DESCRIPTION .sp .LP The \fBtell()\fR function obtains the current value of the file-position indicator for the file descriptor \fIfd\fR. .SH RETURN VALUES .sp .LP Upon successful completion, \fBtell()\fR returns the current value of the file-position indicator for \fIfd\fR measured in bytes from the beginning of the file. .sp .LP Otherwise, it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error. .SH ERRORS .sp .LP The \fBtell()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEBADF\fR\fR .ad .RS 13n .rt The file descriptor \fIfd\fR is not an open file descriptor. .RE .sp .ne 2 .mk .na \fB\fBEOVERFLOW\fR\fR .ad .RS 13n .rt The current file offset cannot be represented correctly in an object of type \fBoff_t\fR. .RE .sp .ne 2 .mk .na \fB\fBESPIPE\fR\fR .ad .RS 13n .rt The file descriptor \fIfd\fR is associated with a pipe or FIFO. .RE .SH USAGE .sp .LP The \fBtell()\fR function is equivalent to \fBlseek(\fR\fIfd\fR\fB, 0, SEEK_CUR)\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBlseek\fR(2), \fBattributes\fR(5)