Re: OFF-Topic glibc behavior

Henning P. Schmiedehausen (hps@tanstaafl.de)
22 Oct 1998 11:50:11 +0200


root@chaos.analogic.com (Richard B. Johnson) writes:

>On Wed, 21 Oct 1998 grant@torque.net wrote:

>> > The following code will write "Hello World!" to the screen on
>> > the following platforms:
>>
>> On the screen or in /tmp/foo ???
>>
>The problem was originally shown to me, and the text was written by
>one who didn't want to be flamed, using 'stdout'. Thinking that 'stdout'
>might be special, I opened a file explicitly, finding the same behavior.
>I did not change the text.

Most surely, the 'struct FILE' you see (and get defined in the
includes) is just half the truth. You often have two structure
definition, one visible to the world and another one, private with
maybe much more members than the public one. You get a FILE * pointer
and can access the 'public known' fields but there are more fields
hidden beneath.

I'm not sure whether you must be allowed to copy this but this would
surely explain the behaviour. Treat FILE * as an opaque type with no
information about the size of the underlying structure.

Kind regards
Henning


>> Is this the simplest explanation ? Seems to me that the FILE structure
>> could contain (directly or indirectly) a self-referential pointer.
>> Moving it would certainly break something ...
>>
>> But what does this have to do with the kernel ?

>Read above.

>Cheers,
>Dick Johnson
> ***** FILE SYSTEM WAS MODIFIED *****
>Penguin : Linux version 2.1.123 on an i586 machine (66.15 BogoMips).
>Warning : It's hard to remain at the trailing edge of technology.

>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.rutgers.edu
>Please read the FAQ at http://www.tux.org/lkml/

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen --             hps@tanstaafl.de
TANSTAAFL! Consulting - Unix, Internet, Security      

Hutweide 15 Fon.: 09131 / 50654-0 "There ain't no such D-91054 Buckenhof Fax.: 09131 / 50654-20 thing as a free Linux"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/