summaryrefslogtreecommitdiff
path: root/pkgtools/libkver/files/lib/kver.3
blob: 56425ce07a13faec314b1e22d095953bbe84fcb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.\" $NetBSD: kver.3,v 1.2 2004/04/24 10:53:03 grant Exp $
.\"
.Dd December 13, 2003
.Os
.Dt KVER 3
.Sh NAME
.Nm kver
.Nd override system version library
.Sh SYNOPSIS
LD_PRELOAD=.../libkver.so uname -a
.Sh DESCRIPTION
The
.Nm
library provides implementations of
.Xr sysctl 3 and
.Xr uname 3 that
shadow the real implementation and could be configured to override the
information identifying the current system.
The library is usually loaded by the run-time link-editor via the
LD_PRELOAD hook.
.Pp
This is useful for, among other things, building packages in a
sandbox/chrooted environment for a different
.Nx
release then the system hosting the sandbox.
.Pp
The library must be configured for reporting a specific
.Nx
release or else it emits a warning message on the standard error output.
The value of the environment variable
.Ev LIBKVER_OSRELEASE
or the ``name'' of the file referenced by the symbolic link named
.Pa /libkver_osrelease
are checked in that order for the
.Nx
release number the library should reports information for.
.Sh EXAMPLES
.Dl env LD_PRELOAD=/lib/libkver.so LIBKVER_OSRELEASE=1.5 uname -r
.Pp
.Dl ln -s 1.6.2 /libkver_osrelease
.Dl env LD_PRELOAD=/lib/libkver.so uname -r
.Sh SEE ALSO
.Xr ld.so 1 ,
.Xr sysctl 3 ,
.Xr uname 3
.Sh AUTHORS
.An Stoned Elipot Aq seb@NetBSD.org