libc: fork/execve improvements

- Close FDs marked with the close-on-execve flag
  (needed for 'make', which sets the flag for the pipe-in
  FD of forked children)
- Update binary name on execve to use as ROM for subsequent fork
- Enable vfork as an alias for fork (needed by make)
- Purge line buffers for output streams during execve because they
  may be allocated at the allocation heap, which does not survive
  the execve call.
- Consider short-lived processes that may exit while the parent still
  blocks in the fork call.

With these changes, the website generator of genodians.org works without
the need for the Noux runtime.

Issue #3578
This commit is contained in:
Norman Feske
2019-12-03 18:38:07 +01:00
committed by Christian Helmuth
parent d1cf216384
commit b7fbe65ff2
10 changed files with 137 additions and 70 deletions

View File

@ -104,6 +104,14 @@ namespace Libc {
File_descriptor *find_by_libc_fd(int libc_fd);
/**
* Return any file descriptor with close-on-execve flag set
*
* \return pointer to file descriptor, or
* nullptr is no such file descriptor exists
*/
File_descriptor *any_cloexec_libc_fd();
void generate_info(Genode::Xml_generator &);
};