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.