Refreshed patch. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Speeds up compilation. Also fixed compilation without deprecated POSIX APIs. Signed-off-by: Rosen Penev <rosenp@gmail.com>