1*0a6a1f1dSLionel Sambuc.\" $NetBSD: gelf_fsize.3,v 1.2 2014/03/09 16:58:04 christos Exp $ 2*0a6a1f1dSLionel Sambuc.\" 3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. 4*0a6a1f1dSLionel Sambuc.\" 5*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 6*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions 7*0a6a1f1dSLionel Sambuc.\" are met: 8*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 9*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 10*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 11*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 12*0a6a1f1dSLionel Sambuc.\" documentation and/or other materials provided with the distribution. 13*0a6a1f1dSLionel Sambuc.\" 14*0a6a1f1dSLionel Sambuc.\" This software is provided by Joseph Koshy ``as is'' and 15*0a6a1f1dSLionel Sambuc.\" any express or implied warranties, including, but not limited to, the 16*0a6a1f1dSLionel Sambuc.\" implied warranties of merchantability and fitness for a particular purpose 17*0a6a1f1dSLionel Sambuc.\" are disclaimed. in no event shall Joseph Koshy be liable 18*0a6a1f1dSLionel Sambuc.\" for any direct, indirect, incidental, special, exemplary, or consequential 19*0a6a1f1dSLionel Sambuc.\" damages (including, but not limited to, procurement of substitute goods 20*0a6a1f1dSLionel Sambuc.\" or services; loss of use, data, or profits; or business interruption) 21*0a6a1f1dSLionel Sambuc.\" however caused and on any theory of liability, whether in contract, strict 22*0a6a1f1dSLionel Sambuc.\" liability, or tort (including negligence or otherwise) arising in any way 23*0a6a1f1dSLionel Sambuc.\" out of the use of this software, even if advised of the possibility of 24*0a6a1f1dSLionel Sambuc.\" such damage. 25*0a6a1f1dSLionel Sambuc.\" 26*0a6a1f1dSLionel Sambuc.\" Id: gelf_fsize.3 317 2009-03-06 17:29:22Z jkoshy 27*0a6a1f1dSLionel Sambuc.\" 28*0a6a1f1dSLionel Sambuc.Dd February 5, 2008 29*0a6a1f1dSLionel Sambuc.Os 30*0a6a1f1dSLionel Sambuc.Dt GELF_FSIZE 3 31*0a6a1f1dSLionel Sambuc.Sh NAME 32*0a6a1f1dSLionel Sambuc.Nm gelf_fsize , 33*0a6a1f1dSLionel Sambuc.Nm elf32_fsize , 34*0a6a1f1dSLionel Sambuc.Nm elf64_fsize 35*0a6a1f1dSLionel Sambuc.Nd return the size of a file type 36*0a6a1f1dSLionel Sambuc.Sh LIBRARY 37*0a6a1f1dSLionel Sambuc.Lb libelf 38*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS 39*0a6a1f1dSLionel Sambuc.In libelf.h 40*0a6a1f1dSLionel Sambuc.Ft size_t 41*0a6a1f1dSLionel Sambuc.Fn elf32_fsize "Elf_Type type" "size_t count" "unsigned int version" 42*0a6a1f1dSLionel Sambuc.Ft size_t 43*0a6a1f1dSLionel Sambuc.Fn elf64_fsize "Elf_Type type" "size_t count" "unsigned int version" 44*0a6a1f1dSLionel Sambuc.In gelf.h 45*0a6a1f1dSLionel Sambuc.Ft size_t 46*0a6a1f1dSLionel Sambuc.Fn gelf_fsize "Elf *elf" "Elf_Type type" "size_t count" "unsigned int version" 47*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION 48*0a6a1f1dSLionel SambucThese functions return the size in bytes of the file representation of 49*0a6a1f1dSLionel Sambuc.Ar count 50*0a6a1f1dSLionel Sambucnumbers of objects of ELF type 51*0a6a1f1dSLionel Sambuc.Ar type . 52*0a6a1f1dSLionel SambucFor ELF types that are of variable length, these functions return a 53*0a6a1f1dSLionel Sambucsize of one byte. 54*0a6a1f1dSLionel Sambuc.Pp 55*0a6a1f1dSLionel SambucFunctions 56*0a6a1f1dSLionel Sambuc.Fn elf32_fsize 57*0a6a1f1dSLionel Sambucand 58*0a6a1f1dSLionel Sambuc.Fn elf64_fsize 59*0a6a1f1dSLionel Sambucreturn sizes for files of class 60*0a6a1f1dSLionel Sambuc.Dv ELFCLASS32 61*0a6a1f1dSLionel Sambucand 62*0a6a1f1dSLionel Sambuc.Dv ELFCLASS64 63*0a6a1f1dSLionel Sambucrespectively. 64*0a6a1f1dSLionel SambucFunction 65*0a6a1f1dSLionel Sambuc.Fn gelf_fsize 66*0a6a1f1dSLionel Sambucreturns the size for the class of ELF descriptor 67*0a6a1f1dSLionel Sambuc.Ar elf . 68*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES 69*0a6a1f1dSLionel SambucThese functions return a non-zero value in case of success, or zero in 70*0a6a1f1dSLionel Sambuccase of an error. 71*0a6a1f1dSLionel Sambuc.Sh ERRORS 72*0a6a1f1dSLionel SambucThese functions may fail with: 73*0a6a1f1dSLionel Sambuc.Bl -tag -width "[ELF_E_RESOURCE]" 74*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 75*0a6a1f1dSLionel SambucArgument 76*0a6a1f1dSLionel Sambuc.Ar elf 77*0a6a1f1dSLionel Sambucwas NULL in a call to 78*0a6a1f1dSLionel Sambuc.Fn gelf_fsize . 79*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 80*0a6a1f1dSLionel SambucELF descriptor 81*0a6a1f1dSLionel Sambuc.Ar elf 82*0a6a1f1dSLionel Sambuchad an unknown ELF class. 83*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 84*0a6a1f1dSLionel SambucArgument 85*0a6a1f1dSLionel Sambuc.Ar type 86*0a6a1f1dSLionel Sambuccontained an illegal value. 87*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_UNIMPL 88*0a6a1f1dSLionel SambucSupport for ELF type 89*0a6a1f1dSLionel Sambuc.Ar type 90*0a6a1f1dSLionel Sambuchas not been implemented. 91*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_VERSION 92*0a6a1f1dSLionel SambucArgument 93*0a6a1f1dSLionel Sambuc.Ar version 94*0a6a1f1dSLionel Sambucis not a supported version. 95*0a6a1f1dSLionel Sambuc.El 96*0a6a1f1dSLionel Sambuc.Sh SEE ALSO 97*0a6a1f1dSLionel Sambuc.Xr elf 3 , 98*0a6a1f1dSLionel Sambuc.Xr gelf 3 99