exec() syscall error handling
Posted: Sun May 04, 2014 8:34 am
I have come to the point where I have all the basic syscalls working, except for exec() and waitpid().
My main issue with exec is error handling: as it destructs most of the caller's resources, it can not recover from an error condition after the basic checks(ELF validation, permissions, argument/environment validation).
Free memory checks will be hard to implement as it will have to factor in the memory currently used by the caller and the fact that file reads might (will) put the caller in a in-syscall wait state during which another process might allocate memory needed by the process...
Does anyone know of a solution for this problem?
My main issue with exec is error handling: as it destructs most of the caller's resources, it can not recover from an error condition after the basic checks(ELF validation, permissions, argument/environment validation).
Free memory checks will be hard to implement as it will have to factor in the memory currently used by the caller and the fact that file reads might (will) put the caller in a in-syscall wait state during which another process might allocate memory needed by the process...
Does anyone know of a solution for this problem?