This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: mmap stdio breaks GNU ld
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Mark Brown <bmark at us dot ibm dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: 21 Jan 2002 19:34:40 -0800
- Subject: Re: mmap stdio breaks GNU ld
- References: <C17D3BB6-0EB2-11D6-8321-0030657603C6@us.ibm.com>
- Reply-to: drepper at redhat dot com (Ulrich Drepper)
Mark Brown <bmark@us.ibm.com> writes:
> Here is a quote from ISO C 99:
ISO C cannot possibly talk about file descriptors. The wording used
"file position indicator" refers to the possibly abstract position in
the file which is maintained by computations of the buffer pointer and
possibly an offset variable:
+-----------------------------------------------------------------+
| |
+-----------------------------------------------------------------+
^ ^ ^
| | |
readstart readptr readend
Given this the file position if computed as
offset - (readend - readptr)
where 'offset' is the offset of the byte following the last byte in
the buffer. 'offset' can also be the actual file descriptor position.
And note, this was always in the case even with the file descriptor
not being at the beginning of the file.
The only standard which could talk about file descriptors is
Unix/POSIX and the fopen man page says nothing.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------