diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-26 23:42:17 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-26 23:42:17 +0200 |
commit | 0f6e6d9861ce790cb8b7d07aca28a5878d705359 (patch) | |
tree | f5a51847c9fb1095b19c092e697850939c29a908 /proc.c | |
parent | d3202de1176057520f49b5e6231b8774f6b6b31f (diff) | |
download | ltrace-0f6e6d9861ce790cb8b7d07aca28a5878d705359.tar.gz |
Add os_process_data and related
This is meant to be the same for per-OS configuration as arch_process_data
is for per-arch configuration.
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 40 |
1 files changed, 37 insertions, 3 deletions
@@ -66,6 +66,31 @@ arch_process_exec(struct Process *proc) } #endif +#ifndef OS_HAVE_PROCESS_DATA +int +os_process_init(struct Process *proc) +{ + return 0; +} + +void +os_process_destroy(struct Process *proc) +{ +} + +int +os_process_clone(struct Process *retp, struct Process *proc) +{ + return 0; +} + +int +os_process_exec(struct Process *proc) +{ + return 0; +} +#endif + #ifndef ARCH_HAVE_DYNLINK_DONE void arch_dynlink_done(struct Process *proc) @@ -158,7 +183,13 @@ process_init(struct Process *proc, const char *filename, pid_t pid) return -1; } + if (os_process_init(proc) < 0) { + process_bare_destroy(proc, 0); + goto fail; + } + if (arch_process_init(proc) < 0) { + os_process_destroy(proc); process_bare_destroy(proc, 0); goto fail; } @@ -229,15 +260,17 @@ void process_destroy(struct Process *proc) { arch_process_destroy(proc); + os_process_destroy(proc); private_process_destroy(proc, 0); } int process_exec(struct Process *proc) { - /* Call exec handler first, before we destroy the main + /* Call exec handlers first, before we destroy the main * state. */ - if (arch_process_exec(proc) < 0) + if (arch_process_exec(proc) < 0 + || os_process_exec(proc) < 0) return -1; private_process_destroy(proc, 1); @@ -389,7 +422,8 @@ process_clone(struct Process *retp, struct Process *proc, pid_t pid) } } - if (arch_process_clone(retp, proc) < 0) + if (os_process_clone(retp, proc) < 0 + || arch_process_clone(retp, proc) < 0) goto fail4; return 0; |