I am trying to illustrate the reverse order of parameters on the stack when passed to a function in C:
Result is:
This is as expected on the 64 bit system (Ubuntu 19.04)
When I pass a structure as a parameter the stack looks puzzling to me:
Now result is:
Parameter 3 is close to 1 and parameter 2 is not between 1 and 3? offsets look wrong to me.Please shed some light here, thanks in advance.
The compiler is gcc 7.4.0
I'm sorry if something like this has already been posted, but I didn't find anything like it.
I'm using ksh The code that I've come up with will initially print what I want, but will then keep repeating the second number. I'm just trying to teach myself and can't seem to find the code to work.... (16 Replies)
Hi,
I'm using xterm and aixterm with Mwm on AIX, and having trouble controlling icon placement when minimising windows. Basically when I run an xterm or aixterm I want to be able to specify where the icon will be if minimised.
The man page mentions the "#geometry Geometry" option to aixterm,... (1 Reply)
Hi,
I'm using xterm and aixterm with Mwm on AIX, and having trouble controlling icon placement when minimising windows. Basically when I run an xterm or aixterm I want to be able to specify where the icon will be if minimised.
The man page mentions the "#geometry Geometry" option to aixterm,... (1 Reply)
Hi,
I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
I have been asked to place 2 (1 NTOP & 1 SNORT) boxes within our network as part of our tool kit for network monitoring and Intrusion detection. Out network is very simplistic and it layed out like this:
internet
|
|
Cisco 1811 Router (8x Layer 2 switch ports)
... (0 Replies)
Hi, I am programming in kernel, and I want to use a double linked list that holds infos that every process could access and modify THIS list. So, I suppose it is a 'global' variable since every process(thread) can reach it, I am wondering where to put it? by changing some of the kernel files? (1 Reply)
Discussion started by: louisTan
1 Replies
LEARN ABOUT BSD
sigstack
SIGSTACK(2) System Calls Manual SIGSTACK(2)NAME
sigstack - set and/or get signal stack context
SYNOPSIS
#include <signal.h>
struct sigstack {
caddr_t ss_sp;
int ss_onstack;
};
sigstack(ss, oss);
struct sigstack *ss, *oss;
DESCRIPTION
Sigstack allows users to define an alternate stack on which signals are to be processed. If ss is non-zero, it specifies a signal stack on
which to deliver signals and tells the system if the process is currently executing on that stack. When a signal's action indicates its
handler should execute on the signal stack (specified with a sigvec(2) call), the system checks to see if the process is currently execut-
ing on that stack. If the process is not currently executing on the signal stack, the system arranges a switch to the signal stack for the
duration of the signal handler's execution. If oss is non-zero, the current signal stack state is returned.
NOTES
Signal stacks are not ``grown'' automatically, as is done for the normal stack. If the stack overflows unpredictable results may occur.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Sigstack will fail and the signal stack context will remain unchanged if one of the following occurs.
[EFAULT] Either ss or oss points to memory that is not a valid part of the process address space.
SEE ALSO sigvec(2), setjmp(3)4.2 Berkeley Distribution June 30, 1985 SIGSTACK(2)