Answer the question
In order to leave comments, you need to log in
System calls in Linux?
I have code, but I can't implement Link and Chown system output please help
#include
#include
#include
int main(void)
{
printf("System:\n");
printf(system("uname -n"));
printf(system("id -un"));
printf(system("uname -r"));
long d = gethostid();
printf("Host id = %li\n", d);
return 0;
}
Answer the question
In order to leave comments, you need to log in
Are you sure you understand what a " system call " is, and how it differs from calling the system function ?
It's not entirely clear what your problem is. For example, the link you need - from the mana we see that you need to connect
and call the link function, with two parameters - strings - the name of the existing file (let it be test.txt) and the new file name for the link, it looks something like this:link("test.txt", "newlinktotest.txt");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question