_XOPEN_SOURCE >= 520 (XNS 5.2), either rigging it for that version or replacing the (wrong) test for >= 500.