added errno feature in all wrappers. check if correct