Import 54a20ab41aadcb81 from illumos.