elf

title: elf(5)

text:
# elf(5)

## NAME
elf - format of Executable and Linking Format (ELF) files

## SYNOPSIS

```
#include <elf.h>
```

## DESCRIPTION
The header file <elf.h> defines the format of ELF executable binary files. Amongst these files are normal executable files, relocatable object files, core files, and shared objects.

An executable file using the ELF file format consists of an ELF header, followed by a program header table or a section header table, or both. The ELF header is always at offset zero of the file. The program header table and the section header table's offset in the file are defined in the ELF header. The two tables describe the rest of the particularities of the file.

This header file describes the above mentioned headers as C structures and also includes structures for dynamic sections, relocation sections and symbol tables.

### Basic types
The following types are used for N-bit architectures (N=32,64, ElfN stands for Elf32 or Elf64, uintN_t stands for uint32_t or uint64_t):

```
ElfN_Addr       Unsigned program address, uintN_t
ElfN_Off        Unsigned file offset, uintN_t
ElfN_Section    Unsigned section index, uint16_t
ElfN_Versym     Unsigned version symbol information, uint16_t
Elf_Byte        unsigned char
ElfN_Half       uint16_t
ElfN_Sword      int32_t
ElfN_Word       uint32_t
ElfN_Sxword     int64_t
ElfN_Xword      uint64_t
```

(Note: the *BSD terminology is a bit different. There, Elf64_Half is twice as large as Elf32_Half, and Elf64Quarter is used for uint16_t. In order to avoid confusion these types are replaced by explicit ones in the below.)

All data structures that the file format defines follow the "natural" size and alignment guidelines for the relevant class. If necessary, data structures contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4, and so on.

### ELF header (Ehdr)
The ELF header is described by the type Elf32_Ehdr or Elf64_Ehdr:

```
#define EI_NIDENT 16
typedef struct {

    unsigned char e_ident[EI_NIDENT];

    uint16_t      e_type;

    uint16_t      e_machine;

    uint32_t      e_version;

    ElfN_Addr     e_entry;

    ElfN_Off      e_phoff;

    ElfN_Off      e_shoff;

    uint32_t      e_flags;

    uint16_t      e_ehsize;

    uint16_t      e_phentsize;

    uint16_t      e_phnum;

    uint16_t      e_shentsize;

    uint16_t      e_shnum;

    uint16_t      e_shstrndx;
} ElfN_Ehdr;
```

The fields have the following meanings:

e_ident

This array of bytes specifies how to interpret the file, independent of the processor or the file's remaining contents. Within this array everything is named by macros, which start with the prefix EI_ and may contain values which start with the prefix ELF. The following macros are defined:

EI_MAG0

The first byte of the magic number. It must be filled with ELFMAG0. (0: 0x7f)

EI_MAG1

The second byte of the magic number. It must be filled with ELFMAG1. (1: 'E')

EI_MAG2

The third byte of the magic number. It must be filled with ELFMAG2. (2: 'L')

EI_MAG3

The fourth byte of the magic number. It must be filled with ELFMAG3. (3: 'F')

EI_CLASS

The fifth byte identifies the architecture for this binary:

ELFCLASSNONE

This class is invalid.

ELFCLASS32

This defines the 32-bit architecture. It supports machines with files and virtual address spaces up to 4 Gigabytes.

ELFCLASS64

This defines the 64-bit architecture.

EI_DATA

The sixth byte specifies the data encoding of the processor-specific data in the file. Currently, these encodings are supported:

ELFDATANONE

Unknown data format.

ELFDATA2LSB

Two's complement, little-endian.

ELFDATA2MSB

Two's complement, big-endian.

EI_VERSION

The seventh byte is the version number of the ELF specification:

EV_NONE

Invalid version.

EV_CURRENT

Current version.

EI_OSABI

The eighth byte identifies the operating system and ABI to which the object is targeted. Some fields in other ELF structures have flags and values that have platform-specific meanings; the interpretation of those fields is determined by the value of this byte. For example:

ELFOSABI_NONE

Same as ELFOSABI_SYSV

ELFOSABI_SYSV

UNIX System V ABI

ELFOSABI_HPUX

HP-UX ABI

ELFOSABI_NETBSD

NetBSD ABI

ELFOSABI_LINUX

Linux ABI

ELFOSABI_SOLARIS

Solaris ABI

ELFOSABI_IRIX

IRIX ABI

ELFOSABI_FREEBSD

FreeBSD ABI

ELFOSABI_TRU64

TRU64 UNIX ABI

ELFOSABI_ARM

ARM architecture ABI

ELFOSABI_STANDALONE

Stand-alone (embedded) ABI

EI_ABIVERSION

The ninth byte identifies the version of the ABI to which the object is targeted. This field is used to distinguish among incompatible versions of an ABI. The interpretation of this version number is dependent on the ABI identified by the EI_OSABI field. Applications conforming to this specification use the value 0.

EI_PAD

Start of padding. These bytes are reserved and set to zero. Programs which read them should ignore them. The value for EI_PAD will change in the future if currently unused bytes are given meanings.

EI_NIDENT

The size of the e_ident array.

e_type

This member of the structure identifies the object file type:

ET_NONE

An unknown type.

ET_REL

A relocatable file.

ET_EXEC

An executable file.

ET_DYN

A shared object.

ET_CORE

A core file.

e_machine

This member specifies the required architecture for an individual file. For example:

EM_NONE

An unknown machine

EM_M32

AT&T WE 32100

EM_SPARC

Sun Microsystems SPARC

EM_386

Intel 80386

EM_68K

Motorola 68000

EM_88K

Motorola 88000

EM_860

Intel 80860

EM_MIPS

MIPS RS3000 (big-endian only)

EM_PARISC

HP/PA

EM_SPARC32PLUS

SPARC with enhanced instruction set

EM_PPC

PowerPC

EM_PPC64

PowerPC 64-bit

EM_S390

IBM S/390

EM_ARM

Advanced RISC Machines

EM_SH

Renesas SuperH

EM_SPARCV9

SPARC v9 64-bit

EM_IA_64

Intel Itanium

EM_X86_64

AMD x86-64

EM_VAX

DEC Vax

e_version

This member identifies the file version:

EV_NONE

Invalid version

EV_CURRENT

Current version

e_entry

This member gives the virtual address to which the system first transfers control, thus starting the process. If the file has no associated entry point, this member holds zero.

e_phoff

This member holds the program header table's file offset in bytes. If the file has no program header table, this member holds zero.

e_shoff

This member holds the section header table's file offset in bytes. If the file has no section header table, this member holds zero.

e_flags

This member holds processor-specific flags associated with the file. Flag names take the form EF_`machine_flag'. Currently, no flags have been defined.

e_ehsize

This member holds the ELF header's size in bytes.

e_phentsize

This member holds the size in bytes of one entry in the file's program header table; all entries are the same size.

e_phnum

This member holds the number of entries in the program header table. Thus the product of e_phentsize and e_phnum gives the table's size in bytes. If a file has no program header, e_phnum holds the value zero.

If the number of entries in the program header table is larger than or equal to PN_XNUM (0xffff), this member holds PN_XNUM (0xffff) and the real number of entries in the program header table is held in the sh_info member of the initial entry in section header table. Otherwise, the sh_info member of the initial entry contains the value zero.

PN_XNUM

This is defined as 0xffff, the largest number e_phnum can have, specifying where the actual number of program headers is assigned.

e_shentsize

This member holds a sections header's size in bytes. A section header is one entry in the section header table; all entries are the same size.

e_shnum

This member holds the number of entries in the section header table. Thus the product of e_shentsize and e_shnum gives the section header table's size in bytes. If a file has no section header table, e_shnum holds the value of zero.

If the number of entries in the section header table is larger than or equal to SHN_LORESERVE (0xff00), e_shnum holds the value zero and the real number of entries in the section header table is held in the sh_size member of the initial entry in section header table. Otherwise, the sh_size member of the initial entry in the section header table holds the value zero.

e_shstrndx

This member holds the section header table index of the entry associated with the section name string table. If the file has no section name string table, this member holds the value SHN_UNDEF.

If the index of section name string table section is larger than or equal to SHN_LORESERVE (0xff00), this member holds SHN_XINDEX (0xffff) and the real index of the section name string table section is held in the sh_link member of the initial entry in section header table. Otherwise, the sh_link member of the initial entry in section header table contains the value zero.

### Program header (Phdr)
An executable or shared object file's program header table is an array of structures, each describing a segment or other information the system needs to prepare the program for execution. An object file segment contains one or more sections. Program headers are meaningful only for executable and shared object files. A file specifies its own program header size with the ELF header's e_phentsize and e_phnum members. The ELF program header is described by the type Elf32_Phdr or Elf64_Phdr depending on the architecture:

```
typedef struct {

    uint32_t   p_type;

    Elf32_Off  p_offset;

    Elf32_Addr p_vaddr;

    Elf32_Addr p_paddr;

    uint32_t   p_filesz;

    uint32_t   p_memsz;

    uint32_t   p_flags;

    uint32_t   p_align;
} Elf32_Phdr;
```

```
typedef struct {

    uint32_t   p_type;

    uint32_t   p_flags;

    Elf64_Off  p_offset;

    Elf64_Addr p_vaddr;

    Elf64_Addr p_paddr;

    uint64_t   p_filesz;

    uint64_t   p_memsz;

    uint64_t   p_align;
} Elf64_Phdr;
```

The main difference between the 32-bit and the 64-bit program header lies in the location of the p_flags member in the total struct.

p_type

This member of the structure indicates what kind of segment this array element describes or how to interpret the array element's information.

PT_NULL

The array element is unused and the other members' values are undefined. This lets the program header have ignored entries.

PT_LOAD

The array element specifies a loadable segment, described by p_filesz and p_memsz. The bytes from the file are mapped to the beginning of the memory segment. If the segment's memory size p_memsz is larger than the file size p_filesz, the "extra" bytes are defined to hold the value 0 and to follow the segment's initialized area. The file size may not be larger than the memory size. Loadable segment entries in the program header table appear in ascending order, sorted on the p_vaddr member.

PT_DYNAMIC

The array element specifies dynamic linking information.

PT_INTERP

The array element specifies the location and size of a null-terminated pathname to invoke as an interpreter. This segment type is meaningful only for executable files (though it may occur for shared objects). However it may not occur more than once in a file. If it is present, it must precede any loadable segment entry.

PT_NOTE

The array element specifies the location of notes (ElfN_Nhdr).

PT_SHLIB

This segment type is reserved but has unspecified semantics. Programs that contain an array element of this type do not conform to the ABI.

PT_PHDR

The array element, if present, specifies the location and size of the program header table itself, both in the file and in the memory image of the program. This segment type may not occur more than once in a file. Moreover, it may occur only if the program header table is part of the memory image of the program. If it is present, it must precede any loadable segment entry.

PT_LOPROC, PT_HIPROC

Values in the inclusive range [PT_LOPROC, PT_HIPROC] are reserved for processor-specific semantics.

PT_GNU_STACK

GNU extension which is used by the Linux kernel to control the state of the stack via the flags set in the p_flags member.

p_offset

This member holds the offset from the beginning of the file at which the first byte of the segment resides.

p_vaddr

This member holds the virtual address at which the first byte of the segment resides in memory.

p_paddr

On systems for which physical addressing is relevant, this member is reserved for the segment's physical address. Under BSD this member is not used and must be zero.

p_filesz

This member holds the number of bytes in the file image of the segment. It may be zero.

p_memsz

This member holds the number of bytes in the memory image of the segment. It may be zero.

p_flags

This member holds a bit mask of flags relevant to the segment:

PF_X

An executable segment.

PF_W

A writable segment.

PF_R

A readable segment.

A text segment commonly has the flags PF_X and PF_R . A data segment commonly has PF_W and PF_R.

p_align

This member holds the value to which the segments are aligned in memory and in the file. Loadable process segments must have congruent values for p_vaddr and p_offset, modulo the page size. Values of zero and one mean no alignment is required. Otherwise, p_align should be a positive, integral power of two, and p_vaddr should equal p_offset, modulo p_align.

### Section header (Shdr)
A file's section header table lets one locate all the file's sections. The section header table is an array of Elf32_Shdr or Elf64_Shdr structures. The ELF header's e_shoff member gives the byte offset from the beginning of the file to the section header table. e_shnum holds the number of entries the section header table contains. e_shentsize holds the size in bytes of each entry.

A section header table index is a subscript into this array. Some section header table indices are reserved: the initial entry and the indices between SHN_LORESERVE and SHN_HIRESERVE. The initial entry is used in ELF extensions for e_phnum, e_shnum, and e_shstrndx; in other cases, each field in the initial entry is set to zero. An object file does not have sections for these special indices:

SHN_UNDEF

This value marks an undefined, missing, irrelevant, or otherwise meaningless section reference.

SHN_LORESERVE

This value specifies the lower bound of the range of reserved indices.

SHN_LOPROC, SHN_HIPROC

Values greater in the inclusive range [SHN_LOPROC, SHN_HIPROC] are reserved for processor-specific semantics.

SHN_ABS

This value specifies the absolute value for the corresponding reference. For example, a symbol defined relative to section number SHN_ABS has an absolute value and is not affected by relocation.

SHN_COMMON

Symbols defined relative to this section are common symbols, such as FORTRAN COMMON or unallocated C external variables.

SHN_HIRESERVE

This value specifies the upper bound of the range of reserved indices. The system reserves indices between SHN_LORESERVE and SHN_HIRESERVE, inclusive. The section header table does not contain entries for the reserved indices.

The section header has the following structure:

```
typedef struct {

    uint32_t   sh_name;

    uint32_t   sh_type;

    uint32_t   sh_flags;

    Elf32_Addr sh_addr;

    Elf32_Off  sh_offset;

    uint32_t   sh_size;

    uint32_t   sh_link;

    uint32_t   sh_info;

    uint32_t   sh_addralign;

    uint32_t   sh_entsize;
} Elf32_Shdr;
```

```
typedef struct {

    uint32_t   sh_name;

    uint32_t   sh_type;

    uint64_t   sh_flags;

    Elf64_Addr sh_addr;

    Elf64_Off  sh_offset;

    uint64_t   sh_size;

    uint32_t   sh_link;

    uint32_t   sh_info;

    uint64_t   sh_addralign;

    uint64_t   sh_entsize;
} Elf64_Shdr;
```

No real differences exist between the 32-bit and 64-bit section headers.

sh_name

This member specifies the name of the section. Its value is an index into the section header string table section, giving the location of a null-terminated string.

sh_type

This member categorizes the section's contents and semantics.

SHT_NULL

This value marks the section header as inactive. It does not have an associated section. Other members of the section header have undefined values.

SHT_PROGBITS

This section holds information defined by the program, whose format and meaning are determined solely by the program.

SHT_SYMTAB

This section holds a symbol table. Typically, SHT_SYMTAB provides symbols for link editing, though it may also be used for dynamic linking. As a complete symbol table, it may contain many symbols unnecessary for dynamic linking. An object file can also contain a SHT_DYNSYM section.

SHT_STRTAB

This section holds a string table. An object file may have multiple string table sections.

SHT_RELA

This section holds relocation entries with explicit addends, such as type Elf32_Rela for the 32-bit class of object files. An object may have multiple relocation sections.

SHT_HASH

This section holds a symbol hash table. An object participating in dynamic linking must contain a symbol hash table. An object file may have only one hash table.

SHT_DYNAMIC

This section holds information for dynamic linking. An object file may have only one dynamic section.

SHT_NOTE

This section holds notes (ElfN_Nhdr).

SHT_NOBITS

A section of this type occupies no space in the file but otherwise resembles SHT_PROGBITS. Although this section contains no bytes, the sh_offset member contains the conceptual file offset.

SHT_REL

This section holds relocation offsets without explicit addends, such as type Elf32_Rel for the 32-bit class of object files. An object file may have multiple relocation sections.

SHT_SHLIB

This section is reserved but has unspecified semantics.

SHT_DYNSYM

This section holds a minimal set of dynamic linking symbols. An object file can also contain a SHT_SYMTAB section.

SHT_LOPROC, SHT_HIPROC

Values in the inclusive range [SHT_LOPROC, SHT_HIPROC] are reserved for processor-specific semantics.

SHT_LOUSER

This value specifies the lower bound of the range of indices reserved for application programs.

SHT_HIUSER

This value specifies the upper bound of the range of indices reserved for application programs. Section types between SHT_LOUSER and SHT_HIUSER may be used by the application, without conflicting with current or future system-defined section types.

sh_flags

Sections support one-bit flags that describe miscellaneous attributes. If a flag bit is set in sh_flags, the attribute is "on" for the section. Otherwise, the attribute is "off" or does not apply. Undefined attributes are set to zero.

SHF_WRITE

This section contains data that should be writable during process execution.

SHF_ALLOC

This section occupies memory during process execution. Some control sections do not reside in the memory image of an object file. This attribute is off for those sections.

SHF_EXECINSTR

This section contains executable machine instructions.

SHF_MASKPROC

All bits included in this mask are reserved for processor-specific semantics.

sh_addr

If this section appears in the memory image of a process, this member holds the address at which the section's first byte should reside. Otherwise, the member contains zero.

sh_offset

This member's value holds the byte offset from the beginning of the file to the first byte in the section. One section type, SHT_NOBITS, occupies no space in the file, and its sh_offset member locates the conceptual placement in the file.

sh_size

This member holds the section's size in bytes. Unless the section type is SHT_NOBITS, the section occupies sh_size bytes in the file. A section of type SHT_NOBITS may have a nonzero size, but it occupies no space in the file.

sh_link

This member holds a section header table index link, whose interpretation depends on the section type.

sh_info

This member holds extra information, whose interpretation depends on the section type.

sh_addralign

Some sections have address alignment constraints. If a section holds a doubleword, the system must ensure doubleword alignment for the entire section. That is, the value of sh_addr must be congruent to zero, modulo the value of sh_addralign. Only zero and positive integral powers of two are allowed. The value 0 or 1 means that the section has no alignment constraints.

sh_entsize

Some sections hold a table of fixed-sized entries, such as a symbol table. For such a section, this member gives the size in bytes for each entry. This member contains zero if the section does not hold a table of fixed-size entries.

Various sections hold program and control information:

.bss

This section holds uninitialized data that contributes to the program's memory image. By definition, the system initializes the data with zeros when the program begins to run. This section is of type SHT_NOBITS. The attribute types are SHF_ALLOC and SHF_WRITE.

.comment

This section holds version control information. This section is of type SHT_PROGBITS. No attribute types are used.

.ctors

This section holds initialized pointers to the C++ constructor functions. This section is of type SHT_PROGBITS. The attribute types are SHF_ALLOC and SHF_WRITE.

.data

This section holds initialized data that contribute to the program's memory image. This section is of type SHT_PROGBITS. The attribute types are SHF_ALLOC and SHF_WRITE.

.data1

This section holds initialized data that contribute to the program's memory image. This section is of type SHT_PROGBITS. The attribute types are SHF_ALLOC and SHF_WRITE.

.debug

This section holds information for symbolic debugging. The contents are unspecified. This section is of type SHT_PROGBITS. No attribute types are used.

.dtors

This section holds initialized pointers to the C++ destructor functions. This section is of type SHT_PROGBITS. The attribute types are SHF_ALLOC and SHF_WRITE.

.dynamic

This section holds dynamic linking information. The section's attributes will include the SHF_ALLOC bit. Whether the SHF_WRITE bit is set is processor-specific. This section is of type SHT_DYNAMIC. See the attributes above.

.dynstr

This section holds strings needed for dynamic linking, most commonly the strings that represent the names associated with symbol table entries. This section is of type SHT_STRTAB. The attribute type used is SHF_ALLOC.

.dynsym

This section holds the dynamic linking symbol table. This section is of type SHT_DYNSYM. The attribute used is SHF_ALLOC.

.fini

This section holds executable instructions that contribute to the process termination code. When a program exits normally the system arranges to execute the code in this section. This section is of type SHT_PROGBITS. The attributes used are SHF_ALLOC and SHF_EXECINSTR.

.gnu.version

This section holds the version symbol table, an array of ElfN_Half elements. This section is of type SHT_GNU_versym. The attribute type used is SHF_ALLOC.

.gnu.version_d

This section holds the version symbol definitions, a table of ElfN_Verdef structures. This section is of type SHT_GNU_verdef. The attribute type used is SHF_ALLOC.

.gnu.version_r

This section holds the version symbol needed elements, a table of ElfN_Verneed structures. This section is of type SHT_GNU_versym. The attribute type used is SHF_ALLOC.

.got

This section holds the global offset table. This section is of type SHT_PROGBITS. The attributes are processor-specific.

.hash

This section holds a symbol hash table. This section is of type SHT_HASH. The attribute used is SHF_ALLOC.

.init

This section holds executable instructions that contribute to the process initialization code. When a program starts to run the system arranges to execute the code in this section before calling the main program entry point. This section is of type SHT_PROGBITS. The attributes used are SHF_ALLOC and SHF_EXECINSTR.

.interp

This section holds the pathname of a program interpreter. If the file has a loadable segment that includes the section, the section's attributes will include the SHF_ALLOC bit. Otherwise, that bit will be off. This section is of type SHT_PROGBITS.

.line

This section holds line number information for symbolic debugging, which describes the correspondence between the program source and the machine code. The contents are unspecified. This section is of type SHT_PROGBITS. No attribute types are used.

.note

This section holds various notes. This section is of type SHT_NOTE. No attribute types are used.

.note.ABI-tag

This section is used to declare the expected run-time ABI of the ELF image. It may include the operating system name and its run-time versions. This section is of type SHT_NOTE. The only attribute used is SHF_ALLOC.

.note.gnu.build-id

This section is used to hold an ID that uniquely identifies the contents of the ELF image. Different files with the same build ID should contain the same executable content. See the --build-id option to the GNU linker (ld (1)) for more details. This section is of type SHT_NOTE. The only attribute used is SHF_ALLOC.

.note.GNU-stack

This section is used in Linux object files for declaring stack attributes. This section is of type SHT_PROGBITS. The only attribute used is SHF_EXECINSTR. This indicates to the GNU linker that the object file requires an executable stack.

.note.openbsd.ident

OpenBSD native executables usually contain this section to identify themselves so the kernel can bypass any compatibility ELF binary emulation tests when loading the file.

.plt

This section holds the procedure linkage table. This section is of type SHT_PROGBITS. The attributes are processor-specific.

.relNAME

This section holds relocation information as described below. If the file has a loadable segment that includes relocation, the section's attributes will include the SHF_ALLOC bit. Otherwise, the bit will be off. By convention, "NAME" is supplied by the section to which the relocations apply. Thus a relocation section for .text normally would have the name .rel.text. This section is of type SHT_REL.

.relaNAME

This section holds relocation information as described below. If the file has a loadable segment that includes relocation, the section's attributes will include the SHF_ALLOC bit. Otherwise, the bit will be off. By convention, "NAME" is supplied by the section to which the relocations apply. Thus a relocation section for .text normally would have the name .rela.text. This section is of type SHT_RELA.

.rodata

This section holds read-only data that typically contributes to a nonwritable segment in the process image. This section is of type SHT_PROGBITS. The attribute used is SHF_ALLOC.

.rodata1

This section holds read-only data that typically contributes to a nonwritable segment in the process image. This section is of type SHT_PROGBITS. The attribute used is SHF_ALLOC.

.shstrtab

This section holds section names. This section is of type SHT_STRTAB. No attribute types are used.

.strtab

This section holds strings, most commonly the strings that represent the names associated with symbol table entries. If the file has a loadable segment that includes the symbol string table, the section's attributes will include the SHF_ALLOC bit. Otherwise, the bit will be off. This section is of type SHT_STRTAB.

.symtab

This section holds a symbol table. If the file has a loadable segment that includes the symbol table, the section's attributes will include the SHF_ALLOC bit. Otherwise, the bit will be off. This section is of type SHT_SYMTAB.

.text

This section holds the "text", or executable instructions, of a program. This section is of type SHT_PROGBITS. The attributes used are SHF_ALLOC and SHF_EXECINSTR.

### String and symbol tables
String table sections hold null-terminated character sequences, commonly called strings. The object file uses these strings to represent symbol and section names. One references a string as an index into the string table section. The first byte, which is index zero, is defined to hold a null byte ('\0'). Similarly, a string table's last byte is defined to hold a null byte, ensuring null termination for all strings.

An object file's symbol table holds information needed to locate and relocate a program's symbolic definitions and references. A symbol table index is a subscript into this array.

```
typedef struct {

    uint32_t      st_name;

    Elf32_Addr    st_value;

    uint32_t      st_size;

    unsigned char st_info;

    unsigned char st_other;

    uint16_t      st_shndx;
} Elf32_Sym;
```

```
typedef struct {

    uint32_t      st_name;

    unsigned char st_info;

    unsigned char st_other;

    uint16_t      st_shndx;

    Elf64_Addr    st_value;

    uint64_t      st_size;
} Elf64_Sym;
```

The 32-bit and 64-bit versions have the same members, just in a different order.

st_name

This member holds an index into the object file's symbol string table, which holds character representations of the symbol names. If the value is nonzero, it represents a string table index that gives the symbol name. Otherwise, the symbol has no name.

st_value

This member gives the value of the associated symbol.

st_size

Many symbols have associated sizes. This member holds zero if the symbol has no size or an unknown size.

st_info

This member specifies the symbol's type and binding attributes:

STT_NOTYPE

The symbol's type is not defined.

STT_OBJECT

The symbol is associated with a data object.

STT_FUNC

The symbol is associated with a function or other executable code.

STT_SECTION

The symbol is associated with a section. Symbol table entries of this type exist primarily for relocation and normally have STB_LOCAL bindings.

STT_FILE

By convention, the symbol's name gives the name of the source file associated with the object file. A file symbol has STB_LOCAL bindings, its section index is SHN_ABS, and it precedes the other STB_LOCAL symbols of the file, if it is present.

STT_LOPROC, STT_HIPROC

Values in the inclusive range [STT_LOPROC, STT_HIPROC] are reserved for processor-specific semantics.

STB_LOCAL

Local symbols are not visible outside the object file containing their definition. Local symbols of the same name may exist in multiple files without interfering with each other.

STB_GLOBAL

Global symbols are visible to all object files being combined. One file's definition of a global symbol will satisfy another file's undefined reference to the same symbol.

STB_WEAK

Weak symbols resemble global symbols, but their definitions have lower precedence.

STB_LOPROC, STB_HIPROC

Values in the inclusive range [STB_LOPROC, STB_HIPROC] are reserved for processor-specific semantics.

There are macros for packing and unpacking the binding and type fields:

ELF32_ST_BIND(info), ELF64_ST_BIND(info)

Extract a binding from an st_info value.

ELF32_ST_TYPE(info), ELF64_ST_TYPE(info)

Extract a type from an st_info value.

ELF32_ST_INFO(bind, type), ELF64_ST_INFO(bind, type)

Convert a binding and a type into an st_info value.

st_other

This member defines the symbol visibility.

STV_DEFAULT

Default symbol visibility rules. Global and weak symbols are available to other modules; references in the local module can be interposed by definitions in other modules.

STV_INTERNAL

Processor-specific hidden class.

STV_HIDDEN

Symbol is unavailable to other modules; references in the local module always resolve to the local symbol (i.e., the symbol can't be interposed by definitions in other modules).

STV_PROTECTED

Symbol is available to other modules, but references in the local module always resolve to the local symbol.

There are macros for extracting the visibility type:

ELF32_ST_VISIBILITY(other) or ELF64_ST_VISIBILITY(other)

st_shndx

Every symbol table entry is "defined" in relation to some section. This member holds the relevant section header table index.

### Relocation entries (Rel & Rela)
Relocation is the process of connecting symbolic references with symbolic definitions. Relocatable files must have information that describes how to modify their section contents, thus allowing executable and shared object files to hold the right information for a process's program image. Relocation entries are these data.

Relocation structures that do not need an addend:

```
typedef struct {

    Elf32_Addr r_offset;

    uint32_t   r_info;
} Elf32_Rel;
```

```
typedef struct {

    Elf64_Addr r_offset;

    uint64_t   r_info;
} Elf64_Rel;
```

Relocation structures that need an addend:

```
typedef struct {

    Elf32_Addr r_offset;

    uint32_t   r_info;

    int32_t    r_addend;
} Elf32_Rela;
```

```
typedef struct {

    Elf64_Addr r_offset;

    uint64_t   r_info;

    int64_t    r_addend;
} Elf64_Rela;
```

r_offset

This member gives the location at which to apply the relocation action. For a relocatable file, the value is the byte offset from the beginning of the section to the storage unit affected by the relocation. For an executable file or shared object, the value is the virtual address of the storage unit affected by the relocation.

r_info

This member gives both the symbol table index with respect to which the relocation must be made and the type of relocation to apply. Relocation types are processor-specific. When the text refers to a relocation entry's relocation type or symbol table index, it means the result of applying ELF[32|64]_R_TYPE or ELF[32|64]_R_SYM, respectively, to the entry's r_info member.

r_addend

This member specifies a constant addend used to compute the value to be stored into the relocatable field.

### Dynamic tags (Dyn)
The .dynamic section contains a series of structures that hold relevant dynamic linking information. The d_tag member controls the interpretation of d_un.

```
typedef struct {

    Elf32_Sword    d_tag;

    union {

        Elf32_Word d_val;

        Elf32_Addr d_ptr;

    } d_un;
} Elf32_Dyn;
extern Elf32_Dyn _DYNAMIC[];
```

```
typedef struct {

    Elf64_Sxword    d_tag;

    union {

        Elf64_Xword d_val;

        Elf64_Addr  d_ptr;

    } d_un;
} Elf64_Dyn;
extern Elf64_Dyn _DYNAMIC[];
```

d_tag

This member may have any of the following values:

DT_NULL

Marks end of dynamic section

DT_NEEDED

String table offset to name of a needed library

DT_PLTRELSZ

Size in bytes of PLT relocation entries

DT_PLTGOT

Address of PLT and/or GOT

DT_HASH

Address of symbol hash table

DT_STRTAB

Address of string table

DT_SYMTAB

Address of symbol table

DT_RELA

Address of Rela relocation table

DT_RELASZ

Size in bytes of the Rela relocation table

DT_RELAENT

Size in bytes of a Rela relocation table entry

DT_STRSZ

Size in bytes of string table

DT_SYMENT

Size in bytes of a symbol table entry

DT_INIT

Address of the initialization function

DT_FINI

Address of the termination function

DT_SONAME

String table offset to name of shared object

DT_RPATH

String table offset to library search path (deprecated)

DT_SYMBOLIC

Alert linker to search this shared object before the executable for symbols

DT_REL

Address of Rel relocation table

DT_RELSZ

Size in bytes of Rel relocation table

DT_RELENT

Size in bytes of a Rel table entry

DT_PLTREL

Type of relocation entry to which the PLT refers (Rela or Rel)

DT_DEBUG

Undefined use for debugging

DT_TEXTREL

Absence of this entry indicates that no relocation entries should apply to a nonwritable segment

DT_JMPREL

Address of relocation entries associated solely with the PLT

DT_BIND_NOW

Instruct dynamic linker to process all relocations before transferring control to the executable

DT_RUNPATH

String table offset to library search path

DT_LOPROC, DT_HIPROC

Values in the inclusive range [DT_LOPROC, DT_HIPROC] are reserved for processor-specific semantics

d_val

This member represents integer values with various interpretations.

d_ptr

This member represents program virtual addresses. When interpreting these addresses, the actual address should be computed based on the original file value and memory base address. Files do not contain relocation entries to fixup these addresses.

_DYNAMIC

Array containing all the dynamic structures in the .dynamic section. This is automatically populated by the linker.

### Notes (Nhdr)
ELF notes allow for appending arbitrary information for the system to use. They are largely used by core files (e_type of ET_CORE), but many projects define their own set of extensions. For example, the GNU tool chain uses ELF notes to pass information from the linker to the C library.

Note sections contain a series of notes (see the struct definitions below). Each note is followed by the name field (whose length is defined in n_namesz) and then by the descriptor field (whose length is defined in n_descsz) and whose starting address has a 4 byte alignment. Neither field is defined in the note struct due to their arbitrary lengths.

An example for parsing out two consecutive notes should clarify their layout in memory:

```
void *memory, *name, *desc;
Elf64_Nhdr *note, *next_note;
/* The buffer is pointing to the start of the section/segment. */
note = memory;
/* If the name is defined, it follows the note. */
name = note->n_namesz == 0 ? NULL : memory + sizeof(*note);
/* If the descriptor is defined, it follows the name

   (with alignment). */
desc = note->n_descsz == 0 ? NULL :

       memory + sizeof(*note) + ALIGN_UP(note->n_namesz, 4);
/* The next note follows both (with alignment). */
next_note = memory + sizeof(*note) +

                     ALIGN_UP(note->n_namesz, 4) +

                     ALIGN_UP(note->n_descsz, 4);
```

Keep in mind that the interpretation of n_type depends on the namespace defined by the n_namesz field. If the n_namesz field is not set (e.g., is 0), then there are two sets of notes: one for core files and one for all other ELF types. If the namespace is unknown, then tools will usually fallback to these sets of notes as well.

```
typedef struct {

    Elf32_Word n_namesz;

    Elf32_Word n_descsz;

    Elf32_Word n_type;
} Elf32_Nhdr;
```

```
typedef struct {

    Elf64_Word n_namesz;

    Elf64_Word n_descsz;

    Elf64_Word n_type;
} Elf64_Nhdr;
```

n_namesz

The length of the name field in bytes. The contents will immediately follow this note in memory. The name is null terminated. For example, if the name is "GNU", then n_namesz will be set to 4.

n_descsz

The length of the descriptor field in bytes. The contents will immediately follow the name field in memory.

n_type

Depending on the value of the name field, this member may have any of the following values:

Core files (e_type = ET_CORE)

Notes used by all core files. These are highly operating system or architecture specific and often require close coordination with kernels, C libraries, and debuggers. These are used when the namespace is the default (i.e., n_namesz will be set to 0), or a fallback when the namespace is unknown.

NT_PRSTATUS

prstatus struct

NT_FPREGSET

fpregset struct

NT_PRPSINFO

prpsinfo struct

NT_PRXREG

prxregset struct

NT_TASKSTRUCT

task structure

NT_PLATFORM

String from sysinfo(SI_PLATFORM)

NT_AUXV

auxv array

NT_GWINDOWS

gwindows struct

NT_ASRS

asrset struct

NT_PSTATUS

pstatus struct

NT_PSINFO

psinfo struct

NT_PRCRED

prcred struct

NT_UTSNAME

utsname struct

NT_LWPSTATUS

lwpstatus struct

NT_LWPSINFO

lwpinfo struct

NT_PRFPXREG

fprxregset struct

NT_SIGINFO

siginfo_t (size might increase over time)

NT_FILE

Contains information about mapped files

NT_PRXFPREG

user_fxsr_struct

NT_PPC_VMX

PowerPC Altivec/VMX registers

NT_PPC_SPE

PowerPC SPE/EVR registers

NT_PPC_VSX

PowerPC VSX registers

NT_386_TLS

i386 TLS slots (struct user_desc)

NT_386_IOPERM

x86 io permission bitmap (1=deny)

NT_X86_XSTATE

x86 extended state using xsave

NT_S390_HIGH_GPRS

s390 upper register halves

NT_S390_TIMER

s390 timer register

NT_S390_TODCMP

s390 time-of-day (TOD) clock comparator register

NT_S390_TODPREG

s390 time-of-day (TOD) programmable register

NT_S390_CTRS

s390 control registers

NT_S390_PREFIX

s390 prefix register

NT_S390_LAST_BREAK

s390 breaking event address

NT_S390_SYSTEM_CALL

s390 system call restart data

NT_S390_TDB

s390 transaction diagnostic block

NT_ARM_VFP

ARM VFP/NEON registers

NT_ARM_TLS

ARM TLS register

NT_ARM_HW_BREAK

ARM hardware breakpoint registers

NT_ARM_HW_WATCH

ARM hardware watchpoint registers

NT_ARM_SYSTEM_CALL

ARM system call number

n_name = GNU

Extensions used by the GNU tool chain.

NT_GNU_ABI_TAG

Operating system (OS) ABI information. The desc field will be 4 words:

[0]

OS descriptor (ELF_NOTE_OS_LINUX, ELF_NOTE_OS_GNU, and so on)`

[1]

major version of the ABI

[2]

minor version of the ABI

[3]

subminor version of the ABI

NT_GNU_HWCAP

Synthetic hwcap information. The desc field begins with two words:

[0]

number of entries

[1]

bit mask of enabled entries

Then follow variable-length entries, one byte followed by a null-terminated hwcap name string. The byte gives the bit number to test if enabled, (1U << bit) & bit mask.

NT_GNU_BUILD_ID

Unique build ID as generated by the GNU ld(1) --build-id option. The desc consists of any nonzero number of bytes.

NT_GNU_GOLD_VERSION

The desc contains the GNU Gold linker version used.

Default/unknown namespace (e_type != ET_CORE)

These are used when the namespace is the default (i.e., n_namesz will be set to 0), or a fallback when the namespace is unknown.

NT_VERSION

A version string of some sort.

NT_ARCH

Architecture information.

## NOTES
ELF first appeared in System V. The ELF format is an adopted standard.

The extensions for e_phnum, e_shnum, and e_shstrndx respectively are Linux extensions. Sun, BSD, and AMD64 also support them; for further information, look under SEE ALSO.

## SEE ALSO
as(1), elfedit(1), gdb(1), ld(1), nm(1), objcopy(1), objdump(1), patchelf(1), readelf(1), size(1), strings(1), strip(1), execve(2), dl_iterate_phdr(3), core(5), ld.so(8)

Hewlett-Packard, Elf-64 Object File Format.

Santa Cruz Operation, System V Application Binary Interface.

UNIX System Laboratories, "Object Files", Executable and Linking Format (ELF).

Sun Microsystems, Linker and Libraries Guide.

AMD64 ABI Draft, System V Application Binary Interface AMD64 Architecture Processor Supplement.


erofs

package: man-pages

title: erofs(5)

summary: the Enhanced Read-Only File System

text:
# erofs(5)

## NAME
erofs - the Enhanced Read-Only File System

## DESCRIPTION
erofs is a create-once read-only filesystem, with support for compression and a multi-device backing store.

There are two inode formats:

•

32-byte compact with 16-bit UID/GID, 32-bit file size, and no file times

•

64-byte extended with 32-bit UID/GID, 64-bit file size, and a modification time (st_mtim).

### Mount options
user_xattr

nouser_xattr

Controls whether user extended attributes are exposed. Defaults to yes.

acl

noacl

Controls whether POSIX acl(5)s are exposed. Defaults to yes.

cache_strategy=disabled|readahead|readaround

Cache allocation for compressed files: never, if reading from start of file, regardless of position. Defaults to readaround.

dax

dax=always|never

Direct Access control. If always and the source device supports DAX, uncompressed non-inlined files will be read directly, without going through the page cache. dax is a synonym for always. Defaults to unset, which is equivalent to never.

device=blobdev

Add extra device holding some of the data. Must be given as many times and in the same order as --blobdev was to mkfs.erofs(1).

domain_id=did

fsid=id

Control CacheFiles on-demand read support. To be documented.

## VERSIONS
erofs images are versioned through the use of feature flags; these are listed in the -E section of mkfs.erofs(1),

## CONFIGURATION
Linux must be configured with the CONFIG_EROFS_FS option to mount EROFS filesystems. There are sub-configuration items that restrict the availability of some of the parameters above.

## SEE ALSO
mkfs.erofs(1), fsck.erofs(1), dump.erofs(1)

Documentation/filesystems/erofs.txt in the Linux source.


filesystems

title: filesystems(5)

text:
# filesystems(5)

## NAME
filesystems - Linux filesystem types: ext, ext2, ext3, ext4, hpfs, iso9660, JFS, minix, msdos, ncpfs nfs, ntfs, proc, Reiserfs, smb, sysv, umsdos, vfat, XFS, xiafs

## DESCRIPTION
When, as is customary, the proc filesystem is mounted on /proc, you can find in the file /proc/filesystems which filesystems your kernel currently supports; see proc(5) for more details. There is also a legacy sysfs(2) system call (whose availability is controlled by the CONFIG_SYSFS_SYSCALL kernel build configuration option since Linux 3.15) that enables enumeration of the currently available filesystem types regardless of /proc availability and/or sanity.

If you need a currently unsupported filesystem, insert the corresponding kernel module or recompile the kernel.

In order to use a filesystem, you have to mount it; see mount(2) and mount(8).

The following list provides a short description of the available or historically available filesystems in the Linux kernel. See the kernel documentation for a comprehensive description of all options and limitations.

erofs

is the Enhanced Read-Only File System, stable since Linux 5.4. See erofs(5).

ext

is an elaborate extension of the minix filesystem. It has been completely superseded by the second version of the extended filesystem (ext2) and has been removed from the kernel (in Linux 2.1.21).

ext2

is a disk filesystem that was used by Linux for fixed disks as well as removable media. The second extended filesystem was designed as an extension of the extended filesystem (ext). See ext2(5).

ext3

is a journaling version of the ext2 filesystem. It is easy to switch back and forth between ext2 and ext3. See ext3(5).

ext4

is a set of upgrades to ext3 including substantial performance and reliability enhancements, plus large increases in volume, file, and directory size limits. See ext4(5).

hpfs

is the High Performance Filesystem, used in OS/2. This filesystem is read-only under Linux due to the lack of available documentation.

iso9660

is a CD-ROM filesystem type conforming to the ISO 9660 standard.

High Sierra

Linux supports High Sierra, the precursor to the ISO 9660 standard for CD-ROM filesystems. It is automatically recognized within the iso9660 filesystem support under Linux.

Rock Ridge

Linux also supports the System Use Sharing Protocol records specified by the Rock Ridge Interchange Protocol. They are used to further describe the files in the iso9660 filesystem to a UNIX host, and provide information such as long filenames, UID/GID, POSIX permissions, and devices. It is automatically recognized within the iso9660 filesystem support under Linux.

JFS

is a journaling filesystem, developed by IBM, that was integrated into Linux 2.4.24.

minix

is the filesystem used in the Minix operating system, the first to run under Linux. It has a number of shortcomings, including a 64 MB partition size limit, short filenames, and a single timestamp. It remains useful for floppies and RAM disks.

msdos

is the filesystem used by DOS, Windows, and some OS/2 computers. msdos filenames can be no longer than 8 characters, followed by an optional period and 3 character extension.

ncpfs

is a network filesystem that supports the NCP protocol, used by Novell NetWare. It was removed from the kernel in Linux 4.17.

To use ncpfs, you need special programs, which can be found at ftp://ftp.gwdg.de/pub/linux/misc/ncpfs.

nfs

is the network filesystem used to access disks located on remote computers.

ntfs

is the filesystem native to Microsoft Windows NT, supporting features like ACLs, journaling, encryption, and so on.

proc

is a pseudo filesystem which is used as an interface to kernel data structures rather than reading and interpreting /dev/kmem. In particular, its files do not take disk space. See proc(5).

Reiserfs

is a journaling filesystem, designed by Hans Reiser, that was integrated into Linux 2.4.1.

smb

is a network filesystem that supports the SMB protocol, used by Windows. See https://www.samba.org/samba/smbfs/.

sysv

is an implementation of the System V/Coherent filesystem for Linux. It implements all of Xenix FS, System V/386 FS, and Coherent FS.

umsdos

is an extended DOS filesystem used by Linux. It adds capability for long filenames, UID/GID, POSIX permissions, and special files (devices, named pipes, etc.) under the DOS filesystem, without sacrificing compatibility with DOS.

tmpfs

is a filesystem whose contents reside in virtual memory. Since the files on such filesystems typically reside in RAM, file access is extremely fast. See tmpfs(5).

vfat

is an extended FAT filesystem used by Microsoft Windows95 and Windows NT. vfat adds the capability to use long filenames under the MSDOS filesystem.

XFS

is a journaling filesystem, developed by SGI, that was integrated into Linux 2.4.20.

xiafs

was designed and implemented to be a stable, safe filesystem by extending the Minix filesystem code. It provides the basic most requested features without undue complexity. The xiafs filesystem is no longer actively developed or maintained. It was removed from the kernel in Linux 2.1.21.

## SEE ALSO
fuse(4), btrfs(5), ext2(5), ext3(5), ext4(5), nfs(5), proc(5), sysfs(5), tmpfs(5), xfs(5), fsck(8), mkfs(8), mount(8)


ftpusers

title: ftpusers(5)

text:
# ftpusers(5)

## NAME
ftpusers - list of users that may not log in via the FTP daemon

## DESCRIPTION
The text file ftpusers contains a list of users that may not log in using the File Transfer Protocol (FTP) server daemon. This file is used not merely for system administration purposes but also for improving security within a TCP/IP networked environment.

The ftpusers file will typically contain a list of the users that either have no business using ftp or have too many privileges to be allowed to log in through the FTP server daemon. Such users usually include root, daemon, bin, uucp, and news.

If your FTP server daemon doesn't use ftpusers, then it is suggested that you read its documentation to find out how to block access for certain users. Washington University FTP server Daemon (wuftpd) and Professional FTP Daemon (proftpd) are known to make use of ftpusers.

### Format
The format of ftpusers is very simple. There is one account name (or username) per line. Lines starting with a # are ignored.

## FILES
/etc/ftpusers

## SEE ALSO
passwd(5), proftpd(8), wuftpd(8)


gai.conf

title: gai.conf(5)

summary: getaddrinfo(3) configuration file

text:
# gai.conf(5)

## NAME
gai.conf - getaddrinfo(3) configuration file

## DESCRIPTION
A call to getaddrinfo(3) might return multiple answers. According to RFC 3484 these answers must be sorted so that the answer with the highest success rate is first in the list. The RFC provides an algorithm for the sorting. The static rules are not always adequate, though. For this reason, the RFC also requires that system administrators should have the possibility to dynamically change the sorting. For the glibc implementation, this can be achieved with the /etc/gai.conf file.

Each line in the configuration file consists of a keyword and its parameters. White spaces in any place are ignored. Lines starting with '#' are comments and are ignored.

The keywords currently recognized are:

label netmask precedence

The value is added to the label table used in the RFC 3484 sorting. If any label definition is present in the configuration file, the default table is not used. All the label definitions of the default table which are to be maintained have to be duplicated. Following the keyword, the line has to contain a network mask and a precedence value.

precedence netmask precedence

This keyword is similar to label, but instead the value is added to the precedence table as specified in RFC 3484. Once again, the presence of a single precedence line in the configuration file causes the default table to not be used.

reload <yes|no>

This keyword controls whether a process checks whether the configuration file has been changed since the last time it was read. If the value is "yes", the file is reread. This might cause problems in multithreaded applications and is generally a bad idea. The default is "no".

scopev4 mask value

Add another rule to the RFC 3484 scope table for IPv4 address. By default, the scope IDs described in section 3.2 in RFC 3438 are used. Changing these defaults should hardly ever be necessary.

## FILES
/etc/gai.conf

## VERSIONS
The gai.conf file is supported since glibc 2.5.

## EXAMPLES
The default table according to RFC 3484 would be specified with the following configuration file:

```
label  ::1/128       0
label  ::/0          1
label  2002::/16     2
label ::/96          3
label ::ffff:0:0/96  4
precedence  ::1/128       50
precedence  ::/0          40
precedence  2002::/16     30
precedence ::/96          20
precedence ::ffff:0:0/96  10
```

## SEE ALSO
getaddrinfo(3), RFC 3484


group

title: group(5)

summary: user group file

text:
# group(5)

## NAME
group - user group file

## DESCRIPTION
The /etc/group file is a text file that defines the groups on the system. There is one entry per line, with the following format:

```
group_name:password:GID:user_list
```

The fields are as follows:

group_name

the name of the group.

password

the (encrypted) group password. If this field is empty, no password is needed.

GID

the numeric group ID.

user_list

a list of the usernames that are members of this group, separated by commas.

## FILES
/etc/group

## BUGS
As the 4.2BSD initgroups(3) man page says: no one seems to keep /etc/group up-to-date.

## SEE ALSO
chgrp(1), gpasswd(1), groups(1), login(1), newgrp(1), sg(1), getgrent(3), getgrnam(3), gshadow(5), passwd(5), vigr(8)


host.conf

title: host.conf(5)

summary: resolver configuration file

text:
# host.conf(5)

## NAME
host.conf - resolver configuration file

## DESCRIPTION
The file /etc/host.conf contains configuration information specific to the resolver library. It should contain one configuration keyword per line, followed by appropriate configuration information. The following keywords are recognized:

trim

This keyword may be listed more than once. Each time it should be followed by a list of domains, separated by colons (':'), semicolons (';') or commas (','), with the leading dot. When set, the resolver library will automatically trim the given domain name from the end of any hostname resolved via DNS. This is intended for use with local hosts and domains. (Related note: trim will not affect hostnames gathered via NIS or the hosts(5) file. Care should be taken to ensure that the first hostname for each entry in the hosts file is fully qualified or unqualified, as appropriate for the local installation.)

multi

Valid values are on and off. If set to on, the resolver library will return all valid addresses for a host that appears in the /etc/hosts file, instead of only the first. This is off by default, as it may cause a substantial performance loss at sites with large hosts files.

reorder

Valid values are on and off. If set to on, the resolver library will attempt to reorder host addresses so that local addresses (i.e., on the same subnet) are listed first when a gethostbyname(3) is performed. Reordering is done for all lookup methods. The default value is off.

## ENVIRONMENT
The following environment variables can be used to allow users to override the behavior which is configured in /etc/host.conf:

RESOLV_HOST_CONF

If set, this variable points to a file that should be read instead of /etc/host.conf.

RESOLV_MULTI

Overrides the multi command.

RESOLV_REORDER

Overrides the reorder command.

RESOLV_ADD_TRIM_DOMAINS

A list of domains, separated by colons (':'), semicolons (';'), or commas (','), with the leading dot, which will be added to the list of domains that should be trimmed.

RESOLV_OVERRIDE_TRIM_DOMAINS

A list of domains, separated by colons (':'), semicolons (';'), or commas (','), with the leading dot, which will replace the list of domains that should be trimmed. Overrides the trim command.

## FILES
/etc/host.conf

Resolver configuration file

/etc/resolv.conf

Resolver configuration file

/etc/hosts

Local hosts database

## NOTES
The following differences exist compared to the original implementation. A new command spoof and a new environment variable RESOLV_SPOOF_CHECK can take arguments like off, nowarn, and warn. Line comments can appear anywhere and not only at the beginning of a line.

### Historical
The nsswitch.conf(5) file is the modern way of controlling the order of host lookups.

In glibc 2.4 and earlier, the following keyword is recognized:

order

This keyword specifies how host lookups are to be performed. It should be followed by one or more lookup methods, separated by commas. Valid methods are bind, hosts, and nis.

RESOLV_SERV_ORDER

Overrides the order command.

Since glibc 2.0.7, and up through glibc 2.24, the following keywords and environment variable have been recognized but never implemented:

nospoof

Valid values are on and off. If set to on, the resolver library will attempt to prevent hostname spoofing to enhance the security of rlogin and rsh. It works as follows: after performing a host address lookup, the resolver library will perform a hostname lookup for that address. If the two hostnames do not match, the query fails. The default value is off.

spoofalert

Valid values are on and off. If this option is set to on and the nospoof option is also set, the resolver library will log a warning of the error via the syslog facility. The default value is off.

spoof

Valid values are off, nowarn, and warn. If this option is set to off, spoofed addresses are permitted and no warnings will be emitted via the syslog facility. If this option is set to warn, the resolver library will attempt to prevent hostname spoofing to enhance the security and log a warning of the error via the syslog facility. If this option is set to nowarn, the resolver library will attempt to prevent hostname spoofing to enhance the security but not emit warnings via the syslog facility. Setting this option to anything else is equal to setting it to nowarn.

RESOLV_SPOOF_CHECK

Overrides the nospoof, spoofalert, and spoof commands in the same way as the spoof command is parsed. Valid values are off, nowarn, and warn.

## SEE ALSO
gethostbyname(3), hosts(5), nsswitch.conf(5), resolv.conf(5), hostname(7), named(8)


hosts

title: hosts(5)

summary: static table lookup for hostnames

text:
# hosts(5)

## NAME
hosts - static table lookup for hostnames

## SYNOPSIS

```
/etc/hosts
```

## DESCRIPTION
This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information:

IP_address canonical_hostname [aliases...]

The IP address can conform to either IPv4 or IPv6. Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment, and is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic character and end with an alphanumeric character. Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for example, localhost). If required, a host may have two separate entries in this file; one for each version of the Internet Protocol (IPv4 and IPv6).

The Berkeley Internet Name Domain (BIND) Server implements the Internet name server for UNIX systems. It augments or replaces the /etc/hosts file or hostname lookup, and frees a host from relying on /etc/hosts being up to date and complete.

In modern systems, even though the host table has been superseded by DNS, it is still widely used for:

bootstrapping

Most systems have a small host table containing the name and address information for important hosts on the local network. This is useful when DNS is not running, for example during system bootup.

NIS

Sites that use NIS use the host table as input to the NIS host database. Even though NIS can be used with DNS, most NIS sites still use the host table with an entry for all local hosts as a backup.

isolated nodes

Very small sites that are isolated from the network use the host table instead of DNS. If the local information rarely changes, and the network is not connected to the Internet, DNS offers little advantage.

## FILES
/etc/hosts

## NOTES
Modifications to this file normally take effect immediately, except in cases where the file is cached by applications.

### Historical notes
RFC 952 gave the original format for the host table, though it has since changed.

Before the advent of DNS, the host table was the only way of resolving hostnames on the fledgling Internet. Indeed, this file could be created from the official host data base maintained at the Network Information Control Center (NIC), though local changes were often required to bring it up to date regarding unofficial aliases and/or unknown hosts. The NIC no longer maintains the hosts.txt files, though looking around at the time of writing (circa 2000), there are historical hosts.txt files on the WWW. I just found three, from 92, 94, and 95.

## EXAMPLES

```
# The following lines are desirable for IPv4 capable hosts
127.0.0.1       localhost
# 127.0.1.1 is often used for the FQDN of the machine
127.0.1.1       thishost.example.org   thishost
192.168.1.10    foo.example.org        foo
192.168.1.13    bar.example.org        bar
146.82.138.7    master.debian.org      master
209.237.226.90  www.opensource.org
# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
```

## SEE ALSO
hostname(1), resolver(3), host.conf(5), resolv.conf(5), resolver(5), hostname(7), named(8)

Internet RFC 952


hosts.equiv

title: hosts.equiv(5)

summary: list of hosts and users that are granted trusted

text:
# hosts.equiv(5)

## NAME
hosts.equiv - list of hosts and users that are granted "trusted" r command access to your system

## DESCRIPTION
The file /etc/hosts.equiv allows or denies hosts and users to use the r-commands (e.g., rlogin, rsh, or rcp) without supplying a password.

The file uses the following format:

+|[-]hostname|+@netgroup|-@netgroup [+|[-]username|+@netgroup|-@netgroup]

The hostname is the name of a host which is logically equivalent to the local host. Users logged into that host are allowed to access like-named user accounts on the local host without supplying a password. The hostname may be (optionally) preceded by a plus (+) sign. If the plus sign is used alone, it allows any host to access your system. You can explicitly deny access to a host by preceding the hostname by a minus (-) sign. Users from that host must always supply additional credentials, including possibly a password. For security reasons you should always use the FQDN of the hostname and not the short hostname.

The username entry grants a specific user access to all user accounts (except root) without supplying a password. That means the user is NOT restricted to like-named accounts. The username may be (optionally) preceded by a plus (+) sign. You can also explicitly deny access to a specific user by preceding the username with a minus (-) sign. This says that the user is not trusted no matter what other entries for that host exist.

Netgroups can be specified by preceding the netgroup by an @ sign.

Be extremely careful when using the plus (+) sign. A simple typographical error could result in a standalone plus sign. A standalone plus sign is a wildcard character that means "any host"!

## FILES
/etc/hosts.equiv

## NOTES
Some systems will honor the contents of this file only when it has owner root and no write permission for anybody else. Some exceptionally paranoid systems even require that there be no other hard links to the file.

Modern systems use the Pluggable Authentication Modules library (PAM). With PAM a standalone plus sign is considered a wildcard character which means "any host" only when the word promiscuous is added to the auth component line in your PAM file for the particular service (e.g., rlogin).

## EXAMPLES
Below are some example /etc/host.equiv or ~/.rhosts files.

Allow any user to log in from any host:

```
+
```

Allow any user from host with a matching local account to log in:

```
host
```

Note: the use of +host is never a valid syntax, including attempting to specify that any user from the host is allowed.

Allow any user from host to log in:

```
host +
```

Note: this is distinct from the previous example since it does not require a matching local account.

Allow user from host to log in as any non-root user:

```
host user
```

Allow all users with matching local accounts from host to log in except for baduser:

```
host -baduser
host
```

Deny all users from host:

```
-host
```

Note: the use of -host -user is never a valid syntax, including attempting to specify that a particular user from the host is not trusted.

Allow all users with matching local accounts on all hosts in a netgroup:

```
+@netgroup
```

Disallow all users on all hosts in a netgroup:

```
-@netgroup
```

Allow all users in a netgroup to log in from host as any non-root user:

```
host +@netgroup
```

Allow all users with matching local accounts on all hosts in a netgroup except baduser:

```
+@netgroup -baduser
+@netgroup
```

Note: the deny statements must always precede the allow statements because the file is processed sequentially until the first matching rule is found.

## SEE ALSO
rhosts(5), rlogind(8), rshd(8)


intro

title: intro(5)

text:
# intro(5)

## NAME
intro - introduction to file formats and filesystems

## DESCRIPTION
Section 5 of the manual describes various file formats, as well as the corresponding C structures, if any.

In addition, this section contains a number of pages that document various filesystems.

## NOTES

### Authors and copyright conditions
Look at the header of the manual page source for the author(s) and copyright conditions. Note that these can be different from page to page!

## SEE ALSO
standards(7)


issue

title: issue(5)

text:
# issue(5)

## NAME
issue - prelogin message and identification file

## DESCRIPTION
/etc/issue is a text file which contains a message or system identification to be printed before the login prompt. It may contain various @char and \char sequences, if supported by the getty-type program employed on the system.

## FILES
/etc/issue

## SEE ALSO
motd(5), agetty(8), mingetty(8)


locale

title: locale(5)

summary: describes a locale definition file

text:
# locale(5)

## NAME
locale - describes a locale definition file

## DESCRIPTION
The locale definition file contains all the information that the localedef(1) command needs to convert it into the binary locale database.

The definition files consist of sections which each describe a locale category in detail. See locale(7) for additional details for these categories.

### Syntax
The locale definition file starts with a header that may consist of the following keywords:

escape_char

is followed by a character that should be used as the escape-character for the rest of the file to mark characters that should be interpreted in a special way. It defaults to the backslash (\).

comment_char

is followed by a character that will be used as the comment-character for the rest of the file. It defaults to the number sign (#).

The locale definition has one part for each locale category. Each part can be copied from another existing locale or can be defined from scratch. If the category should be copied, the only valid keyword in the definition is copy followed by the name of the locale in double quotes which should be copied. The exceptions for this rule are LC_COLLATE and LC_CTYPE where a copy statement can be followed by locale-specific rules and selected overrides.

When defining a locale or a category from scratch, an existing system- provided locale definition file should be used as a reference to follow common glibc conventions.

### Locale category sections
The following category sections are defined by POSIX:

•

LC_CTYPE

•

LC_COLLATE

•

LC_MESSAGES

•

LC_MONETARY

•

LC_NUMERIC

•

LC_TIME

In addition, since glibc 2.2, the GNU C library supports the following nonstandard categories:

•

LC_ADDRESS

•

LC_IDENTIFICATION

•

LC_MEASUREMENT

•

LC_NAME

•

LC_PAPER

•

LC_TELEPHONE

See locale(7) for a more detailed description of each category.

### LC_ADDRESS
The definition starts with the string LC_ADDRESS in the first column.

The following keywords are allowed:

postal_fmt

followed by a string containing field descriptors that define the format used for postal addresses in the locale. The following field descriptors are recognized:

%n

Person's name, possibly constructed with the LC_NAME name_fmt keyword (since glibc 2.24).

%a

Care of person, or organization.

%f

Firm name.

%d

Department name.

%b

Building name.

%s

Street or block (e.g., Japanese) name.

%h

House number or designation.

%N

Insert an end-of-line if the previous descriptor's value was not an empty string; otherwise ignore.

%t

Insert a space if the previous descriptor's value was not an empty string; otherwise ignore.

%r

Room number, door designation.

%e

Floor number.

%C

Country designation, from the country_post keyword.

%l

Local township within town or city (since glibc 2.24).

%z

Zip number, postal code.

%T

Town, city.

%S

State, province, or prefecture.

%c

Country, as taken from data record.

Each field descriptor may have an 'R' after the '%' to specify that the information is taken from a Romanized version string of the entity.

country_name

followed by the country name in the language of the current document (e.g., "Deutschland" for the de_DE locale).

country_post

followed by the abbreviation of the country (see CERT_MAILCODES).

country_ab2

followed by the two-letter abbreviation of the country (ISO 3166).

country_ab3

followed by the three-letter abbreviation of the country (ISO 3166).

country_num

followed by the numeric country code (ISO 3166).

country_car

followed by the international license plate country code.

country_isbn

followed by the ISBN code (for books).

lang_name

followed by the language name in the language of the current document.

lang_ab

followed by the two-letter abbreviation of the language (ISO 639).

lang_term

followed by the three-letter abbreviation of the language (ISO 639-2/T).

lang_lib

followed by the three-letter abbreviation of the language for library use (ISO 639-2/B). Applications should in general prefer lang_term over lang_lib.

The LC_ADDRESS definition ends with the string END LC_ADDRESS.

### LC_CTYPE
The definition starts with the string LC_CTYPE in the first column.

The following keywords are allowed:

upper

followed by a list of uppercase letters. The letters A through Z are included automatically. Characters also specified as cntrl, digit, punct, or space are not allowed.

lower

followed by a list of lowercase letters. The letters a through z are included automatically. Characters also specified as cntrl, digit, punct, or space are not allowed.

alpha

followed by a list of letters. All character specified as either upper or lower are automatically included. Characters also specified as cntrl, digit, punct, or space are not allowed.

digit

followed by the characters classified as numeric digits. Only the digits 0 through 9 are allowed. They are included by default in this class.

space

followed by a list of characters defined as white-space characters. Characters also specified as upper, lower, alpha, digit, graph, or xdigit are not allowed. The characters <space>, <form-feed>, <newline>, <carriage-return>, <tab>, and <vertical-tab> are automatically included.

cntrl

followed by a list of control characters. Characters also specified as upper, lower, alpha, digit, punct, graph, print, or xdigit are not allowed.

punct

followed by a list of punctuation characters. Characters also specified as upper, lower, alpha, digit, cntrl, xdigit, or the <space> character are not allowed.

graph

followed by a list of printable characters, not including the <space> character. The characters defined as upper, lower, alpha, digit, xdigit, and punct are automatically included. Characters also specified as cntrl are not allowed.

print

followed by a list of printable characters, including the <space> character. The characters defined as upper, lower, alpha, digit, xdigit, punct, and the <space> character are automatically included. Characters also specified as cntrl are not allowed.

xdigit

followed by a list of characters classified as hexadecimal digits. The decimal digits must be included followed by one or more set of six characters in ascending order. The following characters are included by default: 0 through 9, a through f, A through F.

blank

followed by a list of characters classified as blank. The characters <space> and <tab> are automatically included.

charclass

followed by a list of locale-specific character class names which are then to be defined in the locale.

toupper

followed by a list of mappings from lowercase to uppercase letters. Each mapping is a pair of a lowercase and an uppercase letter separated with a , and enclosed in parentheses.

tolower

followed by a list of mappings from uppercase to lowercase letters. If the keyword tolower is not present, the reverse of the toupper list is used.

map totitle

followed by a list of mapping pairs of characters and letters to be used in titles (headings).

class

followed by a locale-specific character class definition, starting with the class name followed by the characters belonging to the class.

charconv

followed by a list of locale-specific character mapping names which are then to be defined in the locale.

outdigit

followed by a list of alternate output digits for the locale.

map to_inpunct

followed by a list of mapping pairs of alternate digits and separators for input digits for the locale.

map to_outpunct

followed by a list of mapping pairs of alternate separators for output for the locale.

translit_start

marks the start of the transliteration rules section. The section can contain the include keyword in the beginning followed by locale-specific rules and overrides. Any rule specified in the locale file will override any rule copied or included from other files. In case of duplicate rule definitions in the locale file, only the first rule is used.

A transliteration rule consist of a character to be transliterated followed by a list of transliteration targets separated by semicolons. The first target which can be presented in the target character set is used, if none of them can be used the default_missing character will be used instead.

include

in the transliteration rules section includes a transliteration rule file (and optionally a repertoire map file).

default_missing

in the transliteration rules section defines the default character to be used for transliteration where none of the targets cannot be presented in the target character set.

translit_end

marks the end of the transliteration rules.

The LC_CTYPE definition ends with the string END LC_CTYPE.

### LC_COLLATE
Note that glibc does not support all POSIX-defined options, only the options described below are supported (as of glibc 2.23).

The definition starts with the string LC_COLLATE in the first column.

The following keywords are allowed:

coll_weight_max

followed by the number representing used collation levels. This keyword is recognized but ignored by glibc.

collating-element

followed by the definition of a collating-element symbol representing a multicharacter collating element.

collating-symbol

followed by the definition of a collating symbol that can be used in collation order statements.

define

followed by string to be evaluated in an ifdef string / else / endif construct.

reorder-after

followed by a redefinition of a collation rule.

reorder-end

marks the end of the redefinition of a collation rule.

reorde-sections-after

followed by a script name to reorder listed scripts after.

reorder-sections-end

marks the end of the reordering of sections.

script

followed by a declaration of a script.

symbol-equivalence

followed by a collating-symbol to be equivalent to another defined collating-symbol.

The collation rule definition starts with a line:

order_start

followed by a list of keywords chosen from forward, backward, or position. The order definition consists of lines that describe the collation order and is terminated with the keyword order_end.

The LC_COLLATE definition ends with the string END LC_COLLATE.

### LC_IDENTIFICATION
The definition starts with the string LC_IDENTIFICATION in the first column.

The following keywords are allowed:

title

followed by the title of the locale document (e.g., "Maori language locale for New Zealand").

source

followed by the name of the organization that maintains this document.

address

followed by the address of the organization that maintains this document.

contact

followed by the name of the contact person at the organization that maintains this document.

email

followed by the email address of the person or organization that maintains this document.

tel

followed by the telephone number (in international format) of the organization that maintains this document. As of glibc 2.24, this keyword is deprecated in favor of other contact methods.

fax

followed by the fax number (in international format) of the organization that maintains this document. As of glibc 2.24, this keyword is deprecated in favor of other contact methods.

language

followed by the name of the language to which this document applies.

territory

followed by the name of the country/geographic extent to which this document applies.

audience

followed by a description of the audience for which this document is intended.

application

followed by a description of any special application for which this document is intended.

abbreviation

followed by the short name for provider of the source of this document.

revision

followed by the revision number of this document.

date

followed by the revision date of this document.

In addition, for each of the categories defined by the document, there should be a line starting with the keyword category, followed by:

(1)

a string that identifies this locale category definition,

(2)

a semicolon, and

(3)

one of the LC_* identifiers.

The LC_IDENTIFICATION definition ends with the string END LC_IDENTIFICATION.

### LC_MESSAGES
The definition starts with the string LC_MESSAGES in the first column.

The following keywords are allowed:

yesexpr

followed by a regular expression that describes possible yes-responses.

noexpr

followed by a regular expression that describes possible no-responses.

yesstr

followed by the output string corresponding to "yes".

nostr

followed by the output string corresponding to "no".

The LC_MESSAGES definition ends with the string END LC_MESSAGES.

### LC_MEASUREMENT
The definition starts with the string LC_MEASUREMENT in the first column.

The following keywords are allowed:

measurement

followed by number identifying the standard used for measurement. The following values are recognized:

1

Metric.

2

US customary measurements.

The LC_MEASUREMENT definition ends with the string END LC_MEASUREMENT.

### LC_MONETARY
The definition starts with the string LC_MONETARY in the first column.

The following keywords are allowed:

int_curr_symbol

followed by the international currency symbol. This must be a 4-character string containing the international currency symbol as defined by the ISO 4217 standard (three characters) followed by a separator.

currency_symbol

followed by the local currency symbol.

mon_decimal_point

followed by the single-character string that will be used as the decimal delimiter when formatting monetary quantities.

mon_thousands_sep

followed by the single-character string that will be used as a group separator when formatting monetary quantities.

mon_grouping

followed by a sequence of integers separated by semicolons that describe the formatting of monetary quantities. See grouping below for details.

positive_sign

followed by a string that is used to indicate a positive sign for monetary quantities.

negative_sign

followed by a string that is used to indicate a negative sign for monetary quantities.

int_frac_digits

followed by the number of fractional digits that should be used when formatting with the int_curr_symbol.

frac_digits

followed by the number of fractional digits that should be used when formatting with the currency_symbol.

p_cs_precedes

followed by an integer that indicates the placement of currency_symbol for a nonnegative formatted monetary quantity:

0

the symbol succeeds the value.

1

the symbol precedes the value.

p_sep_by_space

followed by an integer that indicates the separation of currency_symbol, the sign string, and the value for a nonnegative formatted monetary quantity. The following values are recognized:

0

No space separates the currency symbol and the value.

1

If the currency symbol and the sign string are adjacent, a space separates them from the value; otherwise a space separates the currency symbol and the value.

2

If the currency symbol and the sign string are adjacent, a space separates them from the value; otherwise a space separates the sign string and the value.

n_cs_precedes

followed by an integer that indicates the placement of currency_symbol for a negative formatted monetary quantity. The same values are recognized as for p_cs_precedes.

n_sep_by_space

followed by an integer that indicates the separation of currency_symbol, the sign string, and the value for a negative formatted monetary quantity. The same values are recognized as for p_sep_by_space.

p_sign_posn

followed by an integer that indicates where the positive_sign should be placed for a nonnegative monetary quantity:

0

Parentheses enclose the quantity and the currency_symbol or int_curr_symbol.

1

The sign string precedes the quantity and the currency_symbol or the int_curr_symbol.

2

The sign string succeeds the quantity and the currency_symbol or the int_curr_symbol.

3

The sign string precedes the currency_symbol or the int_curr_symbol.

4

The sign string succeeds the currency_symbol or the int_curr_symbol.

n_sign_posn

followed by an integer that indicates where the negative_sign should be placed for a negative monetary quantity. The same values are recognized as for p_sign_posn.

int_p_cs_precedes

followed by an integer that indicates the placement of int_curr_symbol for a nonnegative internationally formatted monetary quantity. The same values are recognized as for p_cs_precedes.

int_n_cs_precedes

followed by an integer that indicates the placement of int_curr_symbol for a negative internationally formatted monetary quantity. The same values are recognized as for p_cs_precedes.

int_p_sep_by_space

followed by an integer that indicates the separation of int_curr_symbol, the sign string, and the value for a nonnegative internationally formatted monetary quantity. The same values are recognized as for p_sep_by_space.

int_n_sep_by_space

followed by an integer that indicates the separation of int_curr_symbol, the sign string, and the value for a negative internationally formatted monetary quantity. The same values are recognized as for p_sep_by_space.

int_p_sign_posn

followed by an integer that indicates where the positive_sign should be placed for a nonnegative internationally formatted monetary quantity. The same values are recognized as for p_sign_posn.

int_n_sign_posn

followed by an integer that indicates where the negative_sign should be placed for a negative internationally formatted monetary quantity. The same values are recognized as for p_sign_posn.

The LC_MONETARY definition ends with the string END LC_MONETARY.

### LC_NAME
The definition starts with the string LC_NAME in the first column.

Various keywords are allowed, but only name_fmt is mandatory. Other keywords are needed only if there is common convention to use the corresponding salutation in this locale. The allowed keywords are as follows:

name_fmt

followed by a string containing field descriptors that define the format used for names in the locale. The following field descriptors are recognized:

%f

Family name(s).

%F

Family names in uppercase.

%g

First given name.

%G

First given initial.

%l

First given name with Latin letters.

%o

Other shorter name.

%m

Additional given name(s).

%M

Initials for additional given name(s).

%p

Profession.

%s

Salutation, such as "Doctor".

%S

Abbreviated salutation, such as "Mr." or "Dr.".

%d

Salutation, using the FDCC-sets conventions.

%t

If the preceding field descriptor resulted in an empty string, then the empty string, otherwise a space character.

name_gen

followed by the general salutation for any gender.

name_mr

followed by the salutation for men.

name_mrs

followed by the salutation for married women.

name_miss

followed by the salutation for unmarried women.

name_ms

followed by the salutation valid for all women.

The LC_NAME definition ends with the string END LC_NAME.

### LC_NUMERIC
The definition starts with the string LC_NUMERIC in the first column.

The following keywords are allowed:

decimal_point

followed by the single-character string that will be used as the decimal delimiter when formatting numeric quantities.

thousands_sep

followed by the single-character string that will be used as a group separator when formatting numeric quantities.

grouping

followed by a sequence of integers separated by semicolons that describe the formatting of numeric quantities.

Each integer specifies the number of digits in a group. The first integer defines the size of the group immediately to the left of the decimal delimiter. Subsequent integers define succeeding groups to the left of the previous group. If the last integer is not -1, then the size of the previous group (if any) is repeatedly used for the remainder of the digits. If the last integer is -1, then no further grouping is performed.

The LC_NUMERIC definition ends with the string END LC_NUMERIC.

### LC_PAPER
The definition starts with the string LC_PAPER in the first column.

The following keywords are allowed:

height

followed by the height, in millimeters, of the standard paper format.

width

followed by the width, in millimeters, of the standard paper format.

The LC_PAPER definition ends with the string END LC_PAPER.

### LC_TELEPHONE
The definition starts with the string LC_TELEPHONE in the first column.

The following keywords are allowed:

tel_int_fmt

followed by a string that contains field descriptors that identify the format used to dial international numbers. The following field descriptors are recognized:

%a

Area code without nationwide prefix (the prefix is often "00").

%A

Area code including nationwide prefix.

%l

Local number (within area code).

%e

Extension (to local number).

%c

Country code.

%C

Alternate carrier service code used for dialing abroad.

%t

If the preceding field descriptor resulted in an empty string, then the empty string, otherwise a space character.

tel_dom_fmt

followed by a string that contains field descriptors that identify the format used to dial domestic numbers. The recognized field descriptors are the same as for tel_int_fmt.

int_select

followed by the prefix used to call international phone numbers.

int_prefix

followed by the prefix used from other countries to dial this country.

The LC_TELEPHONE definition ends with the string END LC_TELEPHONE.

### LC_TIME
The definition starts with the string LC_TIME in the first column.

The following keywords are allowed:

abday

followed by a list of abbreviated names of the days of the week. The list starts with the first day of the week as specified by week (Sunday by default). See NOTES.

day

followed by a list of names of the days of the week. The list starts with the first day of the week as specified by week (Sunday by default). See NOTES.

abmon

followed by a list of abbreviated month names.

mon

followed by a list of month names.

d_t_fmt

followed by the appropriate date and time format (for syntax, see strftime(3)).

d_fmt

followed by the appropriate date format (for syntax, see strftime(3)).

t_fmt

followed by the appropriate time format (for syntax, see strftime(3)).

am_pm

followed by the appropriate representation of the am and pm strings. This should be left empty for locales not using AM/PM convention.

t_fmt_ampm

followed by the appropriate time format (for syntax, see strftime(3)) when using 12h clock format. This should be left empty for locales not using AM/PM convention.

era

followed by semicolon-separated strings that define how years are counted and displayed for each era in the locale. Each string has the following format:

direction:offset:start_date:end_date:era_name:era_format

The fields are to be defined as follows:

direction

Either + or -. + means the years closer to start_date have lower numbers than years closer to end_date. - means the opposite.

offset

The number of the year closest to start_date in the era, corresponding to the %Ey descriptor (see strptime(3)).

start_date

The start of the era in the form of yyyy/mm/dd. Years prior AD 1 are represented as negative numbers.

end_date

The end of the era in the form of yyyy/mm/dd, or one of the two special values of -* or +*. -* means the ending date is the beginning of time. +* means the ending date is the end of time.

era_name

The name of the era corresponding to the %EC descriptor (see strptime(3)).

era_format

The format of the year in the era corresponding to the %EY descriptor (see strptime(3)).

era_d_fmt

followed by the format of the date in alternative era notation, corresponding to the %Ex descriptor (see strptime(3)).

era_t_fmt

followed by the format of the time in alternative era notation, corresponding to the %EX descriptor (see strptime(3)).

era_d_t_fmt

followed by the format of the date and time in alternative era notation, corresponding to the %Ec descriptor (see strptime(3)).

alt_digits

followed by the alternative digits used for date and time in the locale.

week

followed by a list of three values separated by semicolons: The number of days in a week (by default 7), a date of beginning of the week (by default corresponds to Sunday), and the minimal length of the first week in year (by default 4). Regarding the start of the week, 19971130 shall be used for Sunday and 19971201 shall be used for Monday. See NOTES.

first_weekday (since glibc 2.2)

followed by the number of the day from the day list to be shown as the first day of the week in calendar applications. The default value of 1 corresponds to either Sunday or Monday depending on the value of the second week list item. See NOTES.

first_workday (since glibc 2.2)

followed by the number of the first working day from the day list. The default value is 2. See NOTES.

cal_direction

followed by a number value that indicates the direction for the display of calendar dates, as follows:

1

Left-right from top.

2

Top-down from left.

3

Right-left from top.

date_fmt

followed by the appropriate date representation for date(1) (for syntax, see strftime(3)).

The LC_TIME definition ends with the string END LC_TIME.

## FILES
/usr/lib/locale/locale-archive

Usual default locale archive location.

/usr/share/i18n/locales

Usual default path for locale definition files.

## STANDARDS
POSIX.2.

## NOTES
The collective GNU C library community wisdom regarding abday, day, week, first_weekday, and first_workday states at https://sourceware.org/glibc/wiki/Locales the following:

•

The value of the second week list item specifies the base of the abday and day lists.

•

first_weekday specifies the offset of the first day-of-week in the abday and day lists.

•

For compatibility reasons, all glibc locales should set the value of the second week list item to 19971130 (Sunday) and base the abday and day lists appropriately, and set first_weekday and first_workday to 1 or 2, depending on whether the week and work week actually starts on Sunday or Monday for the locale.

## SEE ALSO
iconv(1), locale(1), localedef(1), localeconv(3), newlocale(3), setlocale(3), strftime(3), strptime(3), uselocale(3), charmap(5), charsets(7), locale(7), unicode(7), utf-8(7)


motd

title: motd(5)

summary: message of the day

text:
# motd(5)

## NAME
motd - message of the day

## DESCRIPTION
The contents of /etc/motd are displayed by login(1) after a successful login but just before it executes the login shell.

The abbreviation "motd" stands for "message of the day", and this file has been traditionally used for exactly that (it requires much less disk space than mail to all users).

## FILES
/etc/motd

## SEE ALSO
login(1), issue(5)


networks

title: networks(5)

summary: network name information

text:
# networks(5)

## NAME
networks - network name information

## DESCRIPTION
The file /etc/networks is a plain ASCII file that describes known DARPA networks and symbolic names for these networks. Each line represents a network and has the following structure:

name number aliases ...

where the fields are delimited by spaces or tabs. Empty lines are ignored. The hash character (#) indicates the start of a comment: this character, and the remaining characters up to the end of the current line, are ignored by library functions that process the file.

The field descriptions are:

name

The symbolic name for the network. Network names can contain any printable characters except white-space characters or the comment character.

number

The official number for this network in numbers-and-dots notation (see inet(3)). The trailing ".0" (for the host component of the network address) may be omitted.

aliases

Optional aliases for the network.

This file is read by the route(8) and netstat(8) utilities. Only Class A, B, or C networks are supported, partitioned networks (i.e., network/26 or network/28) are not supported by this file.

## FILES
/etc/networks

The networks definition file.

## SEE ALSO
getnetbyaddr(3), getnetbyname(3), getnetent(3), netstat(8), route(8)


nologin

title: nologin(5)

text:
# nologin(5)

## NAME
nologin - prevent unprivileged users from logging into the system

## DESCRIPTION
If the file /etc/nologin exists and is readable, login(1) will allow access only to root. Other users will be shown the contents of this file and their logins will be refused. This provides a simple way of temporarily disabling all unprivileged logins.

## FILES
/etc/nologin

## SEE ALSO
login(1), shutdown(8)