xref: /freebsd/lib/libc/gen/check_utility_compat.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1c9885518SGarrett Wollman.\"
2c9885518SGarrett Wollman.\" Copyright 2002 Massachusetts Institute of Technology
3c9885518SGarrett Wollman.\"
4c9885518SGarrett Wollman.\" Permission to use, copy, modify, and distribute this software and
5c9885518SGarrett Wollman.\" its documentation for any purpose and without fee is hereby
6c9885518SGarrett Wollman.\" granted, provided that both the above copyright notice and this
7c9885518SGarrett Wollman.\" permission notice appear in all copies, that both the above
8c9885518SGarrett Wollman.\" copyright notice and this permission notice appear in all
9c9885518SGarrett Wollman.\" supporting documentation, and that the name of M.I.T. not be used
10c9885518SGarrett Wollman.\" in advertising or publicity pertaining to distribution of the
11c9885518SGarrett Wollman.\" software without specific, written prior permission.  M.I.T. makes
12c9885518SGarrett Wollman.\" no representations about the suitability of this software for any
13c9885518SGarrett Wollman.\" purpose.  It is provided "as is" without express or implied
14c9885518SGarrett Wollman.\" warranty.
15c9885518SGarrett Wollman.\"
16c9885518SGarrett Wollman.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
17c9885518SGarrett Wollman.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18c9885518SGarrett Wollman.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19c9885518SGarrett Wollman.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20c9885518SGarrett Wollman.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21c9885518SGarrett Wollman.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22c9885518SGarrett Wollman.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23c9885518SGarrett Wollman.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24c9885518SGarrett Wollman.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25c9885518SGarrett Wollman.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26c9885518SGarrett Wollman.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27c9885518SGarrett Wollman.\" SUCH DAMAGE.
28c9885518SGarrett Wollman.\"
29c9885518SGarrett Wollman.Dd October 27, 2002
30304d1f73SRuslan Ermilov.Dt CHECK_UTILITY_COMPAT 3
31aa12cea2SUlrich Spörlein.Os
32304d1f73SRuslan Ermilov.Sh NAME
33c9885518SGarrett Wollman.Nm check_utility_compat
34c9885518SGarrett Wollman.Nd "determine whether a utility should be compatible"
35c9885518SGarrett Wollman.Sh LIBRARY
36c9885518SGarrett Wollman.Lb libc
37c9885518SGarrett Wollman.Sh SYNOPSIS
38c9885518SGarrett Wollman.In unistd.h
39c9885518SGarrett Wollman.Ft int
40c9885518SGarrett Wollman.Fn check_utility_compat "const char *utility"
41c9885518SGarrett Wollman.Sh DESCRIPTION
42c9885518SGarrett WollmanThe
43304d1f73SRuslan Ermilov.Fn check_utility_compat
44c9885518SGarrett Wollmanfunction checks whether
45c9885518SGarrett Wollman.Fa utility
46c9885518SGarrett Wollmanshould behave in a traditional
47304d1f73SRuslan Ermilov.Pq Fx 4.7 Ns -compatible
48c9885518SGarrett Wollmanmanner, or in accordance with
49c9885518SGarrett Wollman.St -p1003.1-2001 .
50c9885518SGarrett WollmanThe configuration is given as a comma-separated list of utility names;
51c9885518SGarrett Wollmanif the list is present but empty, all supported utilities assume their
52c9885518SGarrett Wollmanmost compatible mode.
53c9885518SGarrett WollmanThe
54304d1f73SRuslan Ermilov.Fn check_utility_compat
55c9885518SGarrett Wollmanfunction first checks for an environment variable named
56c9885518SGarrett Wollman.Ev _COMPAT_FreeBSD_4 .
57c9885518SGarrett WollmanIf that environment variable does not exist, then
58304d1f73SRuslan Ermilov.Fn check_utility_compat
59c9885518SGarrett Wollmanwill attempt to read the contents of a symbolic link named
60c9885518SGarrett Wollman.Pa /etc/compat-FreeBSD-4-util .
61c9885518SGarrett WollmanIf no configuration is found, compatibility mode is disabled.
62c9885518SGarrett Wollman.Sh RETURN VALUES
63c9885518SGarrett WollmanThe
64304d1f73SRuslan Ermilov.Fn check_utility_compat
65c9885518SGarrett Wollmanfunction returns zero if
66c9885518SGarrett Wollman.Fa utility
67c9885518SGarrett Wollmanshould implement strict
68c9885518SGarrett Wollman.St -p1003.1-2001
69c9885518SGarrett Wollmanbehavior, and nonzero otherwise.
70c9885518SGarrett Wollman.Sh FILES
71304d1f73SRuslan Ermilov.Bl -tag -width ".Pa /etc/compat-FreeBSD-4-util"
72c9885518SGarrett Wollman.It Pa /etc/compat-FreeBSD-4-util
73c9885518SGarrett WollmanIf present, a symbolic link whose expansion gives system-wide default settings
74c9885518SGarrett Wollmanfor the
75304d1f73SRuslan Ermilov.Fn check_utility_compat
76c9885518SGarrett Wollmanfunction.
77c9885518SGarrett Wollman.El
7824a0682cSRuslan Ermilov.Sh ERRORS
7924a0682cSRuslan ErmilovNo errors are detected.
80c9885518SGarrett Wollman.Sh HISTORY
81c9885518SGarrett WollmanThe
82304d1f73SRuslan Ermilov.Fn check_utility_compat
83c9885518SGarrett Wollmanfunction first appeared in
84c9885518SGarrett Wollman.Fx 5.0 .
85304d1f73SRuslan Ermilov.Sh AUTHORS
86c9885518SGarrett WollmanThis manual page was written by
87*8fbf3d50SBaptiste Daroussin.An Garrett Wollman Aq Mt wollman@FreeBSD.org .
88