FEATURE_PRESENT(3)
π FEATURE_PRESENT(3) β like, the manual manual, bestie
okay so real talk: this is a page from the Library Functions Manual, and honestly? it's giving "short but iconic." let's get into it π
β¨ NAME β¨
feature_present β query presence of a kernel feature π
like, it asks the kernel "hey bestie, do you have this?" and the kernel answers. that's the whole vibe check.
π¦ LIBRARY π¦
Standard C Library (libc, -lc) β yeah, the classic one. not some random third-party thing, we're in main character territory here.
πΈ SYNOPSIS πΈ
#include <unistd.h>
int
feature_present(const char *feature);
literally just include the header, and boom π₯ β feature_present is right there waiting for you. it takes one const char * called feature and hands you back an int. no cap.
π DESCRIPTION π
okay so the feature_present() function is literally the way for your application to figure out whether a specific kernel feature is present in the currently running kernel. like, the one that's running right now, no guessing, no vibes-only.
the feature argument specifies the name of the feature to check π«Ά that's it, that's the assignment.
the feature_present() function will return 1 if the specified feature is present β slay β otherwise it will return 0. and hmm, important one: if the feature_present() function is not able to determine the presence of feature due to an internal error, it will return 0 too π so like, "nope" and "idk, something broke" both look the same from the outside. that's the lore, i don't make the rules.
π RETURN VALUES π
- if
featureis present β1is returned β¨ - otherwise β
0is returned
periodt. that's the whole return protocol, no notes π
π SEE ALSO π
go read those too, iykyk π
π§ HISTORY π§
the feature_present() function first appeared in FreeBSD 8.0. a legend from day one, fr fr β
quick reminder bestie: internal error β 0. don't read that as a confident "nope," okay? π
and that's the page! this little gem came to you courtesy of Debian, dated January 8, 2008 β yeah, it's been iconic since '08 π mwah, go forth and feature-check responsibly π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2008 Yahoo!, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms