A library that makes it easy to re-execute the current process

Why not just use std::env::current_exe()?

reexec

.

Why not just use std::env::current_exe()?

Advantages of reexec:

  • Most OSes have multiple fallback methods (e.g. may work on Linux even if /proc isn't mounted)
  • Sometimes able to re-execute the original program even if it has been replaced (only works on certain platforms, and only when /proc is mounted)
  • Often able to avoid allocating memory
  • Has an unsafe lower-level interface which some programs may find helpful

Disadvantages of reexec:

  • OS support is slightly more limited (see below)

Supported OSes

Tested in CI:

  • Linux (glibc and musl)
  • macOS
  • Windows
  • FreeBSD

Verified to work on:

  • NetBSD
  • OpenBSD (but see below)

Untested:

  • Solaris/IllumOS
  • DragonFlyBSD
  • Redox

OS-specific notes

OpenBSD

OpenBSD doesn't provide a straightforward way to get the executable path, so this is done by looking at the first command-line argument. Hence this will only work if argv[0] is an absolute or relative path, not just a program name.

std::env::current_exe() does this too. However, reexec actually verifies that the path specified in argv[0] refers to the current executable; std does not. (The disadvantage of this is that reexec will not be able to get the executable path if the program has been replaced.)

Information - Updated Jun 15, 2022

Stars: 0
Forks: 0
Issues: 0

Repositories & Extras

Rust library for Self Organising Maps (SOM)

Add rusticsom as a dependency in Cargo

Rust library for Self Organising Maps (SOM)

Rust library for parsing configuration files

The 'option' can be any string with no whitespace

Rust library for parsing configuration files

Rust library for the Pimoroni Four Letter pHAT

This library aims to port ht16k33 (or rather a fork, as of right now) so credit goes to ht16k33-diet

Rust library for the Pimoroni Four Letter pHAT

Rust library for emulating 32-bit RISC-V

This library can execute instructions against any memory and register file that implements

Rust library for emulating 32-bit RISC-V

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

You can use actix-web as a backend instead of hyper

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

enabling remote control support for embedded project

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

open up an issue on this repository and let us know

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

Rust library for parsing COLLADA files

Notice: This library is built around files exported from Blender 2

Rust library for parsing COLLADA files

Rust library for low-level abstraction of MIPS32 processors

This project is licensed under the terms of the MIT license

Rust library for low-level abstraction of MIPS32 processors
Facebook Instagram Twitter GitHub Dribbble
Privacy