Re: [RTnet-users] question about rt_socket->fd
Brought to you by:
bet-frogger,
kiszka
From: Jan K. <jan...@we...> - 2004-03-29 17:16:20
|
Hans-Peter Bock schrieb: > Hello, > > what does "bit 8-30: instance id" as comment in the definition of "fd" mean? > Convenience bits. :) If task A closes a file descriptor, the structure returns to the global pool of used sockets. If now task B creates a new socket, it may get the same structure (thus the same socket index), but the instance id will be incremented by one. This avoids that task A can mistakenly continue to use the old file descriptor. Well-written software will of course not - but in case... Jan |