user structure

This is a discussion on user structure within the Linux Programming forums, part of the Platform Specific Boards category; I'm currently doin a simple program on how to use PTRACE library. I've succeeded in knowing the system calls called ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    1

    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 http://www.cs.rit.edu/~hpb/Man/_Man_.../ptrace.2.html that this IS possible...
    PTRACE_SYSCALL
    ... 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.

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

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    Bizarre...
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 03:29 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  4. Structure Problem
    By Generator in forum C Programming
    Replies: 5
    Last Post: 07-29-2003, 12:54 AM
  5. C structure within structure problem, need help
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 11-30-2001, 05:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21