Back to index

php5  5.3.10
Functions
fpm_trace.h File Reference
#include <unistd.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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)
int fpm_trace_get_strz (char *buf, size_t sz, long addr)

Function Documentation

Definition at line 75 of file fpm_trace_mach.c.

{
       fpm_mach_vm_deallocate();
       target = 0;
       return 0;
}

Here is the call graph for this function:

int fpm_trace_get_long ( long  addr,
long *  data 
)

Definition at line 83 of file fpm_trace_mach.c.

{
       size_t offset = ((uintptr_t) (addr) % fpm_pagesize);
       vm_offset_t base = (uintptr_t) (addr) - offset;

       if (base != target_page_base) {
              fpm_mach_vm_deallocate();
              if (0 > fpm_mach_vm_read_page(base)) {
                     return -1;
              }
       }
       *data = * (long *) (local_page + offset);
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int fpm_trace_get_strz ( char *  buf,
size_t  sz,
long  addr 
)

Definition at line 11 of file fpm_trace.c.

{
       int i;
       long l;
       char *lc = (char *) &l;

       if (0 > fpm_trace_get_long(addr, &l)) {
              return -1;
       }

       i = l % SIZEOF_LONG;
       l -= i;
       for (addr = l; ; addr += SIZEOF_LONG) {
              if (0 > fpm_trace_get_long(addr, &l)) {
                     return -1;
              }
              for ( ; i < SIZEOF_LONG; i++) {
                     --sz;
                     if (sz && lc[i]) {
                            *buf++ = lc[i];
                            continue;
                     }
                     *buf = '\0';
                     return 0;
              }
              i = 0;
       }
}

Here is the call graph for this function:

Definition at line 57 of file fpm_trace_mach.c.

{
       kern_return_t kr;

       kr = task_for_pid(mach_task_self(), pid, &target);
       if (kr != KERN_SUCCESS) {
              char *msg = "";

              if (kr == KERN_FAILURE) {
                     msg = " It seems that master process does not have enough privileges to trace processes.";
              }
              zlog(ZLOG_ERROR, "task_for_pid() failed: %s (%d)%s", mach_error_string(kr), kr, msg);
              return -1;
       }
       return 0;
}

Here is the call graph for this function:

Definition at line 47 of file fpm_trace_mach.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:

Here is the caller graph for this function: