implement some unix base code