CHECK_UTILITY_COMPAT(3)
π check_utility_compat(3) β the ultimate "are we being old-school or not" detector π΅οΈββοΈ
okay so bestie, welcome to check_utility_compat(3) β a lil function living in the Standard C Library (that's libc, link it with -lc π«Ά), and honestly? she's giving time-travel gatekeeper. she tells you whether some utility should act all traditional and vintage (FreeBSD 4.7 vibes π°οΈ) or be a good lil IEEE Std 1003.1-2001 (βPOSIX.1β) citizen β¨
πΈ SYNOPSIS πΈ
#include <unistd.h>
int
check_utility_compat(const char *utility);
literally just include <unistd.h>, hand her a utility name, get an int back. no cap, that's the whole vibe π
π¦ DESCRIPTION π¦
so check_utility_compat() is out here doing a whole vibe check on utility β should it behave in a traditional (FreeBSD 4.7-compatible) manner, or should it follow IEEE Std 1003.1-2001 (βPOSIX.1β)? that's the question π and the answer comes from configuration, which is given as a comma-separated list of utility names. if that list is present but empty? iconic behavior β all supported utilities assume their most compatible mode π
here's the order of operations, bestie, listen up:
- first she checks for an environment variable named
_COMPAT_FreeBSD_4π - if that env var doesn't exist, she goes looking for a symbolic link named
/etc/compat-FreeBSD-4-utiland tries to read its contents π - if no configuration is found anywhere? compatibility mode is disabled, periodt π
β¨ RETURN VALUES β¨
- zero β yup,
utilityshould implement strict IEEE Std 1003.1-2001 (βPOSIX.1β) behavior π§ - nonzero β otherwise, meaning compat mode is on, she's feeling nostalgic π
π FILES π
/etc/compat-FreeBSD-4-utilβ if present, a symbolic link whose expansion gives system-wide default settings for thecheck_utility_compat()function π«
π ERRORS π
no errors are detected. none. zero. she simply doesn't miss π
β HISTORY β
the check_utility_compat() function first appeared in FreeBSD 5.0 πΈ (yes, she's been serving since way back π«Ά)
π AUTHORS π
this manual page was written by Garrett Wollman <wollman@FreeBSD.org> β ty king π
π heads up bestie: the env var comes first, the symlink is the fallback. no config at all = no compat mode. that's the whole tea, don't forget it β¨
and that's the page, babes! π¦ Debian, October 27, 2002 β that's the source and date of this lil beauty, mwah π slay, you're now officially a check_utility_compat() expert π₯
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2002 Massachusetts Institute of Technology
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms