Replace C instructions for system calls

Hi!

At first I'm new to this forum and I'm not sure if this post is correct in this place.

I have a problem trying to change 2 C instructions for system calls. The code that I have is that:

#include <stdlib.h> 
#include <stdio.h> 
#include <string.h> 
#include <errno.h> 
#include <unistd.h> 
 
#include "rutines.h" 
 
int main(int argc, char *argv[]) 
{ 
    char cmd[256]; 
    int a; 
     
    if (argc<2) 
        Error("Insufficient arguments: exec_in <sec> <cmd> [args...]"); 
         
    sleep(atoi(argv[1])); 
     
    cmd[0]='\0'; 
    for(a=2;a<argc;a++) 
    { 
        strcat(cmd,argv[a]); 
        strcat(cmd," "); 
    } 
     
    system(cmd); 
         
    exit(0); 
}

I need to change the instructions sleep and system for some system calls (I use Ubuntu 12.04 64bits). I have only been using linux one week and I'm really lost. I never used system calls in C before. Someone can help me?

Thanks!

PS: sorry, I've some errors in the code that I posted, I corrected it.

Not clear what are you asking. Tell us what do you need to change the sleep call into. Also, what changes for system call.

Is this a homework assignment?

Homework and coursework questions can only be posted in this forum under special homework rules.

At first, yes, this is a homework, is it possibe to move to the correct form?

About the exercise, is not specific, only says, replace sleep and system for system calls (for example you can use exit, exec, pause, alarm, etc.) to obtain the same result as original code.

Thanks.

Moderator comments were removed during original forum migration.