elf_errno man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]


       elf_errmsg, elf_errno - error handling

       cc [ flag ... ] file ... -lelf [ library ... ]
       #include <libelf.h>

       const char *elf_errmsg(int err);

       int elf_errno(void);

       If  an  ELF  library  function fails, a program can call elf_errno() to
       retrieve the library's internal error number. As a  side	 effect,  this
       function	 resets	 the  internal	error  number to 0, which indicates no

       The elf_errmsg() function takes an error number,	 err,  and  returns  a
       null-terminated	 error	 message  (with	 no  trailing  new-line)  that
       describes the problem. A zero err retrieves  a  message	for  the  most
       recent  error.  If  no  error  has occurred, the return value is a null
       pointer (not a pointer to the  null  string).  Using  err  of  −1  also
       retrieves the most recent error, except it guarantees a non-null return
       value, even when no error has occurred. If no message is available  for
       the given number, elf_errmsg() returns a pointer to an appropriate mes‐
       sage. This function does not have  the  side  effect  of	 clearing  the
       internal error number.

       Example 1 A sample program of calling the elf_errmsg() function.

       The  following  fragment clears the internal error number and checks it
       later for errors. Unless an  error  occurs  after  the  first  call  to
       elf_errno(), the next call will return 0.

	 /* processing ... */
	 while (more_to_do)
	      if ((err = elf_errno()) != 0)
		   /* print msg */
		   msg = elf_errmsg(err);

       See attributes(5) for descriptions of the following attributes:

       │Interface Stability │ Stable	      │
       │MT-Level	    │ MT-Safe	      │

       elf(3ELF), libelf(3LIB), attributes(5)

				 Jul 11, 2001		      ELF_ERRMSG(3ELF)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net