From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 27 May 2013 23:36:34 -0400 To: 9fans@9fans.net Message-ID: <8f008febcaa2ce9f150ee6a4d3bf1c9f@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] ape ip6, warnings, etc. Topicbox-Message-UUID: 5d3d67d6-ead8-11e9-9d60-3106f5b1d025 to support jeff sickel doing a new port of the python tip to plan 9, using the native ssl and ssh implementations, it looked like a good idea to do two things 1. modernize socket handling, 2. turn on warnings. (a late addition, based on chasing some bugs that should have been noticed by the linker.) for 1, the noticable changes are, - added struct addrinfo, getaddrinfo, freeaddrinfo, getnameinfo, gai_strerror, inet_ntop, inet_pton. - definition of EALREADY and ECONNRESET - sockets support ip6. for 2, the noticable changes are, - inttypes.h has moved from /sys/include/ape to /$M/include/ape so uintptr_t can be properly sized on both 32- and 64-bit machines - _C99_SNPRINTF_EXTENSION created two type signatures for snprintf, so it had to go. since c99 is now 10 years old, the c99 extension is assumed. - segattach, segbrk, rendezvous, _SEGATTACH, _SEGBRK, and _RENDEZVOUS were convered to use void* and not int. on 64-bit machines, crashes had been observed for addresses above 0x80000000 due to truncation and sign extension. - now declares the prototype as per posix extern void (*signal(int, void (*)(int)))(int); - the following functions were also declared int gethostname(char *, size_t); extern void rerrstr(char*, unsigned int); /* gross */ extern int getfields(char*, char**, int, int, char*); /* gross */ the source is at /n/atom/plan9. if you have an atom install, you can pull as glenda and get the new stuff. a new iso will be out shortly. this may be of use if you are porting other ape stuff. note that the 9atom ape currently has a bit of skew with the distribution, which should be fixed soon. 9atom ... - declares ssize_t pread(int, void*, size_t, off_t), and pwrite(). - Runes are 21-bits so that awk plays nicely with others. i don't think this should cause any trouble, i certainly would appreciate any reports of how this works for folks, especially with contrib packages. as the intention is to continue to hone this for inclusion in the distribution so we can all have python imported from the tip. enjoy - erik