Back to index

php5  5.3.10
Defines | Functions | Variables
fpm_trace_pread.c File Reference
#include "fpm_config.h"
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include "fpm_trace.h"
#include "fpm_process_ctl.h"
#include "zlog.h"

Go to the source code of this file.

Defines

#define _GNU_SOURCE
#define _FILE_OFFSET_BITS   64

Functions

int fpm_trace_signal (pid_t pid)
int fpm_trace_ready (pid_t pid)
int fpm_trace_close (pid_t pid)
int fpm_trace_get_long (long addr, long *data)

Variables

static int mem_file = -1

Define Documentation

#define _FILE_OFFSET_BITS   64

Definition at line 6 of file fpm_trace_pread.c.

#define _GNU_SOURCE

Definition at line 5 of file fpm_trace_pread.c.


Function Documentation

Definition at line 50 of file fpm_trace_pread.c.

{
       close(mem_file);
       mem_file = -1;
       return 0;
}

Here is the call graph for this function:

int fpm_trace_get_long ( long  addr,
long *  data 
)

Definition at line 58 of file fpm_trace_pread.c.

{
       if (sizeof(*data) != pread(mem_file, (void *) data, sizeof(*data), (uintptr_t) addr)) {
              zlog(ZLOG_SYSERROR, "pread() failed");
              return -1;
       }
       return 0;
}

Definition at line 36 of file fpm_trace_pread.c.

{
       char buf[128];

       sprintf(buf, "/proc/%d/" PROC_MEM_FILE, (int) pid);
       mem_file = open(buf, O_RDONLY);
       if (0 > mem_file) {
              zlog(ZLOG_SYSERROR, "failed to open %s", buf);
              return -1;
       }
       return 0;
}

Here is the call graph for this function:

Definition at line 26 of file fpm_trace_pread.c.

{
       if (0 > fpm_pctl_kill(pid, FPM_PCTL_STOP)) {
              zlog(ZLOG_SYSERROR, "failed to send SIGSTOP to %d", pid);
              return -1;
       }
       return 0;
}

Here is the call graph for this function:


Variable Documentation

int mem_file = -1 [static]

Definition at line 24 of file fpm_trace_pread.c.