6main (
int argc,
char *argv[])
14 printf (
"usage: recursor <string> <depth> <waitp>\n");
19 printf (
"%s %s %s %s\n", argv[0], argv[1], argv[2], argv[3]);
22 if (
atoi (argv[2]) != 0)
25 "recursor %s %d %s", argv[1],
atoi (argv[2]) - 1, argv[3]);
32 printf (
"%s %s: dying, retval=%d\n", argv[1], argv[2], retval);
static void wait(struct intq *q, struct thread **waiter)
int snprintf(char *buffer, size_t buf_size, const char *format,...)
Like printf(), except that output is stored into BUFFER, which must have space for BUF_SIZE character...
int printf(const char *format,...)
Writes formatted output to the console.
int atoi(const char *s)
Converts a string representation of a signed decimal integer in S into an ‘int’, which is returned.
pid_t exec(const char *file)
int pid_t
Process identifier.
int main(int argc, char *argv[])