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