process.c (dc26184a9d4acde988e996a437b0301b81c1ae2d) | process.c (76ed9158e1d474e963fc59da7a461b27a2212c5a) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de) 4 * Copyright (C) 2002- 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 5 */ 6 7#include <stdlib.h> 8#include <stdbool.h> --- 487 unchanged lines hidden (view full) --- 496 497 /* 498 * prepare offset and fd of child's stack as argument for parent's 499 * and child's mmap2 calls 500 */ 501 *data = ((struct stub_data) { 502 .offset = MMAP_OFFSET(new_offset), 503 .fd = new_fd, | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de) 4 * Copyright (C) 2002- 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 5 */ 6 7#include <stdlib.h> 8#include <stdbool.h> --- 487 unchanged lines hidden (view full) --- 496 497 /* 498 * prepare offset and fd of child's stack as argument for parent's 499 * and child's mmap2 calls 500 */ 501 *data = ((struct stub_data) { 502 .offset = MMAP_OFFSET(new_offset), 503 .fd = new_fd, |
504 .parent_err = -ESRCH, | 504 .err = -ESRCH, |
505 .child_err = 0, 506 }); 507 508 *child_data = ((struct stub_data) { 509 .child_err = -ESRCH, 510 }); 511 512 err = ptrace_setregs(pid, thread_regs); --- 20 unchanged lines hidden (view full) --- 533 err = -errno; 534 printk(UM_KERN_ERR "Failed to continue new process, pid = %d, errno = %d\n", 535 pid, errno); 536 return err; 537 } 538 539 wait_stub_done(pid); 540 | 505 .child_err = 0, 506 }); 507 508 *child_data = ((struct stub_data) { 509 .child_err = -ESRCH, 510 }); 511 512 err = ptrace_setregs(pid, thread_regs); --- 20 unchanged lines hidden (view full) --- 533 err = -errno; 534 printk(UM_KERN_ERR "Failed to continue new process, pid = %d, errno = %d\n", 535 pid, errno); 536 return err; 537 } 538 539 wait_stub_done(pid); 540 |
541 pid = data->parent_err; | 541 pid = data->err; |
542 if (pid < 0) { 543 printk(UM_KERN_ERR "%s - stub-parent reports error %d\n", 544 __func__, -pid); 545 return pid; 546 } 547 548 /* 549 * Wait, until child has finished too: read child's result from --- 143 unchanged lines hidden --- | 542 if (pid < 0) { 543 printk(UM_KERN_ERR "%s - stub-parent reports error %d\n", 544 __func__, -pid); 545 return pid; 546 } 547 548 /* 549 * Wait, until child has finished too: read child's result from --- 143 unchanged lines hidden --- |