copy_process() help

From: Dan Smith (dmsmith2_at_ncsu.edu-NOSPAM)
Date: 02/25/04


Date: Wed, 25 Feb 2004 15:39:35 -0500


...Need a little kernel programming help...

We are trying to add some functionality to the kernel for a research
project. One of the things we need to do is clone a process ourselves.
  We can't (or don't want to) call fork() or clone() directly, because
we need to maintain a pointer to the new task, and perform some
modifications before the task runs.

We've created a syscall, and are using the _syscall1 macro to make the
syscall from userspace. We think that our problem is related to the
struct pt_regs parameter to copy_process(). The sys_fork() and
sys_clone() syscalls get the regs as a parameter, but we don't.

How do we get the struct pt_regs that we need to pass to copy_process()
to achieve the correct behavior?

--Dan



Relevant Pages

  • Re: [take6 1/3] kevent: Core files.
    ... anything other which is called before userspace. ... * Take that into account if you want to change size of struct ukevent. ... of calling syscall, so syscall just becomes "wait until there is a ... There are some issues with errno and rules for kernel-only errno ...
    (Linux-Kernel)
  • [ PATCH] execve: must clear current->clear_child_tid
    ... clonesyscall has special support for TID of created threads. ... The integer location is a user provided pointer, provided at clone() ... as full user memory is replaced by a new one. ... As glibc forkactually uses clonesyscall with CLONE_CHILD_SETTID ...
    (Linux-Kernel)
  • [PATCH 11/18] flag parameters: inotify_init
    ... for the one parameter the syscall takes, as opposed to no parameter before). ... int coe = fcntl ... struct inotify_device *dev; ...
    (Linux-Kernel)
  • Re: [PATCH 2 of 4] Introduce i386 fibril scheduling
    ... > struct asys_ret { ... the syscall arguments, but once the syscall's in progress there's no ... that's the only sane way you can have a ring for submitted ... user threads that had their syscalls complete. ...
    (Linux-Kernel)
  • Re: Weird truss output
    ... thread called which syscall. ... 'struct syscall' describes the system call; ... int number; ...
    (freebsd-stable)