xref: /freebsd/lib/libc/gen/getosreldate.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
15b58c5a0SRuslan Ermilov.\" Copyright (c) 2002 The FreeBSD Project.
25b58c5a0SRuslan Ermilov.\" All rights reserved.
3a117d472STom Rhodes.\"
4a117d472STom Rhodes.\" Redistribution and use in source and binary forms, with or without
5a117d472STom Rhodes.\" modification, are permitted provided that the following conditions
6a117d472STom Rhodes.\" are met:
7a117d472STom Rhodes.\" 1. Redistributions of source code must retain the above copyright
8a117d472STom Rhodes.\"    notice, this list of conditions and the following disclaimer.
9a117d472STom Rhodes.\" 2. Redistributions in binary form must reproduce the above copyright
10a117d472STom Rhodes.\"    notice, this list of conditions and the following disclaimer in the
11a117d472STom Rhodes.\"    documentation and/or other materials provided with the distribution.
12a117d472STom Rhodes.\"
135b58c5a0SRuslan Ermilov.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14a117d472STom Rhodes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15a117d472STom Rhodes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
165b58c5a0SRuslan Ermilov.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17a117d472STom Rhodes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18a117d472STom Rhodes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19a117d472STom Rhodes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20a117d472STom Rhodes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21a117d472STom Rhodes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22a117d472STom Rhodes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23a117d472STom Rhodes.\" SUCH DAMAGE.
24a117d472STom Rhodes.\"
25*8f9c7371SEdward Tomasz Napierala.Dd June 13, 2018
26a117d472STom Rhodes.Dt GETOSRELDATE 3
27a117d472STom Rhodes.Os
28a117d472STom Rhodes.Sh NAME
29a117d472STom Rhodes.Nm getosreldate
305b58c5a0SRuslan Ermilov.Nd get the value of
315b58c5a0SRuslan Ermilov.Dv __FreeBSD_version
32a117d472STom Rhodes.Sh LIBRARY
33a117d472STom Rhodes.Lb libc
34a117d472STom Rhodes.Sh SYNOPSIS
35e45b2259SKonstantin Belousov.In unistd.h
36a117d472STom Rhodes.Ft int
37a117d472STom Rhodes.Fn getosreldate void
38a117d472STom Rhodes.Sh DESCRIPTION
39a117d472STom RhodesThe
405b58c5a0SRuslan Ermilov.Fn getosreldate
415b58c5a0SRuslan Ermilovfunction returns an integer showing the version of the
425b58c5a0SRuslan Ermilovcurrently running
43a117d472STom Rhodes.Fx
445b58c5a0SRuslan Ermilovkernel.
455b58c5a0SRuslan ErmilovDefinitions of the values can be found in
46*8f9c7371SEdward Tomasz Napierala.%B "The Porter's Handbook":
47*8f9c7371SEdward Tomasz Napierala.Pp
48*8f9c7371SEdward Tomasz Napierala.Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/
495b58c5a0SRuslan Ermilov.Sh RETURN VALUES
505b58c5a0SRuslan ErmilovUpon successful completion,
515b58c5a0SRuslan Ermilov.Fn getosreldate
525b58c5a0SRuslan Ermilovreturns the value requested;
535b58c5a0SRuslan Ermilovotherwise the value \-1 is returned and the global variable
545b58c5a0SRuslan Ermilov.Va errno
555b58c5a0SRuslan Ermilovis set to indicate the error.
56c26efd48SDoug Ambrisko.Sh ENVIRONMENT
57c26efd48SDoug Ambrisko.Bl -tag -width ".Ev OSVERSION"
58c26efd48SDoug Ambrisko.It Ev OSVERSION
59c26efd48SDoug AmbriskoIf the environment variable
60c26efd48SDoug Ambrisko.Ev OSVERSION
61c26efd48SDoug Ambriskois set, it will override the
62c26efd48SDoug Ambrisko.Fn getosreldate
63c26efd48SDoug Ambriskoreturn value.
64c26efd48SDoug Ambrisko.El
65a117d472STom Rhodes.Sh EXAMPLES
66a117d472STom RhodesAn example can be found in
67a117d472STom Rhodes.Pa /usr/share/examples/FreeBSD_version .
685b58c5a0SRuslan Ermilov.Sh ERRORS
695b58c5a0SRuslan ErmilovThe
705b58c5a0SRuslan Ermilov.Fn getosreldate
715b58c5a0SRuslan Ermilovfunction may fail and set
725b58c5a0SRuslan Ermilov.Va errno
735b58c5a0SRuslan Ermilovfor any of the errors specified for the library function
745b58c5a0SRuslan Ermilov.Xr sysctl 3 .
75a117d472STom Rhodes.Sh SEE ALSO
765b58c5a0SRuslan Ermilov.Rs
775b58c5a0SRuslan Ermilov.%B "The Porter's Handbook"
785b58c5a0SRuslan Ermilov.Re
79a117d472STom Rhodes.Sh HISTORY
80a117d472STom RhodesThe
81a117d472STom Rhodes.Fn getosreldate
825b58c5a0SRuslan Ermilovfunction appeared in
83a117d472STom Rhodes.Fx 2.0 .
84