Thread: user structure

  1. #1
    Registered User
    Join Date
    Aug 2004

    user structure

    I'm currently doin a simple program on how to use PTRACE library.
    I've succeeded in knowing the system calls called whenever a UNIX command is invoked (let say "ls -l" will call system call SYS_open).

    But I'm having trouble in finding out the arguments (or parameter list) for each system call made.
    I read in that this IS possible...
    ... At this point the arguments to the system call may be inspected in the process user structure using the PTRACE_PEEKUSER request. The system call number is available in place of the 8th argument...
    But I really had having hard time understanding the user structure.
    Does anyone know how to use it to extract the system call argument list?
    Note that I'm not on Sun or BSD machine, so I can't use any of the <kvm.h> functions.

    Last edited by potpourri; 08-22-2004 at 09:48 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    You quote from a manual page which refers to SunOS.
    Then you say you're not using SunOS.

    In fact, it remains an assumption that you're using Linux, since you only state two machines you're not using.

    1. Read the manual page for the machine you're actually running on.
    2. State your machine and compiler when you post something massively implementation specific as this.
    3. Post some actual code you tried, not some cut/paste of a manual page we're all perfectly capable of reading for ourselves.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 12-14-2007, 03:34 PM
  2. Using Variable To Read Structure
    By CyBeR in forum C++ Programming
    Replies: 35
    Last Post: 10-24-2007, 02:29 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Structure Problem
    By Generator in forum C Programming
    Replies: 5
    Last Post: 07-28-2003, 11:54 PM
  5. C structure within structure problem, need help
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 11-30-2001, 05:48 PM