diff --git a/lib/libc/locale/isgraph.3 b/lib/libc/locale/isgraph.3 index 5e06e2e498de..ec304d03b713 100644 --- a/lib/libc/locale/isgraph.3 +++ b/lib/libc/locale/isgraph.3 @@ -1,106 +1,106 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" 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. .\" 4. 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. .\" .\" @(#)isgraph.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" .Dd July 17, 2005 .Dt ISGRAPH 3 .Os .Sh NAME .Nm isgraph .Nd printing character test (space character exclusive) .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isgraph "int c" .Sh DESCRIPTION The .Fn isgraph function tests for any printing character except space -.Pq Ql "\ " +.Pq Ql "\~" and other locale-specific space-like characters. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&041\ ``!'' \t042\ ``""'' \t043\ ``#'' \t044\ ``$'' \t045\ ``%''" .It "\&046\ ``&'' \t047\ ``''' \t050\ ``('' \t051\ ``)'' \t052\ ``*''" .It "\&053\ ``+'' \t054\ ``,'' \t055\ ``-'' \t056\ ``.'' \t057\ ``/''" .It "\&060\ ``0'' \t061\ ``1'' \t062\ ``2'' \t063\ ``3'' \t064\ ``4''" .It "\&065\ ``5'' \t066\ ``6'' \t067\ ``7'' \t070\ ``8'' \t071\ ``9''" .It "\&072\ ``:'' \t073\ ``;'' \t074\ ``<'' \t075\ ``='' \t076\ ``>''" .It "\&077\ ``?'' \t100\ ``@'' \t101\ ``A'' \t102\ ``B'' \t103\ ``C''" .It "\&104\ ``D'' \t105\ ``E'' \t106\ ``F'' \t107\ ``G'' \t110\ ``H''" .It "\&111\ ``I'' \t112\ ``J'' \t113\ ``K'' \t114\ ``L'' \t115\ ``M''" .It "\&116\ ``N'' \t117\ ``O'' \t120\ ``P'' \t121\ ``Q'' \t122\ ``R''" .It "\&123\ ``S'' \t124\ ``T'' \t125\ ``U'' \t126\ ``V'' \t127\ ``W''" .It "\&130\ ``X'' \t131\ ``Y'' \t132\ ``Z'' \t133\ ``['' \t134\ ``\e\|''" .It "\&135\ ``]'' \t136\ ``^'' \t137\ ``_'' \t140\ ```'' \t141\ ``a''" .It "\&142\ ``b'' \t143\ ``c'' \t144\ ``d'' \t145\ ``e'' \t146\ ``f''" .It "\&147\ ``g'' \t150\ ``h'' \t151\ ``i'' \t152\ ``j'' \t153\ ``k''" .It "\&154\ ``l'' \t155\ ``m'' \t156\ ``n'' \t157\ ``o'' \t160\ ``p''" .It "\&161\ ``q'' \t162\ ``r'' \t163\ ``s'' \t164\ ``t'' \t165\ ``u''" .It "\&166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y'' \t172\ ``z''" .It "\&173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" .El .Sh RETURN VALUES The .Fn isgraph function returns zero if the character tests false and returns non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswgraph function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswgraph 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isgraph function conforms to .St -isoC . diff --git a/lib/libc/locale/mbrtowc.3 b/lib/libc/locale/mbrtowc.3 index 10160d1916fd..ae5f5da4b80a 100644 --- a/lib/libc/locale/mbrtowc.3 +++ b/lib/libc/locale/mbrtowc.3 @@ -1,139 +1,139 @@ .\" Copyright (c) 2002-2004 Tim J. Robbins .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd April 8, 2004 .Dt MBRTOWC 3 .Os .Sh NAME .Nm mbrtowc .Nd "convert a character to a wide-character code (restartable)" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In wchar.h .Ft size_t .Fo mbrtowc .Fa "wchar_t * restrict pwc" "const char * restrict s" "size_t n" .Fa "mbstate_t * restrict ps" .Fc .Sh DESCRIPTION The .Fn mbrtowc function inspects at most .Fa n bytes pointed to by .Fa s to determine the number of bytes needed to complete the next multibyte character. If a character can be completed, and .Fa pwc is not .Dv NULL , the wide character which is represented by .Fa s is stored in the .Vt wchar_t it points to. .Pp If .Fa s is .Dv NULL , .Fn mbrtowc behaves as if .Fa pwc was .Dv NULL , .Fa s was an empty string -.Pq Qq +.Pq Qq \& and .Fa n was 1. .Pp The .Vt mbstate_t argument, .Fa ps , is used to keep track of the shift state. If it is .Dv NULL , .Fn mbrtowc uses an internal, static .Vt mbstate_t object, which is initialized to the initial conversion state at program startup. .Sh RETURN VALUES The .Fn mbrtowc functions returns: .Bl -tag -width indent .It 0 The next .Fa n or fewer bytes represent the null wide character .Pq Li "L'\e0'" . .It >0 The next .Fa n or fewer bytes represent a valid character, .Fn mbrtowc returns the number of bytes used to complete the multibyte character. .It Po Vt size_t Pc Ns \-2 The next .Fa n contribute to, but do not complete, a valid multibyte character sequence, and all .Fa n bytes have been processed. .It Po Vt size_t Pc Ns \-1 An encoding error has occurred. The next .Fa n or fewer bytes do not contribute to a valid multibyte character. .El .Sh ERRORS The .Fn mbrtowc function will fail if: .Bl -tag -width Er .It Bq Er EILSEQ An invalid multibyte sequence was detected. .It Bq Er EINVAL The conversion state is invalid. .El .Sh SEE ALSO .Xr mbtowc 3 , .Xr multibyte 3 , .Xr setlocale 3 , .Xr wcrtomb 3 .Sh STANDARDS The .Fn mbrtowc function conforms to .St -isoC-99 . diff --git a/lib/libc/rpc/publickey.3 b/lib/libc/rpc/publickey.3 index d0ad6ccda8fb..64fe080f58b8 100644 --- a/lib/libc/rpc/publickey.3 +++ b/lib/libc/rpc/publickey.3 @@ -1,53 +1,53 @@ .\" @(#)publickey.3r 2.1 88/08/07 4.0 RPCSRC .\" $FreeBSD$ .\" .Dd October 6, 1987 .Dt PUBLICKEY 3 .Os .Sh NAME .Nm publickey , getpublickey , getsecretkey .Nd "get public or secret key" .Sh LIBRARY .Lb librpcsvc .Sh SYNOPSIS .In rpc/rpc.h .In rpc/key_prot.h .Ft int .Fo getpublickey .Fa "const char netname[MAXNETNAMELEN+1]" .Fa "char publickey[HEXKEYBYTES+1]" .Fc .Ft int .Fo getsecretkey .Fa "char netname[MAXNETNAMELEN+1]" .Fa "char secretkey[HEXKEYBYTES+1]" .Fa "char *passwd" .Fc .Sh DESCRIPTION These routines are used to get public and secret keys from the .Tn YP database. The .Fn getsecretkey function has an extra argument, .Fa passwd , which is used to decrypt the encrypted secret key stored in the database. Both routines return 1 if they are successful in finding the key, 0 otherwise. The keys are returned as .Dv NULL Ns \-terminated , hexadecimal strings. If the password supplied to .Fn getsecretkey fails to decrypt the secret key, the routine will return 1 but the .Fa secretkey argument will be a .Dv NULL string -.Pq Dq . +.Pq Dq \& . .Sh SEE ALSO .Xr publickey 5 .Pp .%T "RPC Programmer's Manual" in .Pa /usr/share/doc/psd/23.rpc . diff --git a/lib/libkvm/kvm_getloadavg.3 b/lib/libkvm/kvm_getloadavg.3 index 6587b1a913fc..006bfadc6c2d 100644 --- a/lib/libkvm/kvm_getloadavg.3 +++ b/lib/libkvm/kvm_getloadavg.3 @@ -1,62 +1,62 @@ .\" Copyright (c) 1992, 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. .\" 4. 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. .\" .\" @(#)kvm_getloadavg.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" .Dd June 4, 1993 .Dt KVM_GETLOADAVG 3 .Os .Sh NAME .Nm kvm_getloadavg .Nd get load average of the system .Sh LIBRARY .Lb libkvm .Sh SYNOPSIS .In kvm.h .Ft int .Fn kvm_getloadavg "kvm_t *kd" "double loadavg[]" "int nelem" .Sh DESCRIPTION The .Fn kvm_getloadavg function returns the number of processes in the system run queue of the kernel indicated by .Fa kd , averaged over various periods of time. Up to .Fa nelem samples are retrieved and assigned to successive elements of -.Fa loadavg Ns Bq . +.Fa loadavg Ns Bq \& . The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. .Sh DIAGNOSTICS If the load average was unobtainable, \-1 is returned; otherwise, the number of samples actually retrieved is returned. .Sh SEE ALSO .Xr uptime 1 , .Xr getloadavg 3 , .Xr kvm 3 diff --git a/sys/boot/common/loader.8 b/sys/boot/common/loader.8 index bae2f86ba811..2490e3dcdbea 100644 --- a/sys/boot/common/loader.8 +++ b/sys/boot/common/loader.8 @@ -1,1029 +1,1029 @@ .\" Copyright (c) 1999 Daniel C. Sobral .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd February 15, 2009 .Dt LOADER 8 .Os .Sh NAME .Nm loader .Nd kernel bootstrapping final stage .Sh DESCRIPTION The program called .Nm is the final stage of .Fx Ns 's kernel bootstrapping process. On IA32 (i386) architectures, it is a .Pa BTX client. It is linked statically to .Xr libstand 3 and usually located in the directory .Pa /boot . .Pp It provides a scripting language that can be used to automate tasks, do pre-configuration or assist in recovery procedures. This scripting language is roughly divided in two main components. The smaller one is a set of commands designed for direct use by the casual user, called "builtin commands" for historical reasons. The main drive behind these commands is user-friendliness. The bigger component is an .Tn ANS Forth compatible Forth interpreter based on FICL, by .An John Sadler . .Pp During initialization, .Nm will probe for a console and set the .Va console variable, or set it to serial console .Pq Dq Li comconsole if the previous boot stage used that. If multiple consoles are selected, they will be listed separated by spaces. Then, devices are probed, .Va currdev and .Va loaddev are set, and .Va LINES is set to 24. Next, .Tn FICL is initialized, the builtin words are added to its vocabulary, and .Pa /boot/boot.4th is processed if it exists. No disk switching is possible while that file is being read. The inner interpreter .Nm will use with .Tn FICL is then set to .Ic interpret , which is .Tn FICL Ns 's default. After that, .Pa /boot/loader.rc is processed if available, and, failing that, .Pa /boot/boot.conf is read for historical reasons. These files are processed through the .Ic include command, which reads all of them into memory before processing them, making disk changes possible. .Pp At this point, if an .Ic autoboot has not been tried, and if .Va autoboot_delay is not set to .Dq Li NO (not case sensitive), then an .Ic autoboot will be tried. If the system gets past this point, .Va prompt will be set and .Nm will engage interactive mode. Please note that historically even when .Va autoboot_delay is set to .Dq Li 0 user will be able to interrupt autoboot process by pressing some key on the console while kernel and modules are being loaded. In some cases such behaviour may be undesirable, to prevent it set .Va autoboot_delay to .Dq Li -1 , in this case .Nm will engage interactive mode only if .Ic autoboot has failed. .Sh BUILTIN COMMANDS In .Nm , builtin commands take parameters from the command line. Presently, the only way to call them from a script is by using .Pa evaluate on a string. If an error condition occurs, an exception will be generated, which can be intercepted using .Tn ANS Forth exception handling words. If not intercepted, an error message will be displayed and the interpreter's state will be reset, emptying the stack and restoring interpreting mode. .Pp The builtin commands available are: .Pp .Bl -tag -width Ds -compact .It Ic autoboot Op Ar seconds Op Ar prompt Proceeds to bootstrap the system after a number of seconds, if not interrupted by the user. Displays a countdown prompt warning the user the system is about to be booted, unless interrupted by a key press. The kernel will be loaded first if necessary. Defaults to 10 seconds. .Pp .It Ic bcachestat Displays statistics about disk cache usage. For debugging only. .Pp .It Ic boot .It Ic boot Ar kernelname Op Cm ... .It Ic boot Fl flag Cm ... Immediately proceeds to bootstrap the system, loading the kernel if necessary. Any flags or arguments are passed to the kernel, but they must precede the kernel name, if a kernel name is provided. .Pp .Em WARNING : The behavior of this builtin is changed if .Xr loader.4th 8 is loaded. .Pp .It Ic echo Xo .Op Fl n .Op Aq message .Xc Displays text on the screen. A new line will be printed unless .Fl n is specified. .Pp .It Ic heap Displays memory usage statistics. For debugging purposes only. .Pp .It Ic help Op topic Op subtopic Shows help messages read from .Pa /boot/loader.help . The special topic .Em index will list the topics available. .Pp .It Ic include Ar file Op Ar Process script files. Each file, in turn, is completely read into memory, and then each of its lines is passed to the command line interpreter. If any error is returned by the interpreter, the include command aborts immediately, without reading any other files, and returns an error itself (see .Sx ERRORS ) . .Pp .It Ic load Xo .Op Fl t Ar type .Ar file Cm ... .Xc Loads a kernel, kernel loadable module (kld), or file of opaque contents tagged as being of the type .Ar type . Kernel and modules can be either in a.out or ELF format. Any arguments passed after the name of the file to be loaded will be passed as arguments to that file. Currently, argument passing does not work for the kernel. .Pp .It Ic load_geli Xo .Op Fl n Ar keyno .Ar prov Ar file .Xc Loads a .Xr geli 8 encryption keyfile for the given provider name. The key index can be specified via .Ar keyno or will default to zero. .Pp .It Ic ls Xo .Op Fl l .Op Ar path .Xc Displays a listing of files in the directory .Ar path , or the root directory if .Ar path is not specified. If .Fl l is specified, file sizes will be shown too. .Pp .It Ic lsdev Op Fl v Lists all of the devices from which it may be possible to load modules. If .Fl v is specified, more details are printed. .Pp .It Ic lsmod Op Fl v Displays loaded modules. If .Fl v is specified, more details are shown. .Pp .It Ic more Ar file Op Ar Display the files specified, with a pause at each .Va LINES displayed. .Pp .It Ic pnpscan Op Fl v Scans for Plug-and-Play devices. This is not functional at present. .Pp .It Ic read Xo .Op Fl t Ar seconds .Op Fl p Ar prompt .Op Va variable .Xc Reads a line of input from the terminal, storing it in .Va variable if specified. A timeout can be specified with .Fl t , though it will be canceled at the first key pressed. A prompt may also be displayed through the .Fl p flag. .Pp .It Ic reboot Immediately reboots the system. .Pp .It Ic set Ar variable .It Ic set Ar variable Ns = Ns Ar value Set loader's environment variables. .Pp .It Ic show Op Va variable Displays the specified variable's value, or all variables and their values if .Va variable is not specified. .Pp .It Ic unload Remove all modules from memory. .Pp .It Ic unset Va variable Removes .Va variable from the environment. .Pp .It Ic \&? Lists available commands. .El .Ss BUILTIN ENVIRONMENT VARIABLES The .Nm has actually two different kinds of .Sq environment variables. There are ANS Forth's .Em environmental queries , and a separate space of environment variables used by builtins, which are not directly available to Forth words. It is the latter type that this section covers. .Pp Environment variables can be set and unset through the .Ic set and .Ic unset builtins, and can have their values interactively examined through the use of the .Ic show builtin. Their values can also be accessed as described in .Sx BUILTIN PARSER . .Pp Notice that these environment variables are not inherited by any shell after the system has been booted. .Pp A few variables are set automatically by .Nm . Others can affect the behavior of either .Nm or the kernel at boot. Some options may require a value, while others define behavior just by being set. Both types of builtin variables are described below. .Bl -tag -width bootfile .It Va acpi_load Unset this to disable automatic loading of the ACPI module. See also .Va hint.acpi.0.disabled in .Xr device.hints 5 . .It Va autoboot_delay Number of seconds .Ic autoboot will wait before booting. If this variable is not defined, .Ic autoboot will default to 10 seconds. .Pp If set to .Dq Li NO , no .Ic autoboot will be automatically attempted after processing .Pa /boot/loader.rc , though explicit .Ic autoboot Ns 's will be processed normally, defaulting to 10 seconds delay. .Pp If set to .Dq Li 0 , no delay will be inserted, but user still will be able to interrupt .Ic autoboot process and escape into the interactive mode by pressing some key on the console while kernel and modules are being loaded. .Pp If set to .Dq Li -1 , no delay will be inserted and .Nm will engage interactive mode only if .Ic autoboot has failed for some reason. .It Va boot_askname Instructs the kernel to prompt the user for the name of the root device when the kernel is booted. .It Va boot_cdrom Instructs the kernel to try to mount the root file system from CD-ROM. .It Va boot_ddb Instructs the kernel to start in the DDB debugger, rather than proceeding to initialize when booted. .It Va boot_dfltroot Instructs the kernel to mount the statically compiled-in root file system. .It Va boot_gdb Selects gdb-remote mode for the kernel debugger by default. .It Va boot_multicons Enables multiple console support in the kernel early on boot. In a running system, console configuration can be manipulated by the .Xr conscontrol 8 utility. .It Va boot_mute All console output is suppressed when console is muted. In a running system, the state of console muting can be manipulated by the .Xr conscontrol 8 utility. .It Va boot_pause During the device probe, pause after each line is printed. .It Va boot_serial Force the use of a serial console even when an internal console is present. .It Va boot_single Prevents the kernel from initiating a multi-user startup; instead, a single-user mode will be entered when the kernel has finished device probing. .It Va boot_verbose Setting this variable causes extra debugging information to be printed by the kernel during the boot phase. .It Va bootfile List of semicolon-separated search path for bootable kernels. The default is .Dq Li kernel . .It Va comconsole_speed Defines the speed of the serial console (i386 and amd64 only). If the previous boot stage indicated that a serial console is in use then this variable is initialized to the current speed of the console serial port. Otherwise it is set to 9600 unless this was overridden using the .Va BOOT_COMCONSOLE_SPEED variable when .Nm was compiled. Changes to the .Va comconsole_speed variable take effect immediately. .It Va console Defines the current console or consoles. Multiple consoles may be specified. In that case, the first listed console will become the default console for userland output (e.g.\& from .Xr init 8 ) . .It Va currdev Selects the default device. Syntax for devices is odd. .It Va init_chroot If set to a valid directory in the root file system, it causes .Xr init 8 to perform a .Xr chroot 2 operation on that directory, making it the new root directory. That happens before entering single-user mode or multi-user mode (but after executing the .Va init_script if enabled). .It Va init_path Sets the list of binaries which the kernel will try to run as the initial process. The first matching binary is used. The default list is .Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init:/stand/sysinstall . .It Va init_script If set to a valid file name in the root file system, instructs .Xr init 8 to run that script as the very first action, before doing anything else. Signal handling and exit code interpretation is similar to running the .Pa /etc/rc script. In particular, single-user operation is enforced if the script terminates with a non-zero exit code, or if a SIGTERM is delivered to the .Xr init 8 process (PID 1). .It Va init_shell Defines the shell binary to be used for executing the various shell scripts. The default is .Dq Li /bin/sh . It is used for running the .Va init_script if set, as well as for the .Pa /etc/rc and .Pa /etc/rc.shutdown scripts. The value of the corresponding .Xr kenv 2 variable is evaluated every time .Xr init 8 calls a shell script, so it can be changed later on using the .Xr kenv 1 utility. In particular, if a non-default shell is used for running an .Va init_script , it might be desirable to have that script reset the value of .Va init_shell back to the default, so that the .Pa /etc/rc script is executed with the standard shell .Pa /bin/sh . .It Va interpret Has the value .Dq Li OK if the Forth's current state is interpreting. .It Va LINES Define the number of lines on the screen, to be used by the pager. .It Va module_path Sets the list of directories which will be searched for modules named in a load command or implicitly required by a dependency. The default value for this variable is .Dq Li /boot/kernel;/boot/modules . .It Va num_ide_disks Sets the number of IDE disks as a workaround for some problems in finding the root disk at boot. This has been deprecated in favor of .Va root_disk_unit . .It Va prompt Value of .Nm Ns 's prompt. Defaults to .Dq Li "${interpret}" . If variable .Va prompt is unset, the default prompt is .Ql > . .It Va root_disk_unit If the code which detects the disk unit number for the root disk is confused, e.g.\& by a mix of SCSI and IDE disks, or IDE disks with gaps in the sequence (e.g.\& no primary slave), the unit number can be forced by setting this variable. .It Va rootdev By default the value of .Va currdev is used to set the root file system when the kernel is booted. This can be overridden by setting .Va rootdev explicitly. .El .Pp Other variables are used to override kernel tunable parameters. The following tunables are available: .Bl -tag -width Va .It Va hw.physmem Limit the amount of physical memory the system will use. By default the size is in bytes, but the .Cm k , K , m , M , g and .Cm G suffixes are also accepted and indicate kilobytes, megabytes and gigabytes respectively. An invalid suffix will result in the variable being ignored by the kernel. .It Va hw.pci.host_start_mem , hw.acpi.host_start_mem When not otherwise constrained, this limits the memory start address. The default is 0x80000000 and should be set to at least size of the memory and not conflict with other resources. Typically, only systems without PCI bridges need to set this variable since PCI bridges typically constrain the memory starting address (and the variable is only used when bridges do not constrain this address). .It Va hw.pci.enable_io_modes Enable PCI resources which are left off by some BIOSes or are not enabled correctly by the device driver. Tunable value set to ON (1) by default, but this may cause problems with some peripherals. .It Va kern.maxusers Set the size of a number of statically allocated system tables; see .Xr tuning 7 for a description of how to select an appropriate value for this tunable. When set, this tunable replaces the value declared in the kernel compile-time configuration file. .It Va kern.ipc.nmbclusters Set the number of mbuf clusters to be allocated. The value cannot be set below the default determined when the kernel was compiled. .It Va kern.ipc.nsfbufs Set the number of .Xr sendfile 2 buffers to be allocated. Overrides .Dv NSFBUFS . Not all architectures use such buffers; see .Xr sendfile 2 for details. .It Va kern.maxswzone Limits the amount of KVM to be used to hold swap meta information, which directly governs the maximum amount of swap the system can support. This value is specified in bytes of KVA space and defaults to 32MBytes on i386 and amd64. Care should be taken to not reduce this value such that the actual amount of configured swap exceeds 1/2 the kernel-supported swap. The default of 32MB allows the kernel to support a maximum of ~7GB of swap. Only change this parameter if you need to greatly extend the KVM reservation for other resources such as the buffer cache or .Va kern.ipc.nmbclusters . Modifies kernel option .Dv VM_SWZONE_SIZE_MAX . .It Va kern.maxbcache Limits the amount of KVM reserved for use by the buffer cache, specified in bytes. The default maximum is 200MB on i386, and 400MB on amd64, sparc64, and sun4v. This parameter is used to prevent the buffer cache from eating too much KVM in large-memory machine configurations. Only mess around with this parameter if you need to greatly extend the KVM reservation for other resources such as the swap zone or .Va kern.ipc.nmbclusters . Note that the NBUF parameter will override this limit. Modifies .Dv VM_BCACHE_SIZE_MAX . .It Va machdep.disable_mtrrs Disable the use of i686 MTRRs (x86 only). .It Va net.inet.tcp.tcbhashsize Overrides the compile-time set value of .Dv TCBHASHSIZE or the preset default of 512. Must be a power of 2. .It Va vm.kmem_size Sets the size of kernel memory (bytes). This overrides the value determined when the kernel was compiled. Modifies .Dv VM_KMEM_SIZE . .It Va vm.kmem_size_min .It Va vm.kmem_size_max Sets the minimum and maximum (respectively) amount of kernel memory that will be automatically allocated by the kernel. These override the values determined when the kernel was compiled. Modifies .Dv VM_KMEM_SIZE_MIN and .Dv VM_KMEM_SIZE_MAX . .El .Ss BUILTIN PARSER When a builtin command is executed, the rest of the line is taken by it as arguments, and it is processed by a special parser which is not used for regular Forth commands. .Pp This special parser applies the following rules to the parsed text: .Pp .Bl -enum .It All backslash characters are preprocessed. .Bl -bullet .It \eb , \ef , \er , \en and \et are processed as in C. .It \es is converted to a space. .It \ev is converted to .Tn ASCII 11. .It \ez is just skipped. Useful for things like .Dq \e0xf\ez\e0xf . .It \e0xN and \e0xNN are replaced by the hex N or NN. .It \eNNN is replaced by the octal NNN .Tn ASCII character. .It \e" , \e' and \e$ will escape these characters, preventing them from receiving special treatment in Step 2, described below. .It \e\e will be replaced with a single \e . .It In any other occurrence, backslash will just be removed. .El .It Every string between non-escaped quotes or double-quotes will be treated as a single word for the purposes of the remaining steps. .It Replace any .Li $VARIABLE or .Li ${VARIABLE} with the value of the environment variable .Va VARIABLE . .It Space-delimited arguments are passed to the called builtin command. Spaces can also be escaped through the use of \e\e . .El .Pp An exception to this parsing rule exists, and is described in .Sx BUILTINS AND FORTH . .Ss BUILTINS AND FORTH All builtin words are state-smart, immediate words. If interpreted, they behave exactly as described previously. If they are compiled, though, they extract their arguments from the stack instead of the command line. .Pp If compiled, the builtin words expect to find, at execution time, the following parameters on the stack: .D1 Ar addrN lenN ... addr2 len2 addr1 len1 N where .Ar addrX lenX are strings which will compose the command line that will be parsed into the builtin's arguments. Internally, these strings are concatenated in from 1 to N, with a space put between each one. .Pp If no arguments are passed, a 0 .Em must be passed, even if the builtin accepts no arguments. .Pp While this behavior has benefits, it has its trade-offs. If the execution token of a builtin is acquired (through .Ic ' or .Ic ['] ) , and then passed to .Ic catch or .Ic execute , the builtin behavior will depend on the system state .Bf Em at the time .Ic catch or .Ic execute is processed! .Ef This is particularly annoying for programs that want or need to handle exceptions. In this case, the use of a proxy is recommended. For example: .Dl : (boot) boot ; .Sh FICL .Tn FICL is a Forth interpreter written in C, in the form of a forth virtual machine library that can be called by C functions and vice versa. .Pp In .Nm , each line read interactively is then fed to .Tn FICL , which may call .Nm back to execute the builtin words. The builtin .Ic include will also feed .Tn FICL , one line at a time. .Pp The words available to .Tn FICL can be classified into four groups. The .Tn ANS Forth standard words, extra .Tn FICL words, extra .Fx words, and the builtin commands; the latter were already described. The .Tn ANS Forth standard words are listed in the .Sx STANDARDS section. The words falling in the two other groups are described in the following subsections. .Ss FICL EXTRA WORDS .Bl -tag -width wid-set-super .It Ic .env .It Ic .ver .It Ic -roll .It Ic 2constant .It Ic >name .It Ic body> .It Ic compare This is the STRING word set's .Ic compare . .It Ic compile-only .It Ic endif .It Ic forget-wid .It Ic parse-word .It Ic sliteral This is the STRING word set's .Ic sliteral . .It Ic wid-set-super .It Ic w@ .It Ic w! .It Ic x. .It Ic empty .It Ic cell- .It Ic -rot .El .Ss FREEBSD EXTRA WORDS .Bl -tag -width XXXXXXXX .It Ic \&$ Pq -- Evaluates the remainder of the input buffer, after having printed it first. .It Ic \&% Pq -- Evaluates the remainder of the input buffer under a .Ic catch exception guard. .It Ic .# Works like -.Ic . +.Ic "." but without outputting a trailing space. .It Ic fclose Pq Ar fd -- Closes a file. .It Ic fkey Pq Ar fd -- char Reads a single character from a file. .It Ic fload Pq Ar fd -- Processes a file .Em fd . .It Ic fopen Pq Ar addr len mode Li -- Ar fd Opens a file. Returns a file descriptor, or \-1 in case of failure. The .Ar mode parameter selects whether the file is to be opened for read access, write access, or both. The constants .Dv O_RDONLY , O_WRONLY , and .Dv O_RDWR are defined in .Pa /boot/support.4th , indicating read only, write only, and read-write access, respectively. .It Xo .Ic fread .Pq Ar fd addr len -- len' .Xc Tries to read .Em len bytes from file .Em fd into buffer .Em addr . Returns the actual number of bytes read, or -1 in case of error or end of file. .It Ic heap? Pq -- Ar cells Return the space remaining in the dictionary heap, in cells. This is not related to the heap used by dynamic memory allocation words. .It Ic inb Pq Ar port -- char Reads a byte from a port. .It Ic key Pq -- Ar char Reads a single character from the console. .It Ic key? Pq -- Ar flag Returns .Ic true if there is a character available to be read from the console. .It Ic ms Pq Ar u -- Waits .Em u microseconds. .It Ic outb Pq Ar port char -- Writes a byte to a port. .It Ic seconds Pq -- Ar u Returns the number of seconds since midnight. .It Ic tib> Pq -- Ar addr len Returns the remainder of the input buffer as a string on the stack. .It Ic trace! Pq Ar flag -- Activates or deactivates tracing. Does not work with .Ic catch . .El .Ss FREEBSD DEFINED ENVIRONMENTAL QUERIES .Bl -tag -width Ds .It arch-i386 .Ic TRUE if the architecture is IA32. .It FreeBSD_version .Fx version at compile time. .It loader_version .Nm version. .El .Ss SYSTEM DOCUMENTATION .Sh FILES .Bl -tag -width /boot/defaults/loader.conf -compact .It Pa /boot/loader .Nm itself. .It Pa /boot/boot.4th Additional .Tn FICL initialization. .It Pa /boot/boot.conf .Nm bootstrapping script. Deprecated. .It Pa /boot/defaults/loader.conf .It Pa /boot/loader.conf .It Pa /boot/loader.conf.local .Nm configuration files, as described in .Xr loader.conf 5 . .It Pa /boot/loader.rc .Nm bootstrapping script. .It Pa /boot/loader.help Loaded by .Ic help . Contains the help messages. .El .Sh EXAMPLES Boot in single user mode: .Pp .Dl boot -s .Pp Load the kernel, a splash screen, and then autoboot in five seconds. Notice that a kernel must be loaded before any other .Ic load command is attempted. .Bd -literal -offset indent load kernel load splash_bmp load -t splash_image_data /boot/chuckrulez.bmp autoboot 5 .Ed .Pp Set the disk unit of the root device to 2, and then boot. This would be needed in a system with two IDE disks, with the second IDE disk hardwired to wd2 instead of wd1. .Bd -literal -offset indent set root_disk_unit=2 boot /kernel .Ed .Pp See also: .Bl -tag -width /usr/share/examples/bootforth/X .It Pa /boot/loader.4th Extra builtin-like words. .It Pa /boot/support.4th .Pa loader.conf processing words. .It Pa /usr/share/examples/bootforth/ Assorted examples. .El .Sh ERRORS The following values are thrown by .Nm : .Bl -tag -width XXXXX -offset indent .It 100 Any type of error in the processing of a builtin. .It -1 .Ic Abort executed. .It -2 .Ic Abort" executed. .It -56 .Ic Quit executed. .It -256 Out of interpreting text. .It -257 Need more text to succeed -- will finish on next run. .It -258 .Ic Bye executed. .It -259 Unspecified error. .El .Sh SEE ALSO .Xr libstand 3 , .Xr loader.conf 5 , .Xr tuning 7 , .Xr boot 8 , .Xr btxld 8 .Sh STANDARDS For the purposes of ANS Forth compliance, loader is an .Bf Em ANS Forth System with Environmental Restrictions, Providing .Ef .Bf Li .No .( , .No :noname , .No ?do , parse, pick, roll, refill, to, value, \e, false, true, .No <> , .No 0<> , compile\&, , erase, nip, tuck .Ef .Em and .Li marker .Bf Em from the Core Extensions word set, Providing the Exception Extensions word set, Providing the Locals Extensions word set, Providing the Memory-Allocation Extensions word set, Providing .Ef .Bf Li \&.s, bye, forget, see, words, \&[if], \&[else] .Ef .Em and .Li [then] .Bf Em from the Programming-Tools extension word set, Providing the Search-Order extensions word set. .Ef .Sh HISTORY The .Nm first appeared in .Fx 3.1 . .Sh AUTHORS .An -nosplit The .Nm was written by .An Michael Smith Aq msmith@FreeBSD.org . .Pp .Tn FICL was written by .An John Sadler Aq john_sadler@alum.mit.edu . .Sh BUGS The .Ic expect and .Ic accept words will read from the input buffer instead of the console. The latter will be fixed, but the former will not. diff --git a/usr.bin/c89/c89.1 b/usr.bin/c89/c89.1 index 82acf37fbca7..a31422648d0f 100644 --- a/usr.bin/c89/c89.1 +++ b/usr.bin/c89/c89.1 @@ -1,184 +1,184 @@ .\" .\" Copyright (c) 1997 Joerg Wunsch .\" .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" .\" $FreeBSD$ .\" .Dd September 17, 1997 .Dt C89 1 .Os .Sh NAME .Nm c89 .Nd POSIX.2 C language compiler .Sh SYNOPSIS .Nm .Op Fl cEgOs .Oo Fl D Ar name Ns Oo = Ns Ar value Oc Oc ... .Oo Fl I Ar directory Oc ... .Oo Fl L Ar directory Oc ... .Op Fl o Ar outfile .Oo Fl U Ar name Oc ... .Ar operand ... .Sh DESCRIPTION This is the name of the C language compiler as required by the .St -p1003.2 standard. .Pp The .Nm compiler accepts the following options: .Bl -tag -width indent .It Fl c Suppress the link-edit phase of the compilation, and do not remove any object files that are produced. .It Fl D Ar name Ns Op = Ns Ar value Define name as if by a C-language .Ic #define directive. If no .Dq = Ns Ar value is given, a value of 1 will be used. Note that in order to request a translation as specified by .St -p1003.2 you need to define .Dv _POSIX_SOURCE either in the source or using this option. The .Fl D option has lower precedence than the .Fl U option. That is, if .Ar name is used in both a .Fl U and a .Fl D option, .Ar name will be undefined regardless of the order of the options. The .Fl D option may be specified more than once. .It Fl E Copy C-language source files to the standard output, expanding all preprocessor directives; no compilation will be performed. .It Fl g Produce symbolic information in the object or executable files. .It Fl I Ar directory Change the algorithm for searching for headers whose names are not absolute pathnames to look in the directory named by the .Ar directory pathname before looking in the usual places. Thus, headers whose names are enclosed in double-quotes -.Pq Qq +.Pq Qq \& will be searched for first in the directory of the file with the .Ic #include line, then in directories named in .Fl I options, and last in the usual places. For headers whose names are enclosed in angle brackets -.Pq Aq , +.Pq Aq \& , the header will be searched for only in directories named in .Fl I options and then in the usual places. Directories named in .Fl I options shall be searched in the order specified. The .Fl I option may be specified more than once. .It Fl L Ar directory Change the algorithm of searching for the libraries named in the .Fl l objects to look in the directory named by the .Ar directory pathname before looking in the usual places. Directories named in .Fl L options will be searched in the order specified. The .Fl L option may be specified more than once. .It Fl o Ar outfile Use the pathname .Ar outfile , instead of the default .Pa a.out , for the executable file produced. .It Fl O Optimize the compilation. .It Fl s Produce object and/or executable files from which symbolic and other information not required for proper execution has been removed (stripped). .It Fl U Ar name Remove any initial definition of .Ar name . The .Fl U option may be specified more than once. .El .Pp An operand is either in the form of a pathname or the form .Fl l library. At least one operand of the pathname form needs to be specified. Supported operands are of the form: .Bl -tag -offset indent -width ".Fl l Ar library" .It Ar file Ns Pa .c A C-language source file to be compiled and optionally linked. The operand must be of this form if the .Fl c option is used. .It Ar file Ns Pa .a A library of object files, as produced by .Xr ar 1 , passed directly to the link editor. .It Ar file Ns Pa .o An object file produced by .Nm Fl c , and passed directly to the link editor. .It Fl l Ar library Search the library named .Pa lib Ns Ar library Ns Pa .a . A library will be searched when its name is encountered, so the placement of a .Fl l operand is significant. .El .Sh SEE ALSO .Xr ar 1 , .Xr c99 1 , .Xr cc 1 .Sh STANDARDS The .Nm utility is believed to comply with .St -p1003.2 . diff --git a/usr.bin/c99/c99.1 b/usr.bin/c99/c99.1 index 36864956cc1e..2e36771d43bf 100644 --- a/usr.bin/c99/c99.1 +++ b/usr.bin/c99/c99.1 @@ -1,199 +1,199 @@ .\" .\" Copyright (c) 1997 Joerg Wunsch .\" .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" .\" From FreeBSD: src/usr.bin/c89/c89.1,v 1.11 2007/03/10 07:10:01 ru Exp .\" $FreeBSD$ .\" .Dd June 17, 2010 .Dt C99 1 .Os .Sh NAME .Nm c99 .Nd standard C language compiler .Sh SYNOPSIS .Nm .Op Fl cEgs .Oo Fl D Ar name Ns Oo = Ns Ar value Oc Oc ... .Oo Fl I Ar directory Oc ... .Oo Fl L Ar directory Oc ... .Op Fl o Ar outfile .Op Fl O Ar optlevel .Oo Fl U Ar name Oc ... .Ar operand ... .Sh DESCRIPTION This is the name of the C language compiler as required by the .St -p1003.1-2001 standard. .Pp The .Nm compiler accepts the following options: .Bl -tag -width indent .It Fl c Suppress the link-edit phase of the compilation, and do not remove any object files that are produced. .It Fl D Ar name Ns Op = Ns Ar value Define name as if by a C-language .Ic #define directive. If no .Dq = Ns Ar value is given, a value of 1 will be used. Note that in order to request a translation as specified by .St -p1003.1-2001 , you need to define .Dv _POSIX_C_SOURCE=200112L either in the source or using this option. The .Fl D option has lower precedence than the .Fl U option. That is, if .Ar name is used in both a .Fl U and a .Fl D option, .Ar name will be undefined regardless of the order of the options. The .Fl D option may be specified more than once. .It Fl E Copy C-language source files to the standard output, expanding all preprocessor directives; no compilation will be performed. .It Fl g Produce symbolic information in the object or executable files. .It Fl I Ar directory Change the algorithm for searching for headers whose names are not absolute pathnames to look in the directory named by the .Ar directory pathname before looking in the usual places. Thus, headers whose names are enclosed in double-quotes -.Pq Qq +.Pq Qq \& will be searched for first in the directory of the file with the .Ic #include line, then in directories named in .Fl I options, and last in the usual places. For headers whose names are enclosed in angle brackets -.Pq Aq , +.Pq Aq \& , the header will be searched for only in directories named in .Fl I options and then in the usual places. Directories named in .Fl I options shall be searched in the order specified. The .Fl I option may be specified more than once. .It Fl L Ar directory Change the algorithm of searching for the libraries named in the .Fl l objects to look in the directory named by the .Ar directory pathname before looking in the usual places. Directories named in .Fl L options will be searched in the order specified. The .Fl L option may be specified more than once. .It Fl o Ar outfile Use the pathname .Ar outfile , instead of the default .Pa a.out , for the executable file produced. .It Fl O Ar optlevel If .Ar optlevel is zero, disable all optimizations. Otherwise, enable optimizations at the specified level. .It Fl s Produce object and/or executable files from which symbolic and other information not required for proper execution has been removed (stripped). .It Fl U Ar name Remove any initial definition of .Ar name . The .Fl U option may be specified more than once. .El .Pp An operand is either in the form of a pathname or the form .Fl l library. At least one operand of the pathname form needs to be specified. Supported operands are of the form: .Bl -tag -offset indent -width ".Fl l Ar library" .It Ar file Ns Pa .c A C-language source file to be compiled and optionally linked. The operand must be of this form if the .Fl c option is used. .It Ar file Ns Pa .a A library of object files, as produced by .Xr ar 1 , passed directly to the link editor. .It Ar file Ns Pa .o An object file produced by .Nm Fl c , and passed directly to the link editor. .It Fl l Ar library Search the library named .Pa lib Ns Ar library Ns Pa .a . A library will be searched when its name is encountered, so the placement of a .Fl l operand is significant. .El .Sh SEE ALSO .Xr ar 1 , .Xr c89 1 , .Xr cc 1 , .Xr c99 7 .Sh STANDARDS The .Nm utility interface conforms to .St -p1003.1-2001 . Since it is a wrapper around .Tn GCC , it is limited to the .Tn C99 features that .Tn GCC actually implements. See .Pa http://gcc.gnu.org/gcc-4.2/c99status.html . diff --git a/usr.bin/tar/bsdtar.1 b/usr.bin/tar/bsdtar.1 index 81b3c41ba495..4eaf64efb7de 100644 --- a/usr.bin/tar/bsdtar.1 +++ b/usr.bin/tar/bsdtar.1 @@ -1,1029 +1,1029 @@ .\" Copyright (c) 2003-2007 Tim Kientzle .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd Oct 12, 2009 .Dt BSDTAR 1 .Os .Sh NAME .Nm tar .Nd manipulate tape archives .Sh SYNOPSIS .Nm .Op Ar bundled-flags Ao args Ac .Op Ao Ar file Ac | Ao Ar pattern Ac ... .Nm .Brq Fl c .Op Ar options .Op Ar files | Ar directories .Nm .Brq Fl r | Fl u .Fl f Ar archive-file .Op Ar options .Op Ar files | Ar directories .Nm .Brq Fl t | Fl x .Op Ar options .Op Ar patterns .Sh DESCRIPTION .Nm creates and manipulates streaming archive files. This implementation can extract from tar, pax, cpio, zip, jar, ar, xar, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, zip, and shar archives. .Pp The first synopsis form shows a .Dq bundled option word. This usage is provided for compatibility with historical implementations. See COMPATIBILITY below for details. .Pp The other synopsis forms show the preferred usage. The first option to .Nm is a mode indicator from the following list: .Bl -tag -compact -width indent .It Fl c Create a new archive containing the specified items. The long option form is .Fl Fl create . .It Fl r Like .Fl c , but new entries are appended to the archive. Note that this only works on uncompressed archives stored in regular files. The .Fl f option is required. The long option form is .Fl Fl append . .It Fl t List archive contents to stdout. The long option form is .Fl Fl list . .It Fl u Like .Fl r , but new entries are added only if they have a modification date newer than the corresponding entry in the archive. Note that this only works on uncompressed archives stored in regular files. The .Fl f option is required. The long form is .Fl Fl update . .It Fl x Extract to disk from the archive. If a file with the same name appears more than once in the archive, each copy will be extracted, with later copies overwriting (replacing) earlier copies. The long option form is .Fl Fl extract . .El .Pp In .Fl c , .Fl r , or .Fl u mode, each specified file or directory is added to the archive in the order specified on the command line. By default, the contents of each directory are also archived. .Pp In extract or list mode, the entire command line is read and parsed before the archive is opened. The pathnames or patterns on the command line indicate which items in the archive should be processed. Patterns are shell-style globbing patterns as documented in .Xr tcsh 1 . .Sh OPTIONS Unless specifically stated otherwise, options are applicable in all operating modes. .Bl -tag -width indent .It Cm @ Ns Pa archive (c and r mode only) The specified archive is opened and the entries in it will be appended to the current archive. As a simple example, .Dl Nm Fl c Fl f Pa - Pa newfile Cm @ Ns Pa original.tar writes a new archive to standard output containing a file .Pa newfile and all of the entries from .Pa original.tar . In contrast, .Dl Nm Fl c Fl f Pa - Pa newfile Pa original.tar creates a new archive with only two entries. Similarly, .Dl Nm Fl czf Pa - Fl Fl format Cm pax Cm @ Ns Pa - reads an archive from standard input (whose format will be determined automatically) and converts it into a gzip-compressed pax-format archive on stdout. In this way, .Nm can be used to convert archives from one format to another. .It Fl B , Fl Fl read-full-blocks Ignored for compatibility with other .Xr tar 1 implementations. .It Fl b Ar blocksize , Fl Fl block-size Ar blocksize Specify the block size, in 512-byte records, for tape drive I/O. As a rule, this argument is only needed when reading from or writing to tape drives, and usually not even then as the default block size of 20 records (10240 bytes) is very common. .It Fl C Ar directory In c and r mode, this changes the directory before adding the following files. In x mode, change directories after opening the archive but before extracting entries from the archive. .It Fl Fl chroot (x mode only) .Fn chroot to the current directory after processing any .Fl C options and before extracting any files. .It Fl Fl disable-copyfile Mac OS X specific. Disable the use of .Xr copyfile 3 . .It Fl Fl exclude Ar pattern Do not process files or directories that match the specified pattern. Note that exclusions take precedence over patterns or filenames specified on the command line. .It Fl Fl format Ar format (c, r, u mode only) Use the specified format for the created archive. Supported formats include .Dq cpio , .Dq pax , .Dq shar , and .Dq ustar . Other formats may also be supported; see .Xr libarchive-formats 5 for more information about currently-supported formats. In r and u modes, when extending an existing archive, the format specified here must be compatible with the format of the existing archive on disk. .It Fl f Ar file , Fl Fl file Ar file Read the archive from or write the archive to the specified file. The filename can be .Pa - for standard input or standard output. The default varies by system; on .Fx , the default is .Pa /dev/sa0 ; on Linux, the default is .Pa /dev/st0 . .It Fl Fl gid Ar id Use the provided group id number. On extract, this overrides the group id in the archive; the group name in the archive will be ignored. On create, this overrides the group id read from disk; if .Fl Fl gname is not also specified, the group name will be set to match the group id. .It Fl Fl gname Ar name Use the provided group name. On extract, this overrides the group name in the archive; if the provided group name does not exist on the system, the group id (from the archive or from the .Fl Fl gid option) will be used instead. On create, this sets the group name that will be stored in the archive; the name will not be verified against the system group database. .It Fl H (c and r mode only) Symbolic links named on the command line will be followed; the target of the link will be archived, not the link itself. .It Fl h (c and r mode only) Synonym for .Fl L . .It Fl I Synonym for .Fl T . .It Fl Fl help Show usage. .It Fl Fl include Ar pattern Process only files or directories that match the specified pattern. Note that exclusions specified with .Fl Fl exclude take precedence over inclusions. If no inclusions are explicitly specified, all entries are processed by default. The .Fl Fl include option is especially useful when filtering archives. For example, the command .Dl Nm Fl c Fl f Pa new.tar Fl Fl include='*foo*' Cm @ Ns Pa old.tgz creates a new archive .Pa new.tar containing only the entries from .Pa old.tgz containing the string .Sq foo . .It Fl J , Fl Fl xz (c mode only) Compress the resulting archive with .Xr xz 1 . In extract or list modes, this option is ignored. Note that, unlike other .Nm tar implementations, this implementation recognizes XZ compression automatically when reading archives. .It Fl j , Fl Fl bzip , Fl Fl bzip2 , Fl Fl bunzip2 (c mode only) Compress the resulting archive with .Xr bzip2 1 . In extract or list modes, this option is ignored. Note that, unlike other .Nm tar implementations, this implementation recognizes bzip2 compression automatically when reading archives. .It Fl k , Fl Fl keep-old-files (x mode only) Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. .It Fl Fl keep-newer-files (x mode only) Do not overwrite existing files that are newer than the versions appearing in the archive being extracted. .It Fl L , Fl Fl dereference (c and r mode only) All symbolic links will be followed. Normally, symbolic links are archived as such. With this option, the target of the link will be archived instead. .It Fl l , Fl Fl check-links (c and r modes only) Issue a warning message unless all links to each file are archived. .It Fl Fl lzma (c mode only) Compress the resulting archive with the original LZMA algorithm. Use of this option is discouraged and new archives should be created with .Fl Fl xz instead. Note that, unlike other .Nm tar implementations, this implementation recognizes LZMA compression automatically when reading archives. .It Fl m , Fl Fl modification-time (x mode only) Do not extract modification time. By default, the modification time is set to the time stored in the archive. .It Fl n , Fl Fl norecurse , Fl Fl no-recursion (c, r, u modes only) Do not recursively archive the contents of directories. .It Fl Fl newer Ar date (c, r, u modes only) Only include files and directories newer than the specified date. This compares ctime entries. .It Fl Fl newer-mtime Ar date (c, r, u modes only) Like .Fl Fl newer , except it compares mtime entries instead of ctime entries. .It Fl Fl newer-than Pa file (c, r, u modes only) Only include files and directories newer than the specified file. This compares ctime entries. .It Fl Fl newer-mtime-than Pa file (c, r, u modes only) Like .Fl Fl newer-than , except it compares mtime entries instead of ctime entries. .It Fl Fl nodump (c and r modes only) Honor the nodump file flag by skipping this file. .It Fl Fl null (use with .Fl I or .Fl T ) Filenames or patterns are separated by null characters, not by newlines. This is often used to read filenames output by the .Fl print0 option to .Xr find 1 . .It Fl Fl no-same-owner (x mode only) Do not extract owner and group IDs. This is the reverse of .Fl Fl same-owner and the default behavior if .Nm is run as non-root. .It Fl Fl no-same-permissions (x mode only) Do not extract full permissions (SGID, SUID, sticky bit, ACLs, extended attributes or extended file flags). This is the reverse of .Fl p and the default behavior if .Nm is run as non-root. .It Fl Fl numeric-owner This is equivalent to .Fl Fl uname -.Qq +.Qq \& .Fl Fl gname -.Qq . +.Qq \& . On extract, it causes user and group names in the archive to be ignored in favor of the numeric user and group ids. On create, it causes user and group names to not be stored in the archive. .It Fl O , Fl Fl to-stdout (x, t modes only) In extract (-x) mode, files will be written to standard out rather than being extracted to disk. In list (-t) mode, the file listing will be written to stderr rather than the usual stdout. .It Fl o (x mode) Use the user and group of the user running the program rather than those specified in the archive. Note that this has no significance unless .Fl p is specified, and the program is being run by the root user. In this case, the file modes and flags from the archive will be restored, but ACLs or owner information in the archive will be discarded. .It Fl o (c, r, u mode) A synonym for .Fl Fl format Ar ustar .It Fl Fl one-file-system (c, r, and u modes) Do not cross mount points. .It Fl Fl options Ar options Select optional behaviors for particular modules. The argument is a text string containing comma-separated keywords and values. These are passed to the modules that handle particular formats to control how those formats will behave. Each option has one of the following forms: .Bl -tag -compact -width indent .It Ar key=value The key will be set to the specified value in every module that supports it. Modules that do not support this key will ignore it. .It Ar key The key will be enabled in every module that supports it. This is equivalent to .Ar key Ns Cm =1 . .It Ar !key The key will be disabled in every module that supports it. .It Ar module:key=value , Ar module:key , Ar module:!key As above, but the corresponding key and value will be provided only to modules whose name matches .Ar module . .El The currently supported modules and keys are: .Bl -tag -compact -width indent .It Cm iso9660:joliet Support Joliet extensions. This is enabled by default, use .Cm !joliet or .Cm iso9660:!joliet to disable. .It Cm iso9660:rockridge Support Rock Ridge extensions. This is enabled by default, use .Cm !rockridge or .Cm iso9660:!rockridge to disable. .It Cm gzip:compression-level A decimal integer from 0 to 9 specifying the gzip compression level. .It Cm xz:compression-level A decimal integer from 0 to 9 specifying the xz compression level. .It Cm mtree: Ns Ar keyword The mtree writer module allows you to specify which mtree keywords will be included in the output. Supported keywords include: .Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent , .Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 , .Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname . The default is equivalent to: .Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname . .It Cm mtree:all Enables all of the above keywords. You can also use .Cm mtree:!all to disable all keywords. .It Cm mtree:use-set Enable generation of .Cm /set lines in the output. .It Cm mtree:indent Produce human-readable output by indenting options and splitting lines to fit into 80 columns. .It Cm zip:compression Ns = Ns Ar type Use .Ar type as compression method. Supported values are store (uncompressed) and deflate (gzip algorithm). .El If a provided option is not supported by any module, that is a fatal error. .It Fl P , Fl Fl absolute-paths Preserve pathnames. By default, absolute pathnames (those that begin with a / character) have the leading slash removed both when creating archives and extracting from them. Also, .Nm will refuse to extract archive entries whose pathnames contain .Pa .. or whose target directory would be altered by a symlink. This option suppresses these behaviors. .It Fl p , Fl Fl insecure , Fl Fl preserve-permissions (x mode only) Preserve file permissions. Attempt to restore the full permissions, including owner, file modes, file flags and ACLs, if available, for each item extracted from the archive. This is the default, if .Nm is being run by root and can be overriden by also specifying .Fl Fl no-same-owner and .Fl Fl no-same-permissions . .It Fl Fl posix (c, r, u mode only) Synonym for .Fl Fl format Ar pax .It Fl q , Fl Fl fast-read (x and t mode only) Extract or list only the first archive entry that matches each pattern or filename operand. Exit as soon as each specified pattern or filename has been matched. By default, the archive is always read to the very end, since there can be multiple entries with the same name and, by convention, later entries overwrite earlier entries. This option is provided as a performance optimization. .It Fl S (x mode only) Extract files as sparse files. For every block on disk, check first if it contains only NULL bytes and seek over it otherwise. This works similar to the conv=sparse option of dd. .It Fl Fl same-owner (x mode only) Extract owner and group IDs. This is the reverse of .Fl Fl no-same-owner and the default behavior if .Nm is run as root. .It Fl Fl strip-components Ar count (x mode only) Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after checking inclusion/exclusion patterns but before security checks. .It Fl s Ar pattern Modify file or archive member names according to .Pa pattern . The pattern has the format .Ar /old/new/ Ns Op gps where .Ar old is a basic regular expression, .Ar new is the replacement string of the matched part, and the optional trailing letters modify how the replacement is handled. If .Ar old is not matched, the pattern is skipped. Within .Ar new , ~ is substituted with the match, \e1 to \e9 with the content of the corresponding captured group. The optional trailing g specifies that matching should continue after the matched part and stopped on the first unmatched pattern. The optional trailing s specifies that the pattern applies to the value of symbolic links. The optional trailing p specifies that after a successful substitution the original path name and the new path name should be printed to standard error. .It Fl T Ar filename , Fl Fl files-from Ar filename In x or t mode, .Nm will read the list of names to be extracted from .Pa filename . In c mode, .Nm will read names to be archived from .Pa filename . The special name .Dq -C on a line by itself will cause the current directory to be changed to the directory specified on the following line. Names are terminated by newlines unless .Fl Fl null is specified. Note that .Fl Fl null also disables the special handling of lines containing .Dq -C . .It Fl Fl totals (c, r, u mode only) After archiving all files, print a summary to stderr. .It Fl U , Fl Fl unlink , Fl Fl unlink-first (x mode only) Unlink files before creating them. This can be a minor performance optimization if most files already exist, but can make things slower if most files do not already exist. This flag also causes .Nm to remove intervening directory symlinks instead of reporting an error. See the SECURITY section below for more details. .It Fl Fl uid Ar id Use the provided user id number and ignore the user name from the archive. On create, if .Fl Fl uname is not also specified, the user name will be set to match the user id. .It Fl Fl uname Ar name Use the provided user name. On extract, this overrides the user name in the archive; if the provided user name does not exist on the system, it will be ignored and the user id (from the archive or from the .Fl Fl uid option) will be used instead. On create, this sets the user name that will be stored in the archive; the name is not verified against the system user database. .It Fl Fl use-compress-program Ar program Pipe the input (in x or t mode) or the output (in c mode) through .Pa program instead of using the builtin compression support. .It Fl v , Fl Fl verbose Produce verbose output. In create and extract modes, .Nm will list each file name as it is read from or written to the archive. In list mode, .Nm will produce output similar to that of .Xr ls 1 . Additional .Fl v options will provide additional detail. .It Fl Fl version Print version of .Nm and .Nm libarchive , and exit. .It Fl w , Fl Fl confirmation , Fl Fl interactive Ask for confirmation for every action. .It Fl X Ar filename , Fl Fl exclude-from Ar filename Read a list of exclusion patterns from the specified file. See .Fl Fl exclude for more information about the handling of exclusions. .It Fl y (c mode only) Compress the resulting archive with .Xr bzip2 1 . In extract or list modes, this option is ignored. Note that, unlike other .Nm tar implementations, this implementation recognizes bzip2 compression automatically when reading archives. .It Fl Z , Fl Fl compress , Fl Fl uncompress (c mode only) Compress the resulting archive with .Xr compress 1 . In extract or list modes, this option is ignored. Note that, unlike other .Nm tar implementations, this implementation recognizes compress compression automatically when reading archives. .It Fl z , Fl Fl gunzip , Fl Fl gzip (c mode only) Compress the resulting archive with .Xr gzip 1 . In extract or list modes, this option is ignored. Note that, unlike other .Nm tar implementations, this implementation recognizes gzip compression automatically when reading archives. .El .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : .Bl -tag -width ".Ev BLOCKSIZE" .It Ev LANG The locale to use. See .Xr environ 7 for more information. .It Ev TAPE The default device. The .Fl f option overrides this. Please see the description of the .Fl f option above for more details. .It Ev TZ The timezone to use when displaying dates. See .Xr environ 7 for more information. .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES The following creates a new archive called .Ar file.tar.gz that contains two files .Ar source.c and .Ar source.h : .Dl Nm Fl czf Pa file.tar.gz Pa source.c Pa source.h .Pp To view a detailed table of contents for this archive: .Dl Nm Fl tvf Pa file.tar.gz .Pp To extract all entries from the archive on the default tape drive: .Dl Nm Fl x .Pp To examine the contents of an ISO 9660 cdrom image: .Dl Nm Fl tf Pa image.iso .Pp To move file hierarchies, invoke .Nm as .Dl Nm Fl cf Pa - Fl C Pa srcdir\ . | Nm Fl xpf Pa - Fl C Pa destdir or more traditionally .Dl cd srcdir \&; Nm Fl cf Pa -\ . | ( cd destdir \&; Nm Fl xpf Pa - ) .Pp In create mode, the list of files and directories to be archived can also include directory change instructions of the form .Cm -C Ns Pa foo/baz and archive inclusions of the form .Cm @ Ns Pa archive-file . For example, the command line .Dl Nm Fl c Fl f Pa new.tar Pa foo1 Cm @ Ns Pa old.tgz Cm -C Ns Pa /tmp Pa foo2 will create a new archive .Pa new.tar . .Nm will read the file .Pa foo1 from the current directory and add it to the output archive. It will then read each entry from .Pa old.tgz and add those entries to the output archive. Finally, it will switch to the .Pa /tmp directory and add .Pa foo2 to the output archive. .Pp An input file in .Xr mtree 5 format can be used to create an output archive with arbitrary ownership, permissions, or names that differ from existing data on disk: .Pp .Dl $ cat input.mtree .Dl #mtree .Dl usr/bin uid=0 gid=0 mode=0755 type=dir .Dl usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls .Dl $ tar -cvf output.tar @input.mtree .Pp The .Fl Fl newer and .Fl Fl newer-mtime switches accept a variety of common date and time specifications, including .Dq 12 Mar 2005 7:14:29pm , .Dq 2005-03-12 19:14 , .Dq 5 minutes ago , and .Dq 19:14 PST May 1 . .Pp The .Fl Fl options argument can be used to control various details of archive generation or reading. For example, you can generate mtree output which only contains .Cm type , Cm time , and .Cm uid keywords: .Dl Nm Fl cf Pa file.tar Fl Fl format=mtree Fl Fl options='!all,type,time,uid' Pa dir or you can set the compression level used by gzip or xz compression: .Dl Nm Fl czf Pa file.tar Fl Fl options='compression-level=9' . For more details, see the explanation of the .Fn archive_read_set_options and .Fn archive_write_set_options API calls that are described in .Xr archive_read 3 and .Xr archive_write 3 . .Sh COMPATIBILITY The bundled-arguments format is supported for compatibility with historic implementations. It consists of an initial word (with no leading - character) in which each character indicates an option. Arguments follow as separate words. The order of the arguments must match the order of the corresponding characters in the bundled command word. For example, .Dl Nm Cm tbf 32 Pa file.tar specifies three flags .Cm t , .Cm b , and .Cm f . The .Cm b and .Cm f flags both require arguments, so there must be two additional items on the command line. The .Ar 32 is the argument to the .Cm b flag, and .Ar file.tar is the argument to the .Cm f flag. .Pp The mode options c, r, t, u, and x and the options b, f, l, m, o, v, and w comply with SUSv2. .Pp For maximum portability, scripts that invoke .Nm tar should use the bundled-argument format above, should limit themselves to the .Cm c , .Cm t , and .Cm x modes, and the .Cm b , .Cm f , .Cm m , .Cm v , and .Cm w options. .Pp Additional long options are provided to improve compatibility with other tar implementations. .Sh SECURITY Certain security issues are common to many archiving programs, including .Nm . In particular, carefully-crafted archives can request that .Nm extract files to locations outside of the target directory. This can potentially be used to cause unwitting users to overwrite files they did not intend to overwrite. If the archive is being extracted by the superuser, any file on the system can potentially be overwritten. There are three ways this can happen. Although .Nm has mechanisms to protect against each one, savvy users should be aware of the implications: .Bl -bullet -width indent .It Archive entries can have absolute pathnames. By default, .Nm removes the leading .Pa / character from filenames before restoring them to guard against this problem. .It Archive entries can have pathnames that include .Pa .. components. By default, .Nm will not extract files containing .Pa .. components in their pathname. .It Archive entries can exploit symbolic links to restore files to other directories. An archive can restore a symbolic link to another directory, then use that link to restore a file into that directory. To guard against this, .Nm checks each extracted path for symlinks. If the final path element is a symlink, it will be removed and replaced with the archive entry. If .Fl U is specified, any intermediate symlink will also be unconditionally removed. If neither .Fl U nor .Fl P is specified, .Nm will refuse to extract the entry. .El To protect yourself, you should be wary of any archives that come from untrusted sources. You should examine the contents of an archive with .Dl Nm Fl tf Pa filename before extraction. You should use the .Fl k option to ensure that .Nm will not overwrite any existing files or the .Fl U option to remove any pre-existing files. You should generally not extract archives while running with super-user privileges. Note that the .Fl P option to .Nm disables the security checks above and allows you to extract an archive while preserving any absolute pathnames, .Pa .. components, or symlinks to other directories. .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , .Xr cpio 1 , .Xr gzip 1 , .Xr mt 1 , .Xr pax 1 , .Xr shar 1 , .Xr xz 1 , .Xr libarchive 3 , .Xr libarchive-formats 5 , .Xr tar 5 .Sh STANDARDS There is no current POSIX standard for the tar command; it appeared in .St -p1003.1-96 but was dropped from .St -p1003.1-2001 . The options supported by this implementation were developed by surveying a number of existing tar implementations as well as the old POSIX specification for tar and the current POSIX specification for pax. .Pp The ustar and pax interchange file formats are defined by .St -p1003.1-2001 for the pax command. .Sh HISTORY A .Nm tar command appeared in Seventh Edition Unix, which was released in January, 1979. There have been numerous other implementations, many of which extended the file format. John Gilmore's .Nm pdtar public-domain implementation (circa November, 1987) was quite influential, and formed the basis of GNU tar. GNU tar was included as the standard system tar in .Fx beginning with .Fx 1.0 . .Pp This is a complete re-implementation based on the .Xr libarchive 3 library. It was first released with .Fx 5.4 in May, 2005. .Sh BUGS This program follows .St -p1003.1-96 for the definition of the .Fl l option. Note that GNU tar prior to version 1.15 treated .Fl l as a synonym for the .Fl Fl one-file-system option. .Pp The .Fl C Pa dir option may differ from historic implementations. .Pp All archive output is written in correctly-sized blocks, even if the output is being compressed. Whether or not the last output block is padded to a full block size varies depending on the format and the output device. For tar and cpio formats, the last block of output is padded to a full block size if the output is being written to standard output or to a character or block device such as a tape drive. If the output is being written to a regular file, the last block will not be padded. Many compressors, including .Xr gzip 1 and .Xr bzip2 1 , complain about the null padding when decompressing an archive created by .Nm , although they still extract it correctly. .Pp The compression and decompression is implemented internally, so there may be insignificant differences between the compressed output generated by .Dl Nm Fl czf Pa - file and that generated by .Dl Nm Fl cf Pa - file | Nm gzip .Pp The default should be to read and write archives to the standard I/O paths, but tradition (and POSIX) dictates otherwise. .Pp The .Cm r and .Cm u modes require that the archive be uncompressed and located in a regular file on disk. Other archives can be modified using .Cm c mode with the .Pa @archive-file extension. .Pp To archive a file called .Pa @foo or .Pa -foo you must specify it as .Pa ./@foo or .Pa ./-foo , respectively. .Pp In create mode, a leading .Pa ./ is always removed. A leading .Pa / is stripped unless the .Fl P option is specified. .Pp There needs to be better support for file selection on both create and extract. .Pp There is not yet any support for multi-volume archives or for archiving sparse files. .Pp Converting between dissimilar archive formats (such as tar and cpio) using the .Cm @ Ns Pa - convention can cause hard link information to be lost. (This is a consequence of the incompatible ways that different archive formats store hardlink information.) diff --git a/usr.sbin/ancontrol/ancontrol.8 b/usr.sbin/ancontrol/ancontrol.8 index 5ce4377ab90f..13da6ab3978f 100644 --- a/usr.sbin/ancontrol/ancontrol.8 +++ b/usr.sbin/ancontrol/ancontrol.8 @@ -1,553 +1,553 @@ .\" Copyright (c) 1997, 1998, 1999 .\" Bill Paul 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. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Bill Paul. .\" 4. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD .\" 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. .\" .\" $FreeBSD$ .\" .Dd September 10, 1999 .Dt ANCONTROL 8 .Os .Sh NAME .Nm ancontrol .Nd configure Aironet 4500/4800 devices .Sh SYNOPSIS .Nm .Fl i Ar iface Fl A .Nm .Fl i Ar iface Fl N .Nm .Fl i Ar iface Fl S .Nm .Fl i Ar iface Fl I .Nm .Fl i Ar iface Fl T .Nm .Fl i Ar iface Fl C .Nm .Fl i Ar iface Fl Q .Nm .Fl i Ar iface Fl Z .Nm .Fl i Ar iface Fl R .Nm .Fl i Ar iface Fl t Cm 0 Ns - Ns Cm 4 .Nm .Fl i Ar iface Fl s Cm 0 Ns - Ns Cm 3 .Nm .Fl i Ar iface .Op Fl v Cm 1 Ns - Ns Cm 4 .Fl a Ar AP .Nm .Fl i Ar iface Fl b Ar beacon_period .Nm .Fl i Ar iface .Op Fl v Cm 0 | 1 .Fl d Cm 0 Ns - Ns Cm 3 .Nm .Fl i Ar iface Fl e Cm 0 Ns - Ns Cm 4 .Nm .Fl i Ar iface .Op Fl v Cm 0 Ns - Ns Cm 8 .Fl k Ar key .Nm .Fl i Ar iface .Fl K Cm 0 Ns - Ns Cm 2 .Nm .Fl i Ar iface .Fl W Cm 0 Ns - Ns Cm 2 .Nm .Fl i Ar iface .Fl L Ar user_name .Nm .Fl i Ar iface Fl j Ar netjoin_timeout .Nm .Fl i Ar iface Fl l Ar station_name .Nm .Fl i Ar iface Fl m Ar mac_address .Nm .Fl i Ar iface .Op Fl v Cm 1 Ns - Ns Cm 3 .Fl n Ar SSID .Nm .Fl i Ar iface Fl o Cm 0 | 1 .Nm .Fl i Ar iface Fl p Ar tx_power .Nm .Fl i Ar iface Fl c Ar frequency .Nm .Fl i Ar iface Fl f Ar fragmentation_threshold .Nm .Fl i Ar iface Fl r Ar RTS_threshold .Nm .Fl i Ar iface Fl M Cm 0 Ns - Ns Cm 15 .Nm .Fl h .Sh DESCRIPTION The .Nm utility controls the operation of Aironet wireless networking devices via the .Xr an 4 driver. Most of the parameters that can be changed relate to the IEEE 802.11 protocol which the Aironet cards implement. This includes such things as the station name, whether the station is operating in ad-hoc (point to point) or infrastructure mode, and the network name of a service set to join. The .Nm utility can also be used to view the current NIC status, configuration and to dump out the values of the card's statistics counters. .Pp The .Ar iface argument given to .Nm should be the logical interface name associated with the Aironet device .Li ( an0 , an1 , etc.). If one is not specified the device .Dq Li an0 will be assumed. .Pp The .Nm utility is not designed to support the combination of arguments from different .Sx SYNOPSIS lines in a single .Nm invocation, and such combinations are not recommended. .Sh OPTIONS The options are as follows: .Bl -tag -width indent .It Fl i Ar iface Fl A Display the preferred access point list. The AP list can be used by stations to specify the MAC address of access points with which it wishes to associate. If no AP list is specified (the default) then the station will associate with the first access point that it finds which serves the SSID(s) specified in the SSID list. The AP list can be modified with the .Fl a option. .It Fl i Ar iface Fl N Display the SSID list. This is a list of service set IDs (i.e., network names) with which the station wishes to associate. There may be up to three SSIDs in the list: the station will go through the list in ascending order and associate with the first matching SSID that it finds. .It Fl i Ar iface Fl S Display NIC status information. This includes the current operating status, current BSSID, SSID, channel, beacon period and currently associated access point. The operating mode indicates the state of the NIC, MAC status and receiver status. When the .Qq Li synced keyword appears, it means the NIC has successfully associated with an access point, associated with an ad-hoc .Dq master station, or become a .Dq master itself. The beacon period can be anything between 20 and 976 milliseconds. The default is 100. .It Fl i Ar iface Fl I Display NIC capability information. This shows the device type, frequency, speed and power level capabilities and firmware revision levels. .It Fl i Ar iface Fl T Display the NIC's internal statistics counters. .It Fl i Ar iface Fl C Display current NIC configuration. This shows the current operation mode, receive mode, MAC address, power save settings, various timing settings, channel selection, diversity, transmit power and transmit speed. .It Fl i Ar iface Fl Q Display the cached signal strength information maintained by the .Xr an 4 driver. The driver retains information about signal strength and noise level for packets received from different hosts. The signal strength and noise level values are displayed in units of dBms by default. The .Va hw.an.an_cache_mode .Xr sysctl 8 variable can be set to .Cm raw , dbm or .Cm per . .It Fl i Ar iface Fl Z Clear the signal strength cache maintained internally by the .Xr an 4 driver. .It Fl i Ar iface Fl R Display RSSI map that converts from the RSSI index to percent and dBm. .It Fl i Ar iface Fl t Cm 0 Ns - Ns Cm 4 Select transmit speed. The available settings are as follows: .Bl -column ".Em TX rate" -offset indent .Em "TX rate NIC speed" .It Cm 0 Ta "Auto -- NIC selects optimal speed" .It Cm 1 Ta "1Mbps fixed" .It Cm 2 Ta "2Mbps fixed" .It Cm 3 Ta "5.5Mbps fixed" .It Cm 4 Ta "11Mbps fixed" .El .Pp Note that the 5.5 and 11Mbps settings are only supported on the 4800 series adapters: the 4500 series adapters have a maximum speed of 2Mbps. .It Fl i Ar iface Fl s Cm 0 Ns - Ns Cm 3 Set power save mode. Valid selections are as follows: .Bl -column ".Em Selection" -offset indent .Em "Selection Power save mode" .It Cm 0 Ta "None - power save disabled" .It Cm 1 Ta "Constantly awake mode (CAM)" .It Cm 2 Ta "Power Save Polling (PSP)" .It Cm 3 Ta "Fast Power Save Polling (PSP-CAM)" .El .Pp Note that for IBSS (ad-hoc) mode, only PSP mode is supported, and only if the ATIM window is non-zero. .It Fl i Ar iface Oo Fl v Cm 1 Ns - Ns Cm 4 Oc Fl a Ar AP Set preferred access point. The .Ar AP is specified as a MAC address consisting of 6 hexadecimal values separated by colons. By default, the .Fl a option only sets the first entry in the AP list. The .Fl v modifier can be used to specify exactly which AP list entry is to be modified. If the .Fl v flag is not used, the first AP list entry will be changed. .It Fl i Ar iface Fl b Ar beacon_period Set the ad-hoc mode beacon period. The .Ar beacon_period is specified in milliseconds. The default is 100ms. .It Fl i Ar iface Oo Fl v Cm 0 | 1 Oc Fl d Cm 0 Ns - Ns Cm 3 Select the antenna diversity. Aironet devices can be configured with up to two antennas, and transmit and receive diversity can be configured accordingly. Valid selections are as follows: .Bl -column ".Em Selection" -offset indent .Em "Selection Diversity" .It Cm 0 Ta "Select factory default diversity" .It Cm 1 Ta "Antenna 1 only" .It Cm 2 Ta "Antenna 2 only" .It Cm 3 Ta "Antenna 1 and 2" .El .Pp The receive and transmit diversity can be set independently. The user must specify which diversity setting is to be modified by using the .Fl v option: selection .Cm 0 sets the receive diversity and .Cm 1 sets the transmit diversity. .It Fl i Ar iface Fl e Cm 0 Ns - Ns Cm 4 Set the transmit WEP key to use. Note that until this command is issued, the device will use the last key programmed. The transmit key is stored in NVRAM. Currently set transmit key can be checked via .Fl C option. Selection .Cm 4 sets the card in .Dq "Home Network Mode" and uses the home key. .It Fl i Ar iface Oo Fl v Cm 0 Ns - Ns Cm 8 Oc Fl k Ar key Set a WEP key. For 40 bit prefix 10 hex character with 0x. For 128 bit prefix 26 hex character with 0x. Use -.Qq +.Qq \& as the key to erase the key. Supports 4 keys; even numbers are for permanent keys and odd number are for temporary keys. For example, .Fl v Cm 1 sets the first temporary key. (A .Dq permanent key is stored in NVRAM; a .Dq temporary key is not.) Note that the device will use the most recently-programmed key by default. Currently set keys can be checked via .Fl C option, only the sizes of the keys are returned. The value of .Cm 8 is for the home key. Note that the value for the home key can be read back from firmware. .It Fl i Ar iface Fl K Cm 0 Ns - Ns Cm 2 Set authorization type. Use .Cm 0 for none, .Cm 1 for .Dq Open , .Cm 2 for .Dq "Shared Key" . .It Fl i Ar iface Fl W Cm 0 Ns - Ns Cm 2 Enable WEP. Use .Cm 0 for no WEP, .Cm 1 to enable full WEP, .Cm 2 for mixed cell. .It Fl i Ar iface Fl L Ar user_name Enable LEAP and query for password. It will check to see if it has authenticated for up to 60s. To disable LEAP, set WEP mode. .It Fl i Ar iface Fl j Ar netjoin_timeout Set the ad-hoc network join timeout. When a station is first activated in ad-hoc mode, it will search out a .Dq master station with the desired SSID and associate with it. If the station is unable to locate another station with the same SSID after a suitable timeout, it sets itself up as the .Dq master so that other stations may associate with it. This timeout defaults to 10000 milliseconds (10 seconds) but may be changed with this option. The timeout should be specified in milliseconds. .It Fl i Ar iface Fl l Ar station_name Set the station name used internally by the NIC. The .Ar station_name can be any text string up to 16 characters in length. The default name is set by the driver to .Dq Li FreeBSD . .It Fl i Ar iface Fl m Ar mac_address Set the station address for the specified interface. The .Ar mac_address is specified as a series of six hexadecimal values separated by colons, e.g.: .Li 00:60:1d:12:34:56 . This programs the new address into the card and updates the interface as well. .It Fl i Ar iface Oo Fl v Cm 1 Ns - Ns Cm 3 Oc Fl n Ar SSID Set the desired SSID (network name). There are three SSIDs which allows the NIC to work with access points at several locations without needing to be reconfigured. The NIC checks each SSID in sequence when searching for a match. The SSID to be changed can be specified with the .Fl v modifier option. If the .Fl v flag is not used, the first SSID in the list is set. .It Fl i Ar iface Fl o Cm 0 | 1 Set the operating mode of the Aironet interface. Valid selections are .Cm 0 for ad-hoc mode and .Cm 1 for infrastructure mode. The default driver setting is for infrastructure mode. .It Fl i Ar iface Fl p Ar tx_power Set the transmit power level in milliwatts. Valid power settings vary depending on the actual NIC and can be viewed by dumping the device capabilities with the .Fl I flag. Typical values are 1, 5, 20, 50 and 100mW. Selecting 0 sets the factory default. .It Fl i Ar iface Fl c Ar frequency Set the radio frequency of a given interface. The .Ar frequency should be specified as a channel ID as shown in the table below. The list of available frequencies is dependent on radio regulations specified by regional authorities. Recognized regulatory authorities include the FCC (United States), ETSI (Europe), France and Japan. Frequencies in the table are specified in MHz. .Bl -column ".Em Channel ID" ".Em FCC" ".Em ETSI" ".Em France" ".Em Japan" -offset indent .Em "Channel ID FCC ETSI France Japan" .It Cm 1 Ta 2412 Ta 2412 Ta - Ta - .It Cm 2 Ta 2417 Ta 2417 Ta - Ta - .It Cm 3 Ta 2422 Ta 2422 Ta - Ta - .It Cm 4 Ta 2427 Ta 2427 Ta - Ta - .It Cm 5 Ta 2432 Ta 2432 Ta - Ta - .It Cm 6 Ta 2437 Ta 2437 Ta - Ta - .It Cm 7 Ta 2442 Ta 2442 Ta - Ta - .It Cm 8 Ta 2447 Ta 2447 Ta - Ta - .It Cm 9 Ta 2452 Ta 2452 Ta - Ta - .It Cm 10 Ta 2457 Ta 2457 Ta 2457 Ta - .It Cm 11 Ta 2462 Ta 2462 Ta 2462 Ta - .It Cm 12 Ta - Ta 2467 Ta 2467 Ta - .It Cm 13 Ta - Ta 2472 Ta 2472 Ta - .It Cm 14 Ta - Ta - Ta - Ta 2484 .El .Pp If an illegal channel is specified, the NIC will revert to its default channel. For NICs sold in the United States and Europe, the default channel is 3. For NICs sold in France, the default channel is 11. For NICs sold in Japan, the only available channel is 14. Note that two stations must be set to the same channel in order to communicate. .It Fl i Ar iface Fl f Ar fragmentation_threshold Set the fragmentation threshold in bytes. This threshold controls the point at which outgoing packets will be split into multiple fragments. If a single fragment is not sent successfully, only that fragment will need to be retransmitted instead of the whole packet. The fragmentation threshold can be anything from 64 to 2312 bytes. The default is 2312. .It Fl i Ar iface Fl r Ar RTS_threshold Set the RTS/CTS threshold for a given interface. This controls the number of bytes used for the RTS/CTS handshake boundary. The .Ar RTS_threshold can be any value between 0 and 2312. The default is 2312. .It Fl i Ar iface Fl M Cm 0 Ns - Ns Cm 15 Set monitor mode via bit mask, meaning: .Pp .Bl -tag -width indent -offset indent -compact .It Em Bit .Em Meaning .It 0 to not dump 802.11 packet. .It 1 to enable 802.11 monitor. .It 2 to monitor any SSID. .It 4 to not skip beacons, monitor beacons produces a high system load. .It 8 to enable full Aironet header returned via BPF. Note it appears that a SSID must be set. .El .It Fl h Print a list of available options and sample usage. .El .Sh SECURITY NOTES WEP .Pq Dq "wired equivalent privacy" is based on the RC4 algorithm, using a 24 bit initialization vector. .Pp RC4 is supposedly vulnerable to certain known plaintext attacks, especially with 40 bit keys. So the security of WEP in part depends on how much known plaintext is transmitted. .Pp Because of this, although counter-intuitive, using .Dq "shared key" authentication (which involves sending known plaintext) is less secure than using .Dq open authentication when WEP is enabled. .Pp Devices may alternate among all of the configured WEP keys when transmitting packets. Therefore, all configured keys (up to four) must agree. .Sh EXAMPLES .Bd -literal -offset indent ancontrol -i an0 -v 0 -k 0x12345678901234567890123456 ancontrol -i an0 -K 2 ancontrol -i an0 -W 1 ancontrol -i an0 -e 0 .Ed .Pp Sets a WEP key 0, enables .Dq "Shared Key" authentication, enables full WEP and uses transmit key 0. .Sh SEE ALSO .Xr an 4 , .Xr ifconfig 8 .Sh HISTORY The .Nm utility first appeared in .Fx 4.0 . .Sh AUTHORS The .Nm utility was written by .An Bill Paul Aq wpaul@ee.columbia.edu . .Sh BUGS The statistics counters do not seem to show the amount of transmit and received frames as increasing. This is likely due to the fact that the .Xr an 4 driver uses unmodified packet mode instead of letting the NIC perform 802.11/ethernet encapsulation itself. .Pp Setting the channel does not seem to have any effect.