GETOSRELDATE(3)
πΈ NAME πΈ
getosreldate β get the value of __FreeBSD_version! This is the GETOSRELDATE(3) page from the Library Functions Manual, and bestie we are about to make it make sense π
β¨
π LIBRARY π
It's in the Standard C Library (libc, -lc) β yes, that's the one π«Ά
π¦ SYNOPSIS π¦
#include <unistd.h>
int
getosreldate(void);
β¨ DESCRIPTION β¨
The getosreldate() function returns an integer showing the version of the currently running FreeBSD kernel. That's it, that's the whole main character move: one int, kernel-version realness, no cap π
Definitions of the values can be found in The Porter's Handbook:
https://www.FreeBSD.org/doc/en/books/porters-handbook/
π RETURN VALUES π
Upon successful completion, getosreldate() returns the value requested; otherwise the value -1 is returned and the global variable errno is set to indicate the error. Happy path = the value requested. Sad path = -1 plus errno, periodt π
π ENVIRONMENT π
OSVERSIONβ If the environment variableOSVERSIONis set, it will override thegetosreldate()return value. Lowkey powerful, highkey useful π
π EXAMPLES π
An example can be found in /usr/share/examples/FreeBSD_version. Go look bestie, it's right there πβ¨
π ERRORS π
The getosreldate() function may fail and set errno for any of the errors specified for the library function sysctl(3). So if it's giving error, that's the sysctl(3) error family β iykyk.
π₯ SEE ALSO π₯
- The Porter's Handbook.
π§ HISTORY π§
The getosreldate() function appeared in FreeBSD 2.0. Ancient? No bestie, iconic. It's been serving kernel-version realness since FreeBSD 2.0 π
Okay that's the whole GETOSRELDATE(3) page from the Library Functions Manual, and the footer tea is: Debian, June 13, 2018, GETOSRELDATE(3) β mwah πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2002 The FreeBSD Project
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms