Added missing header and added casts. Signed-off-by: Rosen Penev <rosenp@gmail.com>
glibc needs an extra header included. Also cast time values to 64-bit in preparation for 64-bit time_t for 32-bit platforms. Signed-off-by: Rosen Penev <rosenp@gmail.com>