Find the answer to your Linux question:
Results 1 to 2 of 2
I am trying to figure out, how i can find out where system call is made. Ones i figure out where system call is made i want to make sure ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    2

    error checking and system calls


    I am trying to figure out, how i can find out where system call is made. Ones i figure out where system call is made i want to make sure error checking is done there. I have 3 c files i am working with and i need figure out where the system call is made. How can i test for error or system call is made?

    I have few lines of code below, are these system calls? pipe, dup2?

    if (pipefd[0] == PARSE_USEPIPE) {
    pipe(pipefd);
    setoutpipe = 1;

    pid = fork();
    if (!pid) { /* child */
    if (setoutpipe) {
    dup2(pipefd[1], 1); /* connect stdout to pipe if necessary */


    }
    if (!setoutpipe && (pipefd[0] > -1)) {
    /* Need to set up an input pipe. */
    dup2(pipefd[0], 0);

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,257
    If you run your program using strace, it will trace and report all system calls to stderror.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •