Added functionality for the close system call.