from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209583

userrating:


May 25th. 2007:
Words

486

Views

258591

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149881

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





ELF_NEXT

Section: Libelf Programmer's Manual (3)
Updated: 202-0-06
Index Return to Main Contents

 

NAME

elf_next - advance an ELF descriptor to the next archive member

 

SYNOPSIS

#include <libelf.h>

Elf_Cmd elf_next(Elf *elf);
 

DESCRIPTION

Advance an ELF descriptor associated with an archive file to the next available archive member.

ELF descriptors initialized from an archive file can be used to retrieve ELF descriptors for archive members one at a time using elf_begin(3). elf_next(3) updates the archive descriptor so that elf_begin(3) returns the ELF descriptor of the next member of the archive. See the EXAMPLES section below.

 

RETURN VALUE

If elf refers to an archive member, update the state of the parent archive ELF descriptor associated with elf so that the next archive member can be retrieved with elf_begin(3). Return the Elf_Cmd that was used with elf_begin(3) to initialize elf.

If elf was not initialized from an archive file or there are no more archive members, elf_next(3) returns ELF_C_NULL.

 

EXAMPLES

  /* Open the archive.  */
  fd = open (archive_name, O_RDONLY);
  if (fd ==-1)
    {
      printf ("cannot open archive file `%s'", fname);
      exit (1);
    }

  /* Set the ELF version.  */
  elf_version (EV_CURRENT);

  /* Create an ELF descriptor for the archive.  */
  cmd = ELF_C_READ;
  elf = elf_begin (fd, cmd, NULL);
  if (elf == NULL)
    {
      printf ("cannot create ELF descriptor: %sn", elf_errmsg -1));
      exit (1);
    }

  /* Verify this is a descriptor for an archive.  */
  if (elf_kind (elf) != ELF_K_AR)
    {
      printf ("`%s' is not an archiven", fname);
      exit (1);
    }

  /* Get the members of the archive one after the other.  */
  while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
    {
      /* Process subelf here */
      [...]

      /* elf_next updates elf, the parent archive, so that the next call
         to elf_begin returns the next archive member.  */
      cmd = elf_next (subelf);
      if (elf_end (subelf) != 0)
        {
          printf ("error while freeing su-ELF descriptor: %sn",
                  elf_errmsg -1));
          exit (1);
        }
    }

  elf_end (elf);
  close (fd);

 

SEE ALSO

elf_begin(3), elf_rand(3), libelf(3), elf(5)

 

ATTRIBUTES

InterfaceAttributeValue
elf_next() Thread safetyM-Safe

 

REPORTING BUGS

Report bugs to <elfutil-devel@sourceware.org> or https://sourceware.org/bugzilla/.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLES
SEE ALSO
ATTRIBUTES
REPORTING BUGS





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 14.9 ms