[comp.std.unix] 1003.1 section 8.2.3

roland@ai.mit.edu (Roland McGrath) (07/29/89)

From: Roland McGrath <roland@ai.mit.edu>

Can someone please explain everything in section 8.2.3 before section 8.2.3.1
of 1003.1 to me in English?


Volume-Number: Volume 16, Number 61

gwyn@brl.arpa (Doug Gwyn) (08/01/89)

Newsgroups: comp.std.unix
From: gwyn@brl.arpa (Doug Gwyn)

In article <366@longway.TIC.COM> Roland McGrath <roland@ai.mit.edu> writes:
>Can someone please explain everything in section 8.2.3 before section 8.2.3.1
>of 1003.1 to me in English?

This section, which was added very late in the drafting/balloting process,
seems to be trying to say that you can lose synchronization between file
position indicators associated with multiple "handles" (FILEs or fds) on
the same file, and that an explicit seek or fseek is required to restore
the correct implementation-internal file position state.

Volume-Number: Volume 16, Number 62

std-unix@longway.TIC.COM (Moderator, John S. Quarterman) (08/10/89)

From: apple!cs.utexas.edu!ucsd.edu!hp-sdd!hpfcdc.HP.COM!donn (Donn Terry)


Doug's explanation is right; in simple English it says that you have
to let go of one handle (properly) before taking up the next.  It puts
a requirement on the implementation to assure that in fact you can let
go of one properly, and a requirement on the user that it be done this way.

Many existing implementations made it impossible to do this because the
"let go" semantics were not there, and several (nameless) pieces of
well-known software butchered or worked around stdio (or provided their
own) because of this problem.  The ballot objection upon which this change
was based came from the author of one of these (nameless) programs.

Granted, it's not in English itself; to be precise enough to plug all the
holes that we found in trying to write it, it ended up looking like something
a lawyer would choke on.

As in writing programs, you can't always kick back and say "DWIM" ("do
what I mean") in a standard.  (Part of the problem here is that everyone
THINKS they know what stdio does, and most implementations didn't do it.)

Donn Terry
Chair 1003.1

These opinions are my own and in no way represent an official position on
the meaning of 1003.1.  (That to keep the lawyers happy.)

Volume-Number: Volume 16, Number 63