Back to index

glibc  2.9
Defines | Functions
backtracesymsfd.c File Reference
#include <execinfo.h>
#include <string.h>
#include <sys/uio.h>
#include <stdio-common/_itoa.h>
#include <not-cancel.h>

Go to the source code of this file.


#define WORD_WIDTH   16


void __backtrace_symbols_fd (void *const *array, int size, int fd)

Define Documentation

#define WORD_WIDTH   16

Definition at line 32 of file backtracesymsfd.c.

Function Documentation

void __backtrace_symbols_fd ( void *const array,
int  size,
int  fd 

Definition at line 37 of file backtracesymsfd.c.

  struct iovec iov[3];
  int cnt;

  for (cnt = 0; cnt < size; ++cnt)
      char buf[WORD_WIDTH];

      iov[0].iov_base = (void *) "[0x";
      iov[0].iov_len = 3;

      iov[1].iov_base = _itoa_word ((unsigned long int) array[cnt],
                                &buf[WORD_WIDTH], 16, 0);
      iov[1].iov_len = &buf[WORD_WIDTH] - (char *) iov[1].iov_base;

      iov[2].iov_base = (void *) "]\n";
      iov[2].iov_len = 2;

      /* We prefer to use the non-cancelable interface if it is available.  */
      writev_not_cancel_no_status (fd, iov, 3);

Here is the call graph for this function:

Here is the caller graph for this function: