Back to index

glibc  2.9
Functions | Variables
restest2.c File Reference
#include <sys/types.h>
#include <dlfcn.h>
#include <error.h>
#include <mcheck.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Functions

pid_t getpid (void)
int main (void)

Variables

pid_t pid
pid_t pid2

Function Documentation

pid_t getpid ( void  )

Definition at line 10 of file restest2.c.

{
  pid_t (*f)(void);
  f = (pid_t (*)(void)) dlsym (RTLD_NEXT, "getpid");
  if (f == NULL)
    error (EXIT_FAILURE, 0, "dlsym (RTLD_NEXT, \"getpid\"): %s", dlerror ());
  return (pid2 = f()) + 26;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( void  )

Definition at line 20 of file restest2.c.

{
  pid_t (*f)(void);

  mtrace ();

  f = (pid_t (*)(void)) dlsym (RTLD_DEFAULT, "getpid");
  if (f == NULL)
    error (EXIT_FAILURE, 0, "dlsym (RTLD_DEFAULT, \"getpid\"): %s", dlerror ());
  pid = f();
  if (pid != pid2 + 26)
    error (EXIT_FAILURE, 0, "main getpid() not called");
  return 0;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 8 of file restest2.c.

Definition at line 8 of file restest2.c.