If you create a file called /bin/loop with the following contents:
#!/bin/loop
The VINIX kernel will infinitely recurse in the userland.start_program function, until it eventually runs out of stack space and panics.
The way Linux deals with this case is by keeping track of the recursion depth, and setting errno = ELOOP and returning if the arbitrary max depth is reached (I believe the depth is 4 on linux, but don't quote me on that).
If you create a file called
/bin/loop
with the following contents:The VINIX kernel will infinitely recurse in the userland.start_program function, until it eventually runs out of stack space and panics.
The way Linux deals with this case is by keeping track of the recursion depth, and setting errno = ELOOP and returning if the arbitrary max depth is reached (I believe the depth is 4 on linux, but don't quote me on that).