Code POSIX compliant and portable to BSD like systems