Illumos #4101, #4102, #4103, #4105, #4106, #4730, #4756

Please see individual commits. This stack pulls in a number of patches, and aligns us more closely with the illumos code.