Ported Stas' AIX hack to 5.5