Commit graph

14 commits

Author SHA1 Message Date
Andreas Kling
8c7b5b4de6 LibCore: Add immediate process termination helper
Add Core::Process::terminate_immediately() as the shared primitive
for terminating a process without running exit-time destructors. Use
_exit() on POSIX and TerminateProcess() on Windows.
2026-06-04 19:20:49 +02:00
Andreas Kling
8e85f5a0c4 LibWebView: Tie helper processes to browser lifetime
Add an opt-in Core::Process spawn mode that asks supported kernels to
terminate the child when its parent exits. On Linux, use a fork/exec
path for this mode so the child can install PR_SET_PDEATHSIG before
execing the helper process. The existing posix_spawn path remains in
place for other process launches.

Opt LibWebView helper processes into this mode so WebContent,
WebWorker, and other browser children do not survive a crashed or
exited UI process.
2026-05-26 20:40:25 +02:00
R-Goc
919f44f3a5 LibCore: Explicitly export symbols from LibCore
This patch adds explicit symbol export to LibCore. This leads to about
350 less symbols being exported.
2026-02-26 18:31:57 +01:00
Undefine
6fa705c730 LibCore: Mark Process::wait_for_termination as const
After removal of the of the disown mechanism this can be marked as
const, which in my opinion makes sense for this API.
2025-11-07 11:27:51 +01:00
Undefine
769bbe6021 LibCore: Remove unused KeepAsChild and disown mechanisms
Those went unused and did nothing on systems other than SerenityOS.
2025-11-07 11:27:51 +01:00
Undefine
7a9dd46a39 LibCore: Remove unused Process::set_name
It went unused and was a no-op on systems other than SerenityOS.
2025-11-07 11:27:51 +01:00
Undefine
3c0d787c53 LibCore: Remove unused working_directory parameter
This was unused and a no-op on systems other than SerenityOS.
2025-11-07 11:27:51 +01:00
stasoid
10db20a537 LibCore: Implement System::current_executable_path on Windows 2025-03-19 20:25:24 -06:00
rmg-x
aa4dcca0b2 LibCore/Process: Add DupFd file action
This commit provides a new file action allowing callers to provide a
`write_fd` that Process will "redirect" the child's stdin/stdout to.
2024-12-05 17:02:57 -07:00
stasoid
866609c682 LibCore: Make Process::wait_for_termination return exit code 2024-11-19 14:40:03 -07:00
stasoid
3468a83e45 LibCore: Port Process to Windows
Windows doesn't have a concept of zombie children, hence:
* `disown` not needed
* we need a process handle because otherwise if the process have ended
  by the time `wait_for_termination` is called
  its pid may be reassigned to other process
2024-11-19 14:40:03 -07:00
stasoid
4a731b3858 LibCore/Process: Make all spawn overloads return ErrorOr<Process> 2024-11-19 14:40:03 -07:00
stasoid
61d52c8a3f LibCore: Remove Process::spawn(StringView, ReadonlySpan<char const*>) 2024-11-19 14:40:03 -07:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibCore/Process.h (Browse further)