Re: enumeration function?

From: Simon Richter (Simon.Richter@phobos.fachschaften.tu-muenchen.de)
Date: Fri Aug 04 2000 - 15:08:50 EST


On Fri, 4 Aug 2000, Matthew Dharm wrote:

> It occurs to me that I could really use some sort of enumeration function
> in the linux kernel. That is, a function that I could call which would
> give me a unique number for enumerating devices.

[code example]

For devices, this is easy, since you can expect a computer not to have
more devices than fit physically. Other people will use this facility for
enumerating other things, so it might happen that the counter wraps
around. Detecting this isn't hard, but it adds a case where this function
can fail. Handling this failure at some place in the kernel where it may
be time-critical is difficult (for example, you assign unique numbers to
TCP connections passing your firewall. How do you react if you're out of
unique numbers [and this will happen if your system is large enough]).

Just my Euro 0.02.

   Simon

-- 
PGP public key available from http://phobos.fs.tum.de/pgp/Simon.Richter.asc
 Fingerprint: 10 62 F6 F5 C0 5D 9E D8  47 05 1B 8A 22 E5 4E C1
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!

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



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:13 EST