Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Maximum process stack size Message-ID: <3860@auspex.auspex.com> Date: 9 Aug 90 21:26:23 GMT References: <1454@tub.UUCP> Organization: Auspex Systems, Santa Clara Lines: 28 >Is there a way for a program to determine the maximum stack size of a >process on systems that don't support getrlimit(RLIMIT_STACK), such >as POSIX-, SVID-, or X/Open-systems? Not all POSIX-compliant, SVID-compliant, or X/Open-compliant systems lack "getrlimit()"; in fact, SVID Third Edition-compliant systems *have* to support "getrlimit(RLIMIT_STACK)" (as well as RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_NOFILE, and RLIMIT_AS). Neither POSIX, nor X/Open, nor SVIDs prior to the third edition specify any say of finding this information out, so if you're trying to write something that will work on *any* POSIX-compliant or *any* X/Open-compliant or *any* SVID-compliant system, you're out of luck. >If you don't know the general answer-- do you know if and how this can >be done under HP-UX? HP-UX does support "getrlimit()"? If there were such a mechanism, and they didn't stuff it into "ulimit()", I'd expect HP to stuff it there. If it's not there, you may be out of luck. >If this functionality doesn't exist, does this mean the stack of a process >can grow indefinitely? Err, no, you eventually run out of address space.... What other policies a particular UNIX implementation puts on the stack depend on the implementation, so there really aren't any hard-and-fast guarantees.