removed dependency on POSIX libary