NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #4374 most downloaded on crates.io
Library for creating a new process detached from the controlling terminal (daemon)
Latest stable
0.11.0
Last release 1 months ago
23 Oct 2026
Release timing varies
gaps range from 2 weeks to 1.3 years
Some releases are documented
notes for 12 of 36 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
36 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
Full Changelog : 0.10.0...0.11.0
Full Changelog: 0.10.0...0.11.0
Full Changelog: https://github.com/immortal/fork/compare/0.10.0...0.11.0
children_are_waitable() observes owner SIGCHLD policy without changing it.
ensure_waitable_children() explicitly corrects inherited auto-reaping to
the default disposition at single-threaded startup, returning whether it
changed state and preserving valid installed handlers. Guard creation and
prepared spawn continue accepting auto-reaping owners; checked daemonization
and numeric-PID cleanup require waitability. No existing API implicitly resets
the owner's policy.ProcessGroupGuard::signal_group(signal, timeout) delivers through the helper
while it owns the unreaped anchor. Helper loss fails rather than signalling a
potentially reused numeric group; concurrent shared calls are serialized.
Non-reused u32 request IDs ensure success acknowledges this exact request;
stale replies are discarded and partial replies retained across deadlines.
Consuming reads detect EOF without platform-specific POLLHUP assumptions.
A timeout does not cancel a queued signal. macOS reports EPERM for an
anchor-only group.process_group_exists(group) reports whether any process, including an
unreaped zombie, is still a member of a process group. It performs the POSIX
null-signal check kill(-pgid, 0) and delivers nothing: success and EPERM
mean present, ESRCH means absent, EINTR is retried, and any other error is
returned. A supervisor can use it to wait, with its own deadline, until a
group it killed has drained before reporting cleanup complete.ProcessGroupGuard now pins its group. The out-of-group helper creates
the group's anchor and leaves it unreaped while the guard is armed, so the
zombie keeps the group, and its numeric ID, reserved after every workload
member has exited or left. The helper's owner-loss SIGKILL therefore always
reaches the group the guard reserved, never an unrelated group that reused
an emptied ID. disarm reaps the anchor and releases the pin. On macOS,
which skips zombie members, a signal to a group holding only the anchor
answers EPERM; the helper and process_group_exists treat that group as
present.signal_group delivery, failure after external helper loss, and
timeout while the helper is stopped; stopped-helper disarm and armed drop,
including an already consumed stop; and request framing. Harness-free
contracts cover an anchor stopped before it exits, descriptors above a
lowered soft limit, including forced fallback and descriptor exhaustion, and
successful guard/spawn creation and helper-mediated delivery under an
auto-reaping owner (SIGCHLD=SIG_IGN or SA_NOCLDWAIT), daemon rejection,
skipped unpinned cleanup signals, and isolation from every inherited application
handler, including non-SIGCHLD handlers that reap children, and from
registered pthread_atfork callbacks that reap the helper's children or
restore its auto-reaping. Denied inventory and denied waitid (ENOSYS,
EPERM, EACCES, EINVAL and EIO, plus a real seccomp EACCES filter)
contracts preserve successful sandboxed calls, and a seccomp filter that
permits only the C library's own fork form of clone, unused arguments
included, still permits guard creation.signal_group still works. Every owner-side cleanup PID signal checks policy
and an unreaped child pin first. Otherwise cleanup skips delivery: a stopped
helper cannot be resumed/killed, and a failed spawn may report an unfinished
child in cleanup_pending rather than kill it. Serialize policy and collection.SignalState
with InvalidInput. In 0.10.0 its required intermediate wait already failed
under that policy after starting a daemon, then attempted unsafe cleanup.
Earlier rejection removes no successful original-invoker outcome.waitid(WNOWAIT) until every signal is finished. When
waitid fails with any errno, exact-child consuming waits preserve the 0.10.0
success path: sandboxes deny it with ENOSYS, EPERM or EACCES, and a
kernel without WNOWAIT answers EINVAL. A consumed unexpected exit forbids PID/group delivery;
any surviving group is reported as an observation-only cleanup obligation.
Every cleanup observation propagates consumed events instead of waiting again.fork(3), whose pthread_atfork
handlers would otherwise run inside the helper after the anchor exists: a
parent handler could reap it or restore auto-reaping, releasing the pin while
the helper still signals the group, and a prepare handler could block on a
lock another owner thread held. Linux and Android on architectures whose raw
clone returns 0 in the child issue the system call the C library's own
fork uses, with the same flags and argument layout (glibc and bionic:
clone with CHILD_SETTID | CHILD_CLEARTID | SIGCHLD and zero unused
arguments; musl: SYS_fork, or clone(SIGCHLD) where none exists), so a
sandbox that filters these permits the anchor; only the per-process child
TID address differs from glibc's. FreeBSD uses
rfork, and every other target, including macOS, uses posix_spawn of
/usr/bin/true into a new group with owner-prepared attributes. After the
signal reset no foreign code runs in the helper, so only the helper can reap
its anchor.EACCES or the spawn error) instead
of a generic end of file.SIGKILL; the final reap still depends on kernel progress, not an
absolute time bound. The helper resets its own SIGCONT disposition, so these
new internal resume signals cannot invoke an inherited owner callback or
break a previously successful disarm. The owner's handler remains unchanged.poll; disarm's single-byte send fails immediately if the queue is
full, then closes the endpoint and performs bounded cleanup rather than
hanging before it. MSG_DONTWAIT alone is not enough: macOS ignores it on sends.close_range, then prefers
a pre-fork /dev/fd inventory. When directory access/iteration is unavailable,
descriptor-free fcntl(F_GETFD) probes above the soft limit to the finite hard
limit (on macOS capped by kern.maxfilesperproc; Linux hard limits cannot exceed
nr_open). FreeBSD skips its potentially incomplete inventory. Without a finite
ceiling, preparation fails closed. If F_GETFD cannot classify a descriptor,
closing uses the whole finite ceiling instead. Residual: a descriptor
opened before lowering the hard limit can exceed this fallback's ceiling;
preserve inventory/range access in that case. Serialize descriptor/limit changes.
After a successful range probe,
any actual range-close failure aborts the child operation instead of falling
back to an incomplete soft bound. A selective seccomp regression covers this.
The probe runs in the owner, so a sandbox must answer close_range with an
errno: a filter that kills on it now terminates the owner, where 0.10.0 called
it only in the child and that child died instead. Both fail the operation.setpgid through LD_PRELOAD.signal_process_group and process_group_exists refuse group 1 with
ErrorKind::InvalidInput: kill(-1, ..) is the POSIX broadcast to every
process the caller may signal, never a selector for one group.ESRCH.The public API is additive; CI compares 0.10.0 with --release-type minor instead
of treating a pre-1.0 minor bump as permission to skip compatibility checks.
The behavior audit against b567941 uses (a) unchanged successful contracts,
(b) fixes of unsafe or nonworking behavior, and (c) real breaks. The only
(c) items are two accepted deployment constraints of the callback-free anchor:
on posix_spawn anchor targets guard creation now executes /usr/bin/true
through the C library's spawn, and on the raw-fork Linux architectures the
anchor's child TID address differs from the one glibc's fork passes. An
environment that denies the first, or a seccomp filter pinned to glibc's exact
per-process address, fails creation where 0.10.0 succeeded. Observable safety
corrections and their consequences are explicit below.
| Surface | Classification and 0.11.0 behavior |
|---|---|
| Legacy fork/daemon/session/PID/wait/IPC/subreaper APIs; command/options/ID validation | (a) Existing implementation and accepted contracts unchanged. |
| Guard creation and prepared spawn with ignored SIGCHLD / SA_NOCLDWAIT | (a) Still succeed; no implicit owner-policy changes. The proposed up-front rejection was removed before release. |
| Checked daemon with an auto-reaping owner | (b) Reject before fork instead of failing its mandatory intermediate wait after creating a daemon and attempting unsafe kills. No old successful parent result is removed. |
signal_process_group(group=1, signal) |
(b) Reject the accidental kill(-1, ...) broadcast; it never correctly selected one group. Other valid group signals are unchanged. |
| Armed-group lifetime, topology and resources | (b) Keep the anchor until disarm to prevent reused-group kills. The anchor is now the helper's child, not the caller's. One direct helper remains before/after activation; two process-table entries persist while armed. An armed group stays present even without workloads. |
activate and normal disarm |
(b) Activation is bookkeeping rather than releasing the safety pin; timeout/repeat validation remains. Disarm releases the pin, so await group absence only afterwards. Successful workload-preserving disarm remains supported. |
| Stopped helper/anchor cleanup and owner SIGCONT handlers | (b) Resume/collect stopped helpers and kill only an unreaped stopped anchor; do not strand children or invoke inherited owner callbacks. Running-helper disarm with a custom owner SIGCONT handler, or denied resume delivery, still succeeds via the socket as in 0.10.0. |
| Helper CONT/KILL, failed-spawn and daemon cleanup | (b) Check owner policy and child ownership at delivery; never signal unpinned IDs. Return cleanup errors/obligations where prior termination was unsafe. Daemon failures retain the intermediate through signals when possible; consuming fallback failures skip delivery and report remaining obligations. |
waitid failing with any errno (ENOSYS, EPERM, EACCES, EINVAL, ...) |
(a) Successful checked daemonization and helper disarm still succeed via exact-child consuming waits as in 0.10.0; consumed terminal outcomes are preserved. |
Application pthread_atfork callbacks and guard creation |
(b) The anchor is created without fork callbacks, so callbacks no longer run inside the helper, where they could release the pin or deadlock. Guard creation now runs registered callbacks once, for the helper fork, instead of twice in the owner as 0.10.0's two owner forks did; owner-only callbacks keep their 0.10.0 success. |
Anchor creation on posix_spawn targets (macOS, NetBSD, OpenBSD, DragonFly, other Linux architectures) |
(c) Deployment constraint: creation executes /usr/bin/true once per guard; denying that exec, or its absence, fails creation with the spawn error where 0.10.0 needed no exec. On Linux architectures outside the raw-fork list a seccomp policy must also permit the C library's spawn process creation (clone3, or a vfork-style clone(CLONE_VM | CLONE_VFORK)), not only its fork. Linux/Android on the listed architectures and FreeBSD need no executable. |
Owner-side close_range probe |
(b) A filter that kills on close_range now terminates the owner instead of only the child; errno-returning filters keep the fallback. Both versions fail the operation under a killing filter. |
| Inherited helper callbacks | (b) All catchable handlers reset before anchor creation, not only SIGCHLD/CONT. Other ignored signals remain ignored. This removes unsafe callback execution in the helper, not owner-side handlers. Default termination can cause helper loss, which never permits unpinned delivery. |
| Unavailable ranges and denied/exhausted descriptor inventory | (a) Safe guard/spawn calls still succeed using descriptor-free hard-limit probing, including high descriptors above a lowered soft limit. No mandatory directory-open prerequisite remains. |
| Descriptor preparation and actual range close | (b) Fail closed if no finite fallback ceiling exists or real close_range fails; earlier apparent success could leak descriptors. Residual descriptors above a subsequently lowered hard limit require inventory/range access. |
| Guard startup reservation handshake | (b) Require the helper to report an actually reserved group under a bound; child-side close/reservation failure no longer returns an unusable guard as success, and returns the helper's errno. |
Anchor creation under clone-filtering seccomp policies (Linux/Android raw-fork architectures) |
(a) The raw anchor fork uses the same system call, flags and argument layout as the C library's own fork, unused arguments zero, so a policy filtering these that permitted 0.10.0's guard creation, which forked with the library, still permits it. |
| Child TID address of the raw anchor fork (Linux/Android raw-fork architectures) | (c) Deployment constraint: glibc and bionic pass their thread descriptor's TID field, the anchor a stack slot. Both are per-process addresses under address randomization, so only a filter built inside the running process, pinned to glibc's exact address, refuses the anchor. Matching it would require calling the library's own fork, whose callbacks the anchor must avoid. |
| Error stage types | (a) Existing enum variants and discriminants remain; no exhaustive-match break. |
| Newly detected failures and cleanup metadata | (b) Previously hidden safety failures now surface at existing SignalState/descriptor/handshake stages. Pending IDs are observations/collection obligations, not signal capabilities. |
| Nonblocking private owner socket | (b) Bound full-queue failure instead of hanging before cleanup. This descriptor is not public; 0.10.0's one-byte disarm had no public request API to fill it. |
New group probe, signal_group, policy query/correction |
(a) Additive only; old callers need not call them. New framing serializes request IDs, handles partial/stale replies/EOF, and never falls back to direct group delivery. |
| Test and CI infrastructure | (a) No library runtime change; stdio/cwd fixtures honor TMPDIR and compatibility CI explicitly checks an additive minor release. |
| Internal layout/debug text and dependency refresh | (a) No stable layout/debug-string/PID-value guarantee is removed. libc moves from 0.2.186 to 0.2.191 with unchanged exported types/contracts; helper topology/cost changes are classified above. |
These classifications do not claim identical process counts, timing, diagnostic text, syscall traces, or unsafe side effects. They preserve successful supported operations while removing the documented safety defects. Programs must not use a released group, a positive existence probe, or private-helper behavior as signal authority.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog : 0.9.1...0.10.0
Full Changelog: 0.9.1...0.10.0
Full Changelog: https://github.com/immortal/fork/compare/0.9.1...0.10.0
acquire_subreaper, release_subreaper, and is_subreaper let a supervisor
that is not PID 1 adopt orphaned descendants so the wait_any_* families can
observe and reap their terminal state. Acquisition and release are idempotent.
The role is process-global, is not inherited across fork, and is preserved
across exec.PR_SET_CHILD_SUBREAPER/PR_GET_CHILD_SUBREAPER and FreeBSD
support via PROC_REAP_ACQUIRE/PROC_REAP_RELEASE/PROC_REAP_STATUS. All
three functions return ErrorKind::Unsupported on other targets.fork
non-inheritance, exec preservation, and orphan adoption.io::Error::last_os_error.EBUSY (already a reaper) to success, and
is_subreaper excludes PID 1's implicit REAPER_STATUS_REALINIT role so the
query reflects only an explicitly acquired attribute, matching Linux.wait_any_* may report PIDs the supervisor did not spawn directly.Full Changelog : 0.9.0...0.9.1
Full Changelog: 0.9.0...0.9.1
Full Changelog: https://github.com/immortal/fork/compare/0.9.0...0.9.1
ProcessGroupGuard for fail-closed process-group owner loss, with a
startup anchor, explicit disarm, bounded helper cleanup, descriptor isolation,
running/stopped workload contracts, and an explicit session-escape boundary.MSG_NOSIGNAL, plus an
adaptive bounded helper wait which avoids both fixed startup delay and busy
polling.SIGKILL before and after workload startup, proving that helpers and the
workload disappear without Rust destructors, async cleanup, or inherited
descriptors.TERM, STOP, CONT, and KILL delivery cannot disable the
out-of-group helper. Invalid deadlines, failed exec, dead or stopped helpers,
closed standard descriptors, and deliberate session escape have bounded
regression contracts.rlim_t definitions.SIGABRT cases, and fail CI if an artifact or test process
survives the suite.0.9.0 callers remain source
compatible.Full Changelog : 0.8.0...0.9.0
Full Changelog: 0.8.0...0.9.0
Full Changelog: https://github.com/immortal/fork/compare/0.8.0...0.9.0
ProcessId and ProcessGroupId types.fork_process() and ProcessFork for a typed parent-side fork result.Signal with portable supervisor signal constants; signal zero is
not representable.ChildEvent::{Exited, Signalled, Stopped, Continued} collection through
blocking and nonblocking child-specific and any-child wait functions.EINTR retry.Pipe and SocketPair primitives for broker IPC and
exec-status handshakes, including descriptor flag and data-flow tests.PreparedCommand fork/exec API with precomputed arguments and
environment, bounded startup handshakes, explicit process groups, collision-
safe descriptor map/inherit/close actions, numeric identity transitions, and
unintended-descriptor closure.0.8.0 crate.Signal constant values and the
behavioral compatibility of the pre-broker fork/waitpid/waitpid_nohang
path, plus a runnable process_broker example.Full Changelog : 0.7.0...0.8.0
Full Changelog: 0.7.0...0.8.0
Full Changelog: https://github.com/immortal/fork/compare/0.7.0...0.8.0
wait_any() and wait_any_nohang() - Add non-breaking wrappers around
waitpid(-1, ...) for supervisor-style process management.
wait_any() blocks until any child terminates and returns (pid, status).wait_any_nohang() checks for any terminated child without blocking and
returns Ok(Some((pid, status))) or Ok(None).waitpid() and waitpid_nohang() signatures are unchanged.checked_daemon_pattern.rs,
demonstrating how to use a pre-fork pipe with the existing low-level
primitives when the launching process must observe setup success or failure.HashMap remains appropriate for
tracking multiple live children, but long-lived restart/history state should
use an application-owned monotonic id with PID as the current live lookup
handle. Updated supervisor examples to show this pattern.daemon(false, false) startup pitfall: relative paths are
resolved from /, and stdio/panic diagnostics are discarded through
/dev/null. PID/log/config paths should generally be absolute, or startup
should use nochdir = true, noclose = true, or a readiness pipe when
appropriate.close_fd()/close() on EINTR: the safe
portable behavior is to call close() once and treat EINTR as success,
not to retry.Full Changelog : 0.6.0...0.7.0
Full Changelog: 0.6.0...0.7.0
Full Changelog: https://github.com/immortal/fork/compare/0.6.0...0.7.0
close() no longer retries on EINTR — Previously, the internal close_retry helper
looped on EINTR, which is unsafe on all modern Unixes:
close() always releases the fd before returning EINTR.
Retrying can close an unrelated fd opened by another thread between attempts.close() + EINTR is
unspecified per POSIX 2008+ (Austin Group defect 529), so retrying is equally dangerous.close_retry to close_once and now calls close()
exactly once, treating both EINTR and EBADF as success — the same approach used by
Rust's std::fs::File::drop(), Go's runtime, and glibc internals.open() and dup2() in redirect_stdio() still correctly retry on EINTR,
as those calls do not release resources on interruption.daemon() return value documentation — Made it prominent that daemon() only ever
returns Ok(Fork::Child) or Err(...) to the caller; Ok(Fork::Parent(_)) is never
returned because both parent processes call _exit(0) internally. Added recommended
if let and match usage patterns to the doc comment. Updated #[must_use] message
to reflect this guarantee.test_daemon_never_returns_parent integration test confirming Fork::Parent is unreachabletest_close_retry_ok_and_ebadf to test_close_once_ok_and_ebadftty command string-matching in test_daemon_no_controlling_terminal with
portable open("/dev/tty") check (works reliably across Linux, macOS, and BSDs)test_getppid_after_parent_exits with a retry loop (up to 1s),
preventing flaky failures on slow CI systemsFull Changelog : 0.5.0...0.6.0
Full Changelog: 0.5.0...0.6.0
Full Changelog: https://github.com/immortal/fork/compare/0.5.0...0.6.0
getpgrp() signature changed - Now returns libc::pid_t directly instead of io::Result<libc::pid_t>
getpgrp() always succeeds per POSIX specification and cannot failgetpgrp()? to getpgrp()getpgrp().expect("...") to getpgrp()match getpgrp() { Ok(pgid) => ... } to let pgid = getpgrp();getpid()/getppid() patternsfork():
Fork enum documentation with helper method examplessignal() with sigaction() in EINTR teststest_getpgrp_returns_io_error_type to test_getpgrp_returns_pid_typeclose_fd and redirect_stdio now retry on EINTR for close/open/dup2, preventing spurious failures under signal-heavy conditions on Linux, macOS, and BSDstd::process::exit in post-fork parents with libc::_exit to avoid running non-async-signal-safe destructors, preventing undefined behavior between fork() and exec()CString::new() allocations with compile-time c"" string literals (Rust 2024 feature)
chdir() now uses c"/" instead of CString::new("/")redirect_stdio() now uses c"/dev/null" instead of CString::new("/dev/null")redirect_stdio() error handling logic explaining conditional cleanup of file descriptorschdir() function (346 lines)
c"" string literal implementationsetsid() (daemon pattern)`waitpid()` return type changed - Now returns io::Result instead of io::Result<()>
waitpid() return type changed - Now returns io::Result<libc::c_int> instead of io::Result<()>
WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, etc.waitpid(pid)? to let status = waitpid(pid)?; assert!(WIFEXITED(status));Fork enum
is_parent() - Check if this is the parent processis_child() - Check if this is the child processchild_pid() - Get child PID if parent, otherwise NoneFork now derives Hash, enabling use in HashMap and HashSet
supervisor.rs and supervisor_advanced.rs#[must_use] to critical functions to prevent accidental misuse
fork() - Must check if parent or childdaemon() - Must check daemon resultsetsid() - Must use session IDgetpgrp() - Must use process group IDwaitpid_nohang() function - Non-blocking variant of waitpid()
Ok(Some(status)) if child has exitedOk(None) if child is still runninggetpid() - Get current process ID (always succeeds, hides unsafe)getppid() - Get parent process ID (always succeeds, hides unsafe)WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG from libcuse fork::{waitpid, WIFEXITED, WEXITSTATUS} instead of separate libc importtests/waitpid_tests.rs - Exit codes, signals, error handling, and non-blocking waitstests/error_handling_tests.rs - Error paths and type verificationtests/pid_tests.rs - PID helper functions (getpid, getppid)tests/status_macro_tests.rs - Status macro re-exports#[inline] hints to thin wrapper functions (chdir, setsid, getpgrp, getpid, getppid)setsid() - Session creation examplegetpgrp() - Process group query examplegetpid() - Current PID examplegetppid() - Parent PID examplefork() with safety considerations (file descriptors, mutexes, async-signal-safety, signals, memory)waitpid() with status inspection exampleswaitpid_nohang() with polling patterns and process supervisor examplesdaemon() now performs the full double-fork, exiting the intermediate session leader so only the daemon continues
example_daemon.rs, example_touch_pid.rs) to reflect that only the daemon process returns Fork::ChildEINTR (signal interruption)
pid_t instead of i32 for better type safetydaemon() implementation using ? operator consistentlyis_parent(), is_child(), child_pid()RUST_TEST_THREADS=1) and use the latest checkout actionsupervisor.rs - Basic process supervisor examplesupervisor_advanced.rs - Production-ready supervisor with restart policiesmatch fork() {
Ok(Fork::Parent(child)) => {
waitpid(child)?; // Just waits, no status
}
Ok(Fork::Child) => exit(0),
Err(e) => eprintln!("Fork failed: {}", e),
}
use libc::{WIFEXITED, WEXITSTATUS};
match fork() {
Ok(Fork::Parent(child)) => {
let status = waitpid(child)?; // Returns status code
assert!(WIFEXITED(status), "Child should exit normally");
let exit_code = WEXITSTATUS(status);
println!("Child exited with code: {}", exit_code);
}
Ok(Fork::Child) => exit(0),
Err(e) => eprintln!("Fork failed: {}", e),
}
CRITICAL FIX: daemon() no longer vulnerable to file descriptor reuse bugs
io::Result instead of Result<T, i32>
fork() now returns io::Result<Fork> (was Result<Fork, i32>)daemon() now returns io::Result<Fork> (was Result<Fork, i32>)setsid() now returns io::Result<libc::pid_t> (was Result<libc::pid_t, i32>)getpgrp() now returns io::Result<libc::pid_t> (was Result<libc::pid_t, i32>)waitpid() now returns io::Result<()> (was Result<(), i32>)chdir() now returns io::Result<()> (was Result<libc::c_int, i32>)close_fd() now returns io::Result<()> (was Result<(), i32>)redirect_stdio() function that redirects stdio to /dev/null instead of closingdaemon() now uses redirect_stdio() instead of close_fd()errno values-1? operator, anyhow, thiserror, and other error handling cratesErrorKind variants for specific error handling.raw_os_error() provides access to underlying errno when neededFork enum now derives Debug, Clone, Copy, PartialEq, Eq for better usabilityredirect_stdio() function - Safer alternative to close_fd()tests/stdio_redirect_tests.rs)
close_fd()redirect_stdio() prevents fd reusedaemon() uses correct behaviorclose_fd() implementation using iterator patternclose_fd() documentation about fd reuse risksdaemon() no longer vulnerable to file descriptor reuse bugs
daemon(false, false) could get fd 0, 1, or 2println!, eprintln!, or panic would write to those files, corrupting them/dev/null, keeping fd 0,1,2 occupiedAdded comprehensive test coverage for getpgrp() function
getpgrp() function
src/lib.rs (test_getpgrp, test_getpgrp_in_parent)test_getpgrp_returns_process_group in tests/integration_tests.rscoverage recipe to .justfile for generating coverage reports with grcovUpdated Rust edition from 2021 to 2024
tests/ directory with comprehensive integration tests
daemon_tests.rs - 5 tests for daemon functionality (detached process, nochdir, process groups, command execution, no controlling terminal)fork_tests.rs - 7 tests for fork functionality (basic fork, parent-child communication, multiple children, environment inheritance, command execution, different PIDs, waitpid)integration_tests.rs - 5 tests for advanced patterns (double-fork daemon, setsid, chdir, process isolation, getpgrp)fork() - Multiple test scenarios including child executiondaemon() - Daemon pattern tested (double-fork with setsid)waitpid() - Proper parent-child synchronizationsetsid() - Session management and verificationgetpgrp() - Process group querieschdir() - Directory changes with verificationclose_fd() - File descriptor managementdaemon() directly
(which would call exit(0) and terminate the test runner)* Added waitpid(pid: i32)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.