functions to be used by system calls