Thread: Minix and system calls!!!help!

  1. #16
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Once more so that we understand what you mean, please.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #17
    Registered User
    Join Date
    Apr 2008
    Posts
    11
    i just want to find out where i can put a printf to print the system call name that i just used.When i execute ls before see ls results i want to print am gonna execute :ls.what function starts when i type ls?

  3. #18
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Are you confusing system calls with core utilities?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #19
    Registered User
    Join Date
    Apr 2008
    Posts
    11
    maybe i just want to know what happens when i press ls

  5. #20
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Type
    which ls
    and it will tell you exactly which executable will be called.

    Then look at the source for it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #21
    Registered User
    Join Date
    Apr 2008
    Posts
    11
    CornedBee one last thing
    how can i print the executable's name every time something is being executed?

  7. #22
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    I fail to see how that would be useful, but I suppose you'd have to look into the CRT implementation of the exec* family, track it down to the lowest common function and modify that to do what you want.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #23
    Registered User
    Join Date
    Apr 2008
    Posts
    11
    is there any possibility to know exactly what function i have to modify?

  9. #24
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    how can i print the executable's name every time something is being executed?
    You don't mean something like this, by any chance?
    Code:
    #include <stdio.h>
    
    int main(int argc, char *argv[]) {
        printf("&#37;s\n", argv[0]);
        return 0;
    }
    [edit] Never mind, I obviously didn't read the thread properly. [/edit]

    [edit=2] Maybe this will be useful: http://www.raspberryginger.com/jbail...8c-source.html [/edit]
    Last edited by dwks; 04-02-2008 at 05:46 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  10. #25
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by squeezah View Post
    is there any possibility to know exactly what function i have to modify?
    Could we please know exactly what you're trying to do, just to make sure we're talking about something that makes sense? I mean your ULTIMATE goal. Are you trying to monitor everything every process ever does?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. minix system call pls help for project
    By porvas in forum Linux Programming
    Replies: 2
    Last Post: 06-14-2009, 02:40 AM
  2. Access file's info in MINIX
    By Zuko in forum Linux Programming
    Replies: 3
    Last Post: 01-07-2008, 10:14 AM
  3. starting linux's source code and kernel
    By sawer in forum Linux Programming
    Replies: 9
    Last Post: 08-01-2006, 07:46 AM