Our current patch is attached. We've added a test for res_ninit because we found it crashes on AIX 6.1. Also, Solaris has res_ninit and res_nclose but not res_ndestroy and we've modified it to use either.