summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
authorPaul Osborne <osbpau@gmail.com>2016-11-01 23:13:02 -0500
committerPaul Osborne <osbpau@gmail.com>2016-11-01 23:13:02 -0500
commit173f2acec8d0276b6f4c9ebc5f0cfceeafbec741 (patch)
treea0fcab4a80ae32eddcb03b6f1c1bc8501383301f /src/unistd.rs
parent2f220fce96184e8624b5534153f3182b61bb05c5 (diff)
downloadnix-173f2acec8d0276b6f4c9ebc5f0cfceeafbec741.zip
unistd: doc updates based on review comments
These make the language consistent in the 3rd person, fix a few minor mistakes, and remove some superflous prose. Signed-off-by: Paul Osborne <osbpau@gmail.com>
Diffstat (limited to 'src/unistd.rs')
-rw-r--r--src/unistd.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index 8966ea12..31b55f83 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -375,9 +375,9 @@ pub fn execv(path: &CString, argv: &[CString]) -> Result<Void> {
/// [execve(2)#errors](http://man7.org/linux/man-pages/man2/execve.2.html#ERRORS)
/// for a list of potential problems that maight cause execv to fail.
///
-/// Both `::nix::unistd::execv` and `::nix::unistd::execve` take as arguments a
-/// slice of `::std::ffi::CString`s for `args` and `env`. Each element in
-/// the `args` list is an argument to the new process. Each element in the
+/// `::nix::unistd::execv` and `::nix::unistd::execve` take as arguments a slice
+/// of `::std::ffi::CString`s for `args` and `env` (for `execve`). Each element
+/// in the `args` list is an argument to the new process. Each element in the
/// `env` list should be a string in the form "key=value".
#[inline]
pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<Void> {
@@ -396,10 +396,10 @@ pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<Void>
/// [exec(3)](http://man7.org/linux/man-pages/man3/exec.3.html)).
///
/// See `::nix::unistd::execve` for additoinal details. `execvp` behaves the
-/// sme as execv except that it will examine the `PATH` environment variables
+/// same as execv except that it will examine the `PATH` environment variables
/// for file names not specified with a leading slash. For example, `execv`
-/// would not work if I specified "bash" for the path argument, but `execvp`
-/// would assuming that I had a bash executable on my `PATH`.
+/// would not work if "bash" was specified for the path argument, but `execvp`
+/// would assuming that a bash executable was on the system `PATH`.
#[inline]
pub fn execvp(filename: &CString, args: &[CString]) -> Result<Void> {
let args_p = to_exec_array(args);
@@ -423,17 +423,14 @@ pub fn execvp(filename: &CString, args: &[CString]) -> Result<Void> {
/// 2. Parent process exits
/// 3. Child process continues to run.
///
-/// There are a couple options here whose names and meaning can be a bit
-/// confusing, so we'll describe the behavior for each state.
-///
-/// For `nochdir`:
+/// `nochdir`:
///
/// * `nochdir = true`: The current working directory after daemonizing will
/// be the current working directory.
/// * `nochdir = false`: The current working directory after daemonizing will
/// be the root direcory, `/`.
///
-/// For `noclose`:
+/// `noclose`:
///
/// * `noclose = true`: The process' current stdin, stdout, and stderr file
/// descriptors will remain identical after daemonizing.