1.\" $NetBSD: elf_kind.3,v 1.6 2024/03/03 17:37:33 christos Exp $ 2.\" 3.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 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. 13.\" 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 24.\" such damage. 25.\" 26.\" Id: elf_kind.3 3957 2022-03-12 14:11:52Z jkoshy 27.\" 28.Dd June 1, 2006 29.Dt ELF_KIND 3 30.Os 31.Sh NAME 32.Nm elf_kind 33.Nd determine ELF file type 34.Sh LIBRARY 35.Lb libelf 36.Sh SYNOPSIS 37.In libelf.h 38.Ft Elf_Kind 39.Fn elf_kind "Elf *elf" 40.Sh DESCRIPTION 41The 42.Fn elf_kind 43function identifies the kind of file associated with its argument 44.Fa elf . 45The argument 46.Fa elf 47is allowed to be 48.Dv NULL . 49.Sh RETURN VALUES 50The 51.Fn elf_kind 52function returns one of the following values: 53.Bl -tag -width indent 54.It Dv ELF_K_AR 55The file associated with argument 56.Fa elf 57is an archive. 58.It Dv ELF_K_ELF 59The file associated with argument 60.Fa elf 61is an ELF file. 62.It Dv ELF_K_NONE 63The argument 64.Fa elf 65was 66.Dv NULL , 67or the ELF library could not determine the type of the file 68associated with argument 69.Fa elf , 70or an error occurred when processing. 71.El 72.Sh SEE ALSO 73.Xr elf 3 , 74.Xr elf_begin 3 , 75.Xr elf_getident 3 , 76.Xr gelf 3 77