start_stack question

Manfred Spraul (manfreds@colorfullife.com)
Mon, 15 Nov 1999 18:32:59 +0100


sys_shmat() contains the following lines:
/*
* If shm segment goes below stack, make sure there is some
* space left for the stack to grow (presently 4 pages).
*/
if (addr < current->mm->start_stack &&
addr > current->mm->start_stack - PAGE_SIZE*(shp->shm_npages + 4))
goto out_unlock_up;

IMHO the test looks weird, is that really required?
* what if the stack is longer than 4 pages?
* what if the current process is multi-threaded?
* [the line is nearly identical to the test in linux-1.0.9]

Please help, I have not yet read the details of the mmap code.

Thanks,
Manfred

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/