Commit Briefs
libthread: simplify
Now that everything uses pthreads and pthreadperthread, can delete various conditionals, all the custom context code, and so on. Also update documents. Fixes #355.
lib9: add close
More preparation for opendir.
lib9: make a p9frexp function wrapping system frexp
Under certain conditions it looks like frexp gets #defined to something else on macOS during system headers, which then breaks the declaration in libc.h.
lib9: remove getcallerpc implementations
These make no sense and are not really needed at all. Add a best-effort attempt to get at the gcc/clang macro in lib9.h, but if it fails, no big deal. Fixes #324.
lib9/dial: add support for IPv6
The function p9dialparse() returns the host as a sockaddr_storage structure instead of a u32int, to be able to handle both IPv4 and IPv6 addresses. Because the sockaddr_storage structure also handle port numbers and Unix path names, there is no longer need to set them in the calling functions. However, these values are still returned for convenience. The sockaddr_in and sockaddr_un structures have been replaced by sockaddr_storage to handle Unix, IPv4 and IPv6 sockets. Names and addresses are resolved using either gethostbyname() or getaddrinfo() functions. The getaddrinfo() function is documented in RFC2553 and standardized since POSIX.1-2001. It supports both IPv4 and IPv6 addresses. The gethostbyname() function is deprecated since POSIX.1-2008. However, some libc implementations don't handle getaddrinfo() properly, thus we preferred to try gethostbyname() first. I've tried to preserve most of the old code logic to prevent from surprising or unwanted behavior. R=rsc http://codereview.appspot.com/6255068
libc.h: update comment for 32-bit Rune
http://codereview.appspot.com/116097