Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 8, 2025

Bumps fork from 0.3.1 to 0.6.0.

Release notes

Sourced from fork's releases.

Release 0.6.0

Full Changelog: immortal/fork@0.5.0...0.6.0

Changelog

Sourced from fork's changelog.

0.6.0

Breaking Changes

  • getpgrp() signature changed - Now returns libc::pid_t directly instead of io::Result<libc::pid_t>
    • getpgrp() always succeeds per POSIX specification and cannot fail
    • Migration guide:
      • Change getpgrp()? to getpgrp()
      • Change getpgrp().expect("...") to getpgrp()
      • Change match getpgrp() { Ok(pgid) => ... } to let pgid = getpgrp();
    • Rationale: Aligns with POSIX.1 specification and matches getpid()/getppid() patterns
    • Verified on Linux, macOS, FreeBSD, OpenBSD per POSIX.1 specification
    • Updated all tests and documentation to reflect this guarantee

Improved

  • Enhanced documentation - Comprehensive improvements to library documentation
    • Added "Common Patterns" section with practical examples:
      • Process supervisor using HashMap with Fork
      • Inter-process communication via pipes
      • Daemon with PID file creation
    • Added "Safety and Best Practices" guidelines
    • Added detailed "Common Pitfalls and Safety Considerations" to fork():
      • Mutexes and locks (deadlock risks)
      • File descriptors (shared state issues)
      • Signal handlers (inheritance behavior)
      • Async-signal-safety between fork and exec
      • Memory usage (copy-on-write behavior)
    • Enhanced Fork enum documentation with helper method examples
    • Added "Platform Compatibility" information
  • Test quality improvements
    • Replaced deprecated signal() with sigaction() in EINTR tests
    • More portable signal handling for cross-platform compatibility
    • Renamed test_getpgrp_returns_io_error_type to test_getpgrp_returns_pid_type
    • Updated test README to reflect current test descriptions

Fixed

  • Documentation warnings - Resolved doctest warnings about main function wrapping
  • EINTR resilience - close_fd and redirect_stdio now retry on EINTR for close/open/dup2, preventing spurious failures under signal-heavy conditions on Linux, macOS, and BSD
  • Daemon exit safety - Replaced std::process::exit in post-fork parents with libc::_exit to avoid running non-async-signal-safe destructors, preventing undefined behavior between fork() and exec()

Code Quality

  • Modernized C string handling - Replaced runtime 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")
    • Benefits: Eliminated dead error handling code, zero runtime overhead, compile-time validation
    • No API changes, fully backward compatible
  • Enhanced code clarity - Added clarifying comments to redirect_stdio() error handling logic explaining conditional cleanup of file descriptors
  • Comprehensive test coverage - Added 12 dedicated tests for chdir() function (346 lines)
    • Tests idempotent behavior, process isolation, concurrent usage
    • Validates modern c"" string literal implementation
    • Tests integration with setsid() (daemon pattern)

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [fork](https://github.com/immortal/fork) from 0.3.1 to 0.6.0.
- [Release notes](https://github.com/immortal/fork/releases)
- [Changelog](https://github.com/immortal/fork/blob/main/CHANGELOG.md)
- [Commits](immortal/fork@0.3.1...0.6.0)

---
updated-dependencies:
- dependency-name: fork
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Dec 8, 2025
@github-actions github-actions bot enabled auto-merge (squash) December 8, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants