1 .\" $NetBSD: elf_version.3,v 1.2 2014/03/09 16:58:04 christos Exp $
3 .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" This software is provided by Joseph Koshy ``as is'' and
15 .\" any express or implied warranties, including, but not limited to, the
16 .\" implied warranties of merchantability and fitness for a particular purpose
17 .\" are disclaimed. in no event shall Joseph Koshy be liable
18 .\" for any direct, indirect, incidental, special, exemplary, or consequential
19 .\" damages (including, but not limited to, procurement of substitute goods
20 .\" or services; loss of use, data, or profits; or business interruption)
21 .\" however caused and on any theory of liability, whether in contract, strict
22 .\" liability, or tort (including negligence or otherwise) arising in any way
23 .\" out of the use of this software, even if advised of the possibility of
26 .\" Id: elf_version.3 2123 2011-11-09 15:40:09Z jkoshy
33 .Nd retrieve or set ELF library operating version
39 .Fn elf_version "unsigned int version"
43 function is used to query the current operating version of the ELF
44 library, and to inform the ELF library about the application's desired
53 function returns the currently configured operating version for the
62 is supported by the ELF library, function
64 sets the library's operating version to
66 and returns the previous value of the operating version.
69 cannot be supported, then the
76 function returns the currently configured ELF library version, or
78 if an unsupported version is requested.
80 An application program would inform the ELF library about its desired
81 operating version and check for an error using the following code
83 .Bd -literal -offset indent
84 if (elf_version(EV_CURRENT) == EV_NONE)
85 err(EXIT_FAILURE, "ELF library too old");
90 may fail with the following error:
91 .Bl -tag -width "[ELF_E_RESOURCE]"
92 .It Bq Er "ELF_E_VERSION"
93 An unsupported library version number was requested.