I'm trying to add a user space program in xv6, but when I try to compile it gives error: "/usr/include/bits/stdio2.h:104: undefined reference to __printf_chk"
. Any help?
My user program:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/user.h>
int
main(int argc, char *argv[])
{
setbuf(stdout, NULL);
for (int i = 1; i < argc; i++)
{
printf("Print in user space: %s\n", argv[0]);
}
exit(0);
return 0;
}