01-22-2007
How to find out the stack size occupied for a process?
Hi,
In Linux how to find out what will be the stack size allocated for a process?
Actually i have to fork n number of processess, and will call exec. I will be execing an executable which is already multithreaded and each thread size is defined. My doubt is how to know if the size of the stack created by the process will be sufficient for the already existing multitthreaded process. Can anyone help me in this please??
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
Please help me to know, How to find out the how much amount of process addres space is required/is used for/by a process.
Tnx & Regards
Vishwa. (1 Reply)
Discussion started by: S.Vishwanath
1 Replies
2. Programming
Hi!!,
could someone tell me how to increase the stack size in HP-UX?
Thanx (7 Replies)
Discussion started by: jyotipg
7 Replies
3. UNIX for Advanced & Expert Users
hi all,
I need to find out the Stack usage of an App which is basically an mpeg4 decoder. We are plannin to port the codec to an RTOS. so is there any way to find out the max stack size while the codec is running?
saTs (1 Reply)
Discussion started by: satish_somu
1 Replies
4. UNIX for Advanced & Expert Users
I want to find out how many disk blocks are used by only data (and not metadata) by a file.
But as far as I can tell, if the file has holes, then there is no way to know this.
You can find out the logical size of the file (physical size + hole blocks).
You can get the physical size of the... (3 Replies)
Discussion started by: the_learner
3 Replies
5. Shell Programming and Scripting
Hello
i am working on a project here is part of script that i need a help in
get process SpectroSERVER current size if it exceed 3850 MB then
#pkill -TERM ArchMgr
and wait to succfull shutdown message from the log file to proceed to the next step
#tail -f $SPECROOT/SS/DDM/ARCHMGR.OUT... (7 Replies)
Discussion started by: mogabr
7 Replies
6. Programming
Hi,
I am looking to work on unix systems which include (hp-ux, ibm aix, solaris and linux). I want to get the total virtual address space of a process, the used virtual memory i am able to get without any problem. I have tried using getrlimit and getrlimit64, but that gives only ... (4 Replies)
Discussion started by: uiqbal
4 Replies
7. Shell Programming and Scripting
I want to extend this script.
This must also be able to show me that a port is already assigned to a service but not running now
there must be three different messages
port 8949 is open but not listening
port 8959 is open
port 8999 hasn't been assigned to any service.
I know that... (1 Reply)
Discussion started by: charan314
1 Replies
8. Programming
Can someone explain me, why when I create new threads with stack bigger than default (using pthread_attr_setstacksize()) i can create more? Each thread has it's own stack, so how bigger stack can cause possibility to create more threads? (7 Replies)
Discussion started by: dawwin
7 Replies
9. UNIX for Advanced & Expert Users
Hi All,
I have set max stack size as 4KB for my thread, but it always using very less.
So I like to know what is the maximum stack size is used by my thread.
I tried with gcc -fstack-usage command line option, but its not supported by mips.
Kindly suggest me the way to find the max stack... (6 Replies)
Discussion started by: rajamohan
6 Replies
10. Shell Programming and Scripting
hi,
I just wondering is there any way that I can record the stack size of shell script at runtime. (2 Replies)
Discussion started by: yc962frank
2 Replies
LEARN ABOUT OPENSOLARIS
sigstack
sigstack(3C) Standard C Library Functions sigstack(3C)
NAME
sigstack - set and/or get alternate signal stack context
SYNOPSIS
#include <signal.h>
int sigstack(struct sigstack *ss, struct sigstack *oss);
DESCRIPTION
The sigstack() function allows the calling process to indicate to the system an area of its address space to be used for processing signals
received by the process.
If the ss argument is not a null pointer, it must point to a sigstack structure. The length of the application-supplied stack must be at
least SIGSTKSZ bytes. If the alternate signal stack overflows, the resulting behavior is undefined. (See USAGE below.)
o The value of the ss_onstack member indicates whether the process wants the system to use an alternate signal stack when deliver-
ing signals.
o The value of the ss_sp member indicates the desired location of the alternate signal stack area in the process' address space.
o If the ss argument is a null pointer, the current alternate signal stack context is not changed.
If the oss argument is not a null pointer, it points to a sigstack structure in which the current alternate signal stack context is placed.
The value stored in the ss_onstack member of oss will be non-zero if the process is currently executing on the alternate signal stack. If
the oss argument is a null pointer, the current alternate signal stack context is not returned.
When a signal's action indicates its handler should execute on the alternate signal stack (specified by calling sigaction(2)), sigstack()
checks to see if the process is currently executing on that stack. If the process is not currently executing on the alternate signal
stack, the system arranges a switch to the alternate signal stack for the duration of the signal handler's execution.
After a successful call to one of the exec functions, there are no alternate signal stacks in the new process image.
RETURN VALUES
Upon successful completion, sigstack() returns 0. Otherwise, it returns -1 and sets errno to indicate the error.
ERRORS
The sigstack() function will fail if:
EPERM An attempt was made to modify an active stack.
USAGE
A portable application, when being written or rewritten, should use sigaltstack(2) instead of sigstack().
The direction of stack growth is not indicated in the historical definition of struct sigstack. The only way to portably establish a stack
pointer is for the application to determine stack growth direction, or to allocate a block of storage and set the stack pointer to the mid-
dle. sigstack() may assume that the size of the signal stack is SIGSTKSZ as found in <signal.h>. An application that would like to specify
a signal stack size other than SIGSTKSZ should use sigaltstack(2).
Applications should not use longjmp(3C) to leave a signal handler that is running on a stack established with sigstack(). Doing so may dis-
able future use of the signal stack. For abnormal exit from a signal handler, siglongjmp(3C), setcontext(2), or swapcontext(3C) may be
used. These functions fully support switching from one stack to another.
The sigstack() function requires the application to have knowledge of the underlying system's stack architecture. For this reason, sigalt-
stack(2) is recommended over this function.
SEE ALSO
fork(2), _longjmp(3C), longjmp(3C), setjmp(3C), sigaltstack(2), siglongjmp(3C), sigsetjmp(3C)
SunOS 5.11 28 Feb 1996 sigstack(3C)