AW: [En-Nut-Discussion] Get file size vom VIRTUALDEVICE (was:Register overwriting in interrupted code)
Oliver Schulz
olischulz at web.de
Sun Jul 25 12:53:24 CEST 2004
Hi Harald,
>
> 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.
I didn't think of an additional counter, but an additional function, that
returns the input buffer size...
But, another idea (more advanced :-): What about defining some global ioctl
commands, that are independent of the underlying hardware.
In uart.h the ioctl definitions start from 0x100, so it makes sense for me
to start the global ioctl commands at 0x0, for example. (The ioctl commands
from wlan.h must then be adjusted.)
So we can use then the ioctl function to retrieve these additional kinds of
information (for now input and output buffer sizes) about a virtual devices.
Do you see any difficulties with that?
> What about the type? IMHO, size_t should be sufficient. Or does
> anybody see the need for an unsigned long?
Same as my opinion.
Cheers,
Oliver.
More information about the En-Nut-Discussion
mailing list