[LTP] [PATCH 2/2] readdir02: use invalid DIR stream descriptor
Fri Feb 15 09:40:49 CET 2019
Sorry for late reply, since it was China holidays in past two weeks.
On Thu, Feb 7, 2019 at 8:51 PM Cyril Hrubis <firstname.lastname@example.org> wrote:
> > AFAICT that changing an variable of one data type into another, and
> > the worst harmness is to loss of information in the variable so we'd
> > better avoid that. But in this test we only need a invalid DIR* for
> > readdir() tesst, it does *not* really care about the pointer content I
> > guess?
> Not at all, both FILE and DIR are typedefs to C structures, which are
> just chunks of memory, by doing this you are basically passing random
> data to the call because all it does when the C library gets the fd from
> these strucutres is that it takes bytes from at some offest in the chunk
> of memory. There are no abstract types, methods or objects in C, just
> chunks of memory.
Ok, I got the point, thanks for the explanation. I will help to rewrite a
new patch for readdir02 deleting.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ltp