Skip to content

Commit

Permalink
Link to POSIX.1-2024 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
magicant committed Jan 24, 2025
1 parent 869e6ec commit a197290
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion yash-builtin/src/common/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! Syntax Guidelines] and support non-standard syntax extensions such as long
//! options and options after operands.
//!
//! [POSIX Utility Syntax Guidelines]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02
//! [POSIX Utility Syntax Guidelines]: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap12.html#tag_12_02
//!
//! # Usage
//!
Expand Down
2 changes: 1 addition & 1 deletion yash-cli/src/startup/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn prepare_input<'s: 'i + 'e, 'i, 'e>(
// It makes virtually no sense to make it blocking here
// since we will be doing non-blocking reads anyway,
// but POSIX requires us to do it.
// https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/sh.html#tag_20_117_06
// https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html#tag_20_110_06
_ = system.get_and_set_nonblocking(Fd::STDIN, false);
}

Expand Down
22 changes: 11 additions & 11 deletions yash-env/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub enum Type {
/// Special built-in
///
/// Special built-in utilities are built-ins that are defined in [POSIX XCU
/// section 2.14](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14).
/// section 2.15](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_15).
///
/// They are treated differently from other built-ins.
/// Especially, special built-ins are found in the first stage of command
Expand All @@ -48,24 +48,24 @@ pub enum Type {

/// Standard utility that can be used without `$PATH` search
///
/// Mandatory built-ins are built-ins that are listed in step 1d of [Command
/// Search and Execution](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01)
/// in POSIX XCU section 2.9.1.
/// Mandatory built-ins are utilities that are listed in [POSIX XCU section
/// 1.7](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap01.html#tag_18_07).
/// In POSIX, they are called "intrinsic utilities".
///
/// Like special built-ins, mandatory built-ins are not subject to `$PATH`
/// in command search; They are always found regardless of whether there is
/// a corresponding external utility in `$PATH`. However, mandatory
/// built-ins can still be overridden by functions.
///
/// We call them "mandatory" because POSIX effectively requires them to be
/// implemented by the shell.
/// built into the shell.
Mandatory,

/// Non-portable built-in that can be used without `$PATH` search
///
/// Elective built-ins are built-ins that are listed in step 1b of [Command
/// Search and Execution](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01)
/// in POSIX XCU section 2.9.1.
/// Search and Execution](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_01_04)
/// in POSIX XCU section 2.9.1.4.
/// They are very similar to mandatory built-ins, but their behavior is not
/// specified by POSIX, so they are not portable. They cannot be used when
/// the (TODO TBD) option is set. <!-- An option that disables non-portable
Expand All @@ -77,21 +77,21 @@ pub enum Type {
/// implement them.
Elective,

/// Non-portable extension
/// Non-conforming extension
///
/// Extension built-ins are non-conformant extensions to the POSIX shell.
/// Like elective built-ins, they can be executed without `$PATH` search
/// finding a corresponding external utility. However, since this behavior
/// does not conform to [Command
/// Search and Execution](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01)
/// in POSIX XCU section 2.9.1, they cannot be used when the (TODO TBD)
/// Search and Execution](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_01_04)
/// in POSIX XCU section 2.9.1.4, they cannot be used when the (TODO TBD)
/// option is set. <!-- An option that disables non-conforming behavior
/// would make extension built-ins regarded as non-existing utilities. An
/// option that disables non-portable behavior would make extension
/// built-ins unusable even if found. -->
Extension,

/// Built-in that works as a standalone utility
/// Built-in that works like a standalone utility
///
/// A substitutive built-in is a built-in that is executed instead of an
/// external utility to minimize invocation overhead. Since a substitutive
Expand Down

0 comments on commit a197290

Please sign in to comment.