Pete Batard wrote: > > I don't understand why the fd integer is allocated using _open() > > instead of allocating it in the library using a simple counter or so. > > Because "using a simple counter or so" requires more lines of codes to > ensure we are emulating fd allocation than a one line call to the OS.
Ok, thanks for the explanation. > In terms of stability and ease of implementation, you really can't beat > _existing_ OS call returning the data you need. I agree where one knows what one doesn't know, but it's likely to cause problems where one doesn't know what one doesn't know. > As a matter of fact, if I had not used an OS call to return an fd, and > added my own custom implementation, I'm pretty you would have been the > one to ask "Since you need an fd-like thingy, why don't use just use an > OS call that returns an actual fd?" It's interesting how you put words in my mouth and try to make me defend something I've never said. Let's focus on the code: Do you have some ideas for skipping the fd-like thingy all together? //Peter ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel