From: Brian G. <ge...@ai...> - 2004-11-17 22:23:23
|
hi, This is a general note on the use of replacement functions in Player drivers. Some useful functions are not available on all platforms. Sometimes we can get by without them, but sometimes we really need them. For cases like this, Player includes implementations of some functions (usually stolen from glibc) that are compiled into a replacement library and are used when those functions are not available in the system libs. Currently, Player's replacement lib has implementations of: - alphasort() - dirname() - poll() - scandir() - cfmakeraw() If you use any of these functions, then you should #include "replace.h" (it's in $(top_srcdir)/replace); where necessary, the replacement functions will be used. For poll() in particular, do NOT #include <sys/poll.h>, because it's not available everywhere. Just #include "replace.h" and you can call poll() as usual. In general, we don't know when a replacement function is necessary until somebody reports a broken compile on another system. But you can help by always reading the "CONFORMING TO" section of the man page for the function in question. The best case is when the function conforms to POSIX. When you have a choice, always use POSIX-endorsed functions, because they're available pretty much everywhere. And if you know you're using a function that's not widely available, let me know so that we work out a replacement mechanism. brian. -- Brian P. Gerkey ge...@ai... Stanford AI Lab http://ai.stanford.edu/~gerkey |