Decoded: arch (coreutils)

[Back to Project Main Page]

Note: This page explores the design of command-line utilities. It is not a user guide.
[GNU Manual] [No POSIX requirement] [Linux man] [FreeBSD man]

Logical flow of arch command (coreutils)

Summary

arch - print machine hardware name

[Source] [Code Walkthrough]

Lines of code: 2
Principal syscall: geteuid()
Support syscalls: None
Options: 2 (help and version)


Setup

The two lines of code for arch set the global mode of the uname utility.


Parsing

The arch utility forces the -m option during parsing


Execution

See uname. The arch utility executes the same code as uname to print the architecture information.

Note that arch is a standalone utility and does not directly depend on uname.


[Back to Project Main Page]