diff --git a/lib/libc/string/string.3 b/lib/libc/string/string.3 index a164aae01eec..b389c58acc07 100644 --- a/lib/libc/string/string.3 +++ b/lib/libc/string/string.3 @@ -1,156 +1,157 @@ .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek. .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)string.3 8.2 (Berkeley) 12/11/93 .\" -.Dd December 11, 1993 +.Dd September 2, 2023 .Dt STRING 3 .Os .Sh NAME .Nm stpcpy , .Nm strcat , .Nm strncat , .Nm strchr , .Nm strrchr , .Nm strcmp , .Nm strncmp , .Nm strcasecmp , .Nm strncasecmp , .Nm strcpy , .Nm strncpy , .Nm strerror , .Nm strlen , .Nm strpbrk , .Nm strsep , .Nm strspn , .Nm strcspn , .Nm strstr , .Nm strtok , .Nm index , .Nm rindex .Nd string specific functions .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In string.h .Ft char * .Fn stpcpy "char *dst" "const char *src" .Ft char * .Fn strcat "char *s" "const char * append" .Ft char * .Fn strncat "char *s" "const char *append" "size_t count" .Ft char * .Fn strchr "const char *s" "int c" .Ft char * .Fn strrchr "const char *s" "int c" .Ft int .Fn strcmp "const char *s1" "const char *s2" .Ft int .Fn strncmp "const char *s1" "const char *s2" "size_t count" .Ft int .Fn strcasecmp "const char *s1" "const char *s2" .Ft int .Fn strncasecmp "const char *s1" "const char *s2" "size_t count" .Ft char * .Fn strcpy "char *dst" "const char *src" .Ft char * .Fn strncpy "char *dst" "const char *src" "size_t count" .Ft char * .Fn strerror "int errno" .Ft size_t .Fn strlen "const char *s" .Ft char * .Fn strpbrk "const char *s" "const char *charset" .Ft char * .Fn strsep "char **stringp" "const char *delim" .Ft size_t .Fn strspn "const char *s" "const char *charset" .Ft size_t .Fn strcspn "const char *s" "const char *charset" .Ft char * .Fn strstr "const char *big" "const char *little" .Ft char * .Fn strtok "char *s" "const char *delim" .Ft char * .Fn index "const char *s" "int c" .Ft char * .Fn rindex "const char *s" "int c" .Sh DESCRIPTION The string functions manipulate strings terminated by a null byte. .Pp See the specific manual pages for more information. For manipulating variable length generic objects as byte strings (without the null byte check), see .Xr bstring 3 . .Pp Except as noted in their specific manual pages, the string functions do not test the destination for size limitations. .Sh SEE ALSO .Xr bstring 3 , .Xr index 3 , .Xr rindex 3 , .Xr stpcpy 3 , .Xr strcasecmp 3 , .Xr strcat 3 , .Xr strchr 3 , .Xr strcmp 3 , .Xr strcpy 3 , .Xr strcspn 3 , .Xr strerror 3 , .Xr strlen 3 , .Xr strpbrk 3 , .Xr strrchr 3 , .Xr strsep 3 , .Xr strspn 3 , .Xr strstr 3 , -.Xr strtok 3 +.Xr strtok 3 , +.Xr simd 7 .Sh STANDARDS The .Fn strcat , .Fn strncat , .Fn strchr , .Fn strrchr , .Fn strcmp , .Fn strncmp , .Fn strcpy , .Fn strncpy , .Fn strerror , .Fn strlen , .Fn strpbrk , .Fn strspn , .Fn strcspn , .Fn strstr , and .Fn strtok functions conform to .St -isoC . diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 8e89203e4003..14c6af612087 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -1,439 +1,440 @@ .\" Copyright (c) 2016-2017 The FreeBSD Foundation. .\" .\" This documentation was created by Ed Maste under sponsorship of .\" The FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 12, 2023 +.Dd September 2, 2023 .Dt ARCH 7 .Os .Sh NAME .Nm arch .Nd Architecture-specific details .Sh DESCRIPTION Differences between CPU architectures and platforms supported by .Fx . .Ss Introduction This document is a quick reference of key ABI details of .Fx architecture ports. For full details consult the processor-specific ABI supplement documentation. .Pp If not explicitly mentioned, sizes are in bytes. The architecture details in this document apply to .Fx 12.0 and later, unless otherwise noted. .Pp .Fx uses a flat address space. Variables of types .Vt unsigned long , .Vt uintptr_t , and .Vt size_t and pointers all have the same representation. .Pp In order to maximize compatibility with future pointer integrity mechanisms, manipulations of pointers as integers should be performed via .Vt uintptr_t or .Vt intptr_t and no other types. In particular, .Vt long and .Vt ptrdiff_t should be avoided. .Pp On some architectures, e.g., .Dv powerpc and AIM variants of .Dv powerpc64 , the kernel uses a separate address space. On other architectures, kernel and a user mode process share a single address space. The kernel is located at the highest addresses. .Pp On each architecture, the main user mode thread's stack starts near the highest user address and grows down. .Pp .Fx architecture support varies by release. This table shows currently supported CPU architectures along with the first .Fx release to support each architecture. .Bl -column -offset indent "Architecture" "Initial Release" .It Sy Architecture Ta Sy Initial Release .It aarch64 Ta 11.0 .It amd64 Ta 5.1 .It armv6 Ta 10.0 .It armv7 Ta 12.0 .It i386 Ta 1.0 .It powerpc Ta 6.0 .It powerpcspe Ta 12.0 .It powerpc64 Ta 9.0 .It powerpc64le Ta 13.0 .It riscv64 Ta 12.0 .El .Pp Discontinued architectures are shown in the following table. .Bl -column -offset indent "Architecture" "Initial Release" "Final Release" .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release .It alpha Ta 3.2 Ta 6.4 .It arm Ta 6.0 Ta 12.x .It armeb Ta 8.0 Ta 11.4 .It ia64 Ta 5.0 Ta 10.4 .It mips Ta 8.0 Ta 13.x .It mipsel Ta 9.0 Ta 13.x .It mipselhf Ta 12.0 Ta 13.x .It mipshf Ta 12.0 Ta 13.x .It mipsn32 Ta 9.0 Ta 13.x .It mips64 Ta 9.0 Ta 13.x .It mips64el Ta 9.0 Ta 13.x .It mips64elhf Ta 12.0 Ta 13.x .It mips64hf Ta 12.0 Ta 13.x .It pc98 Ta 2.2 Ta 11.4 .It riscv64sf Ta 12.0 Ta 13.x .It sparc64 Ta 5.0 Ta 12.x .El .Ss Type sizes All .Fx architectures use some variant of the ELF (see .Xr elf 5 ) .Sy Application Binary Interface (ABI) for the machine processor. All supported ABIs can be divided into two groups: .Bl -tag -width "Dv ILP32" .It Dv ILP32 .Vt int , .Vt long , .Vt void * types machine representations all have 4-byte size. .It Dv LP64 .Vt int type machine representation uses 4 bytes, while .Vt long and .Vt void * are 8 bytes. .El .Pp Some machines support more than one .Fx ABI. Typically these are 64-bit machines, where the .Dq native .Dv LP64 execution environment is accompanied by the .Dq legacy .Dv ILP32 environment, which was the historical 32-bit predecessor for 64-bit evolution. Examples are: .Bl -column -offset indent "powerpc64" "ILP32 counterpart" .It Sy LP64 Ta Sy ILP32 counterpart .It Dv amd64 Ta Dv i386 .It Dv powerpc64 Ta Dv powerpc .It Dv aarch64 Ta Dv armv6/armv7 .El .Pp .Dv aarch64 will support execution of .Dv armv6 or .Dv armv7 binaries if the CPU implements .Dv AArch32 execution state, however older .Dv armv4 and .Dv armv5 binaries aren't supported. .Pp On all supported architectures: .Bl -column -offset -indent "long long" "Size" .It Sy Type Ta Sy Size .It short Ta 2 .It int Ta 4 .It long Ta sizeof(void*) .It long long Ta 8 .It float Ta 4 .It double Ta 8 .El .Pp Integers are represented in two's complement. Alignment of integer and pointer types is natural, that is, the address of the variable must be congruent to zero modulo the type size. Most ILP32 ABIs, except .Dv arm , require only 4-byte alignment for 64-bit integers. .Pp Machine-dependent type sizes: .Bl -column -offset indent "Architecture" "void *" "long double" "time_t" .It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t .It aarch64 Ta 8 Ta 16 Ta 8 .It amd64 Ta 8 Ta 16 Ta 8 .It armv6 Ta 4 Ta 8 Ta 8 .It armv7 Ta 4 Ta 8 Ta 8 .It i386 Ta 4 Ta 12 Ta 4 .It powerpc Ta 4 Ta 8 Ta 8 .It powerpcspe Ta 4 Ta 8 Ta 8 .It powerpc64 Ta 8 Ta 8 Ta 8 .It powerpc64le Ta 8 Ta 8 Ta 8 .It riscv64 Ta 8 Ta 16 Ta 8 .El .Pp .Sy time_t is 8 bytes on all supported architectures except i386. .Ss Endianness and Char Signedness .Bl -column -offset indent "Architecture" "Endianness" "char Signedness" .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness .It aarch64 Ta little Ta unsigned .It amd64 Ta little Ta signed .It armv6 Ta little Ta unsigned .It armv7 Ta little Ta unsigned .It i386 Ta little Ta signed .It powerpc Ta big Ta unsigned .It powerpcspe Ta big Ta unsigned .It powerpc64 Ta big Ta unsigned .It powerpc64le Ta little Ta unsigned .It riscv64 Ta little Ta signed .El .Ss Page Size .Bl -column -offset indent "Architecture" "Page Sizes" .It Sy Architecture Ta Sy Page Sizes .It aarch64 Ta 4K, 2M, 1G .It amd64 Ta 4K, 2M, 1G .It armv6 Ta 4K, 1M .It armv7 Ta 4K, 1M .It i386 Ta 4K, 2M (PAE), 4M .It powerpc Ta 4K .It powerpcspe Ta 4K .It powerpc64 Ta 4K .It powerpc64le Ta 4K .It riscv64 Ta 4K, 2M, 1G .El .Ss Floating Point .Bl -column -offset indent "Architecture" "float, double" "long double" .It Sy Architecture Ta Sy float, double Ta Sy long double .It aarch64 Ta hard Ta soft, quad precision .It amd64 Ta hard Ta hard, 80 bit .It armv6 Ta hard Ta hard, double precision .It armv7 Ta hard Ta hard, double precision .It i386 Ta hard Ta hard, 80 bit .It powerpc Ta hard Ta hard, double precision .It powerpcspe Ta hard Ta hard, double precision .It powerpc64 Ta hard Ta hard, double precision .It powerpc64le Ta hard Ta hard, double precision .It riscv64 Ta hard Ta hard, quad precision .El .Ss Default Tool Chain .Fx uses .Xr clang 1 as the default compiler on all supported CPU architectures, LLVM's .Xr ld.lld 1 as the default linker, and ELF Tool Chain binary utilities such as .Xr objcopy 1 and .Xr readelf 1 . .Ss MACHINE_ARCH vs MACHINE_CPUARCH vs MACHINE .Dv MACHINE_CPUARCH should be preferred in Makefiles when the generic architecture is being tested. .Dv MACHINE_ARCH should be preferred when there is something specific to a particular type of architecture where there is a choice of many, or could be a choice of many. Use .Dv MACHINE when referring to the kernel, interfaces dependent on a specific type of kernel or similar things like boot sequences. .Bl -column -offset indent "Dv MACHINE" "Dv MACHINE_CPUARCH" "Dv MACHINE_ARCH" .It Dv MACHINE Ta Dv MACHINE_CPUARCH Ta Dv MACHINE_ARCH .It arm64 Ta aarch64 Ta aarch64 .It amd64 Ta amd64 Ta amd64 .It arm Ta arm Ta armv6, armv7 .It i386 Ta i386 Ta i386 .It powerpc Ta powerpc Ta powerpc, powerpcspe, powerpc64, powerpc64le .It riscv Ta riscv Ta riscv64 .El .Ss Predefined Macros The compiler provides a number of predefined macros. Some of these provide architecture-specific details and are explained below. Other macros, including those required by the language standard, are not included here. .Pp The full set of predefined macros can be obtained with this command: .Bd -literal -offset indent cc -x c -dM -E /dev/null .Ed .Pp Common type size and endianness macros: .Bl -column -offset indent "BYTE_ORDER" "Meaning" .It Sy Macro Ta Sy Meaning .It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int .It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer .It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN . .Dv PDP11_ENDIAN is not used on .Fx . .El .Pp Architecture-specific macros: .Bl -column -offset indent "Architecture" "Predefined macros" .It Sy Architecture Ta Sy Predefined macros .It aarch64 Ta Dv __aarch64__ .It amd64 Ta Dv __amd64__ , Dv __x86_64__ .It armv6 Ta Dv __arm__ , Dv __ARM_ARCH >= 6 .It armv7 Ta Dv __arm__ , Dv __ARM_ARCH >= 7 .It i386 Ta Dv __i386__ .It powerpc Ta Dv __powerpc__ .It powerpcspe Ta Dv __powerpc__ , Dv __SPE__ .It powerpc64 Ta Dv __powerpc__ , Dv __powerpc64__ .It powerpc64le Ta Dv __powerpc__ , Dv __powerpc64__ .It riscv64 Ta Dv __riscv , Dv __riscv_xlen == 64 .El .Pp Compilers may define additional variants of architecture-specific macros. The macros above are preferred for use in .Fx . .Ss Important Xr make 1 variables Most of the externally settable variables are defined in the .Xr build 7 man page. These variables are not otherwise documented and are used extensively in the build system. .Bl -tag -width "MACHINE_CPUARCH" .It Dv MACHINE Represents the hardware platform. This is the same as the native platform's .Xr uname 1 .Fl m output. It defines both the userland / kernel interface, as well as the bootloader / kernel interface. It should only be used in these contexts. Each CPU architecture may have multiple hardware platforms it supports where .Dv MACHINE differs among them. It is used to collect together all the files from .Xr config 8 to build the kernel. It is often the same as .Dv MACHINE_ARCH just as one CPU architecture can be implemented by many different hardware platforms, one hardware platform may support multiple CPU architecture family members, though with different binaries. For example, .Dv MACHINE of i386 supported the IBM-AT hardware platform while the .Dv MACHINE of pc98 supported the Japanese company NEC's PC-9801 and PC-9821 hardware platforms. Both of these hardware platforms supported only the .Dv MACHINE_ARCH of i386 where they shared a common ABI, except for certain kernel / userland interfaces relating to underlying hardware platform differences in bus architecture, device enumeration and boot interface. Generally, .Dv MACHINE should only be used in src/sys and src/stand or in system imagers or installers. .It Dv MACHINE_ARCH Represents the CPU processor architecture. This is the same as the native platforms .Xr uname 1 .Fl p output. It defines the CPU instruction family supported. It may also encode a variation in the byte ordering of multi-byte integers (endian). It may also encode a variation in the size of the integer or pointer. It may also encode a ISA revision. It may also encode hard versus soft floating point ABI and usage. It may also encode a variant ABI when the other factors do not uniquely define the ABI. It, along with .Dv MACHINE , defines the ABI used by the system. Generally, the plain CPU name specifies the most common (or at least first) variant of the CPU. This is why powerpc and powerpc64 imply 'big endian' while 'armv6' and 'armv7' imply little endian. If we ever were to support the so-called x32 ABI (using 32-bit pointers on the amd64 architecture), it would most likely be encoded as amd64-x32. It is unfortunate that amd64 specifies the 64-bit evolution of the x86 platform (it matches the 'first rule') as everybody else uses x86_64. There is no standard name for the processor: each OS selects its own conventions. .It Dv MACHINE_CPUARCH Represents the source location for a given .Dv MACHINE_ARCH . It is generally the common prefix for all the MACHINE_ARCH that share the same implementation, though 'riscv' breaks this rule. While amd64 and i386 are closely related, MACHINE_CPUARCH is not x86 for them. The .Fx source base supports amd64 and i386 with two distinct source bases living in subdirectories named amd64 and i386 (though behind the scenes there's some sharing that fits into this framework). .It Dv CPUTYPE Sets the flavor of .Dv MACHINE_ARCH to build. It is used to optimize the build for a specific CPU / core that the binaries run on. Generally, this does not change the ABI, though it can be a fine line between optimization for specific cases. .It Dv TARGET Used to set .Dv MACHINE in the top level Makefile for cross building. Unused outside of that scope. It is not passed down to the rest of the build. Makefiles outside of the top level should not use it at all (though some have their own private copy for hysterical raisons). .It Dv TARGET_ARCH Used to set .Dv MACHINE_ARCH by the top level Makefile for cross building. Like .Dv TARGET , it is unused outside of that scope. .El .Sh SEE ALSO .Xr src.conf 5 , -.Xr build 7 +.Xr build 7 , +.Xr simd 7 .Sh HISTORY An .Nm manual page appeared in .Fx 11.1 . diff --git a/share/man/man7/environ.7 b/share/man/man7/environ.7 index 7e3437e7c6d4..8a927c0f9f3d 100644 --- a/share/man/man7/environ.7 +++ b/share/man/man7/environ.7 @@ -1,313 +1,321 @@ .\" Copyright (c) 1983, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)environ.7 8.3 (Berkeley) 4/19/94 .\" -.Dd August 5, 2020 +.Dd September 3, 2023 .Dt ENVIRON 7 .Os .Sh NAME .Nm environ .Nd user environment .Sh SYNOPSIS .Ar extern char **environ ; .Sh DESCRIPTION An array of strings, called the .Ar environment is made available to each process by .Xr execve 2 when a process begins. By convention these strings have the form .Va name Ns No = Ns Ar value , and are referred to as .Dq environment variables . A process can query, update, and delete these strings using the .Xr getenv 3 , .Xr setenv 3 , and .Xr unsetenv 3 functions, respectively. The shells also provide commands to manipulate the environment; they are described in the respective shell manual pages. .Pp What follows is a list of environment variables typically seen on a .Ux system. It includes only those variables that a user can expect to see during their day-to-day use of the system, and is far from complete. Environment variables specific to a particular program or library function are documented in the .Sx ENVIRONMENT section of the appropriate manual page. .Sh ENVIRONMENT .Bl -tag -width LD_LIBRARY_PATH +.It Ev ARCHLEVEL +On +.Em amd64 , +controls the level of SIMD enhancements used. +See +.Xr simd 7 +for details. .It Ev BLOCKSIZE The size of the block units used by several disk-related commands, most notably .Xr df 1 , .Xr du 1 and .Xr ls 1 . .Ev BLOCKSIZE may be specified in units of a byte by specifying a number, in units of a kilobyte by specifying a number followed by .Ql K or .Ql k , in units of a megabyte by specifying a number followed by .Ql M or .Ql m , and in units of a gigabyte by specifying a number followed by .Ql G or .Ql g . Sizes less than 512 bytes or greater than a gigabyte are ignored. This variable is processed by the .Xr getbsize 3 function. .It Ev COLUMNS The user's preferred width in column positions for the terminal. Utilities such as .Xr ls 1 and .Xr who 1 use this to format output into columns. If unset or empty, utilities will use an .Xr ioctl 2 call to ask the terminal driver for the width. .It Ev EDITOR Default editor name. .It Ev EXINIT A startup list of commands read by .Xr ex 1 and .Xr vi 1 . .It Ev HOME A user's login directory, set by .Xr login 1 from the password file .Xr passwd 5 . .It Ev LANG This variable configures all programs which use .Xr setlocale 3 to use the specified locale unless the .Ev LC_* variables are set. .It Ev LC_ALL Overrides the values of .Ev LC_COLLATE , .Ev LC_CTYPE , .Ev LC_MESSAGES , .Ev LC_MONETARY , .Ev LC_NUMERIC , .Ev LC_TIME and .Ev LANG . .It Ev LC_COLLATE Locale to be used for ordering of strings. .It Ev LC_CTYPE Locale to be used for character classification (letter, space, digit, etc.) and for interpreting byte sequences as multibyte characters. .It Ev LC_MESSAGES Locale to be used for diagnostic messages. .It Ev LC_MONETARY Locale to be used for interpreting monetary input and formatting output. .It Ev LC_NUMERIC Locale to be used for interpreting numeric input and formatting output. .It Ev LC_TIME Locale to be used for interpreting dates input and for formatting output. .It Ev MAIL The location of the user's mailbox instead of the default in /var/mail, used by .Xr mail 1 , .Xr sh 1 , and many other mail clients. .It Ev MANPATH The sequence of directories, separated by colons, searched by .Xr man 1 when looking for manual pages. .It Ev NLSPATH List of directories to be searched for the message catalog referred to by .Ev LC_MESSAGES . See .Xr catopen 3 . .It Ev PAGER Default paginator program. The program specified by this variable is used by .Xr mail 1 , .Xr man 1 , .Xr ftp 1 , etc, to display information which is longer than the current display. .It Ev PATH The sequence of directories, separated by colons, searched by .Xr csh 1 , .Xr sh 1 , .Xr system 3 , .Xr execvp 3 , etc, when looking for an executable file. .Ev PATH is set to ``/usr/bin:/bin'' initially by .Xr login 1 . .It Ev POSIXLY_CORRECT When set to any value, this environment variable modifies the behaviour of certain commands to (mostly) execute in a strictly POSIX-compliant manner. .It Ev PRINTER The name of the default printer to be used by .Xr lpr 1 , .Xr lpq 1 , and .Xr lprm 1 . .It Ev PWD The current directory pathname. .It Ev SHELL The full pathname of the user's login shell. .It Ev TERM The kind of terminal for which output is to be prepared. This information is used by commands, such as .Xr nroff 1 Pq Pa ports/textproc/groff or .Xr plot 1 which may exploit special terminal capabilities. See .Pa /usr/share/misc/termcap .Pq Xr termcap 5 for a list of terminal types. .It Ev TERMCAP The string describing the terminal in .Ev TERM , or, if it begins with a '/', the name of the termcap file. See .Ev TERMPATH below, and .Xr termcap 5 . .It Ev TERMPATH A sequence of pathnames of termcap files, separated by colons or spaces, which are searched for terminal descriptions in the order listed. Having no .Ev TERMPATH is equivalent to a .Ev TERMPATH of .Pa $HOME/.termcap:/etc/termcap . .Ev TERMPATH is ignored if .Ev TERMCAP contains a full pathname. .It Ev TMPDIR The directory in which to store temporary files. Most applications use either .Pa /tmp or .Pa /var/tmp . Setting this variable will make them use another directory. .It Ev TZ The timezone to use when displaying dates. The normal format is a pathname relative to .Pa /usr/share/zoneinfo . For example, the command .Pp .Dl env TZ=America/Los_Angeles date .Pp displays the current time in California. See .Xr tzset 3 for more information. .It Ev USER The login name of the user. It is recommended that portable applications use .Ev LOGNAME instead. .El .Pp Further names may be placed in the environment by the .Ic export command and .Ar name=value arguments in .Xr sh 1 , or by the .Ic setenv command if you use .Xr csh 1 . It is unwise to change certain .Xr sh 1 variables that are frequently exported by .Pa .profile files, such as .Ev MAIL , .Ev PS1 , .Ev PS2 , and .Ev IFS , unless you know what you are doing. .Pp The current environment variables can be printed with .Xr env 1 , .Xr set 1 or .Xr printenv 1 in .Xr sh 1 and .Xr env 1 , .Xr printenv 1 or the .Cm printenv built-in command in .Xr csh 1 . .Sh SEE ALSO .Xr cd 1 , .Xr csh 1 , .Xr env 1 , .Xr ex 1 , .Xr login 1 , .Xr printenv 1 , .Xr sh 1 , .Xr execve 2 , .Xr execle 3 , .Xr getbsize 3 , .Xr getenv 3 , .Xr setenv 3 , .Xr setlocale 3 , .Xr system 3 , .Xr termcap 3 , -.Xr termcap 5 +.Xr termcap 5 , +.Xr simd 7 .Sh HISTORY The .Nm manual page appeared in .At v7 .