[En-Nut-Discussion] Get file size vom VIRTUALDEVICE (was: Register overwriting in interrupted code)

Harald Kipp harald.kipp at egnite.de
Sun Jul 25 11:57:27 CEST 2004


Oliver,

At 11:14 25.07.2004 +0200, you wrote:

>What do you think of expanding the VITRUALDEVICE structure by a 'vdv_size'
>function, which returns the number of bytes in receive buffer. Doing so, we
>can use _filesize() or even kbhit() on TCP sockets and other virtual
>devices.

Actually ioctl() should be used, but I see the point. Updating
a counter in VIRTUALDEVICE is much less hassle then trying
to retrieve the number of bytes in a NETBUF queue or whatever.

When changing the structure, what about adding both sizes,
input and output buffer?

What about the type? IMHO, size_t should be sufficient. Or does
anybody see the need for an unsigned long?



>My TCP code is nearly finished. I just found the bug, why some sockets
>remain in CLOSED state and were not destroyed. After some testing today, I
>will commit the code finally to cvs HEAD.

Again my previous post was unnecessary. Yes, to CVS HEAD please. :-)

Harald




More information about the En-Nut-Discussion mailing list