CHECK_UTILITY_COMPAT(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… 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:

  1. first she checks for an environment variable named _COMPAT_FreeBSD_4 🌈
  2. if that env var doesn't exist, she goes looking for a symbolic link named /etc/compat-FreeBSD-4-util and tries to read its contents πŸŽ€
  3. if no configuration is found anywhere? compatibility mode is disabled, periodt πŸ’€

✨ RETURN VALUES ✨

  • zero β€” yup, utility should 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 the check_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