Re: OFF-Topic glibc behavior

Ulrich Drepper (drepper@cygnus.com)
21 Oct 1998 12:52:06 -0700


"Richard B. Johnson" <root@chaos.analogic.com> writes:

> Glibc doesn't check the contents of the FILE structures, just
> the addresses and since it "knows" the pointer received was not
> one it provided, it generates signal 11 on its own. Is this
> REALLY what is supposed to happen? After all, the function call
> did get a perfectly valid pointer to the required structure.

No, it's not a perfect pointer. You cannot have a variable of type
FILE. FILE has to be treated as an opaque type. The actual
definition is only there to allow some optimizations. But the object
pointed to by the pointer returned by fopen() is not really of type
FILE. There is a lot of hidden information and you would not copy
this over with the copy to an object of type FILE.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- 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/