🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.usg
Article #287

Re: Bug with multiple stdio streams on one descriptor, FIX

#287
From: kwh
Date: Fri, 28 Mar 1986 19:56
20 lines
1534 bytes
In article <562@stride.stride.UUCP> stride!bruce (Bruce Robertson) writes:
>The problem is, the table is referenced like this:
>	_bufendtab[(p)->_file]
>where `p' is your FILE pointer.  This is wrong.  What you really
>want to do is reference the table like this:
>	_bufendtab[(p) - &_iob[0]]
>which associates slots in the table of pointers with slots in
>the table of _iob structures.

This assumes that all objects of type FILE are in the _iob[] array.
This is not necessarily the case; e.g. there is an auto variable of type
FILE (not FILE*) in sprintf(); there may be others.

Are you sure that having two streams on one descriptor is legal?  Is there
any documentation that explicitly permits or forbids it?

Now, the *real* question.  Why is _bufendtab[] in a separate array, rather
than being another field in the FILE structure where it seems to belong?

Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint
Technical Details
Message-ID: <674@bentley.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!mhuxf!mhuxi!mhuhk!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!ll-xn!topaz!bentley!kwh
References: <562@stride.stride.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!mhuxf!mhuxi!mhuhk!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!ll-xn!topaz!bentley!kwh
From: kwh@bentley.UUCP
Newsgroups: net.bugs.usg
Subject: Re: Bug with multiple stdio streams on one descriptor, FIX
Message-ID: <674@bentley.UUCP>
Date: Fri, 28-Mar-86 14:56:11 EST
Article-I.D.: bentley.674
Posted: Fri Mar 28 14:56:11 1986
Date-Received: Tue, 1-Apr-86 06:43:22 EST
References: <562@stride.stride.UUCP>
Organization: AT&T Bell Laboratories, Liberty Corner
Lines: 20