Improve portability of the kernel
Close connection