farid99
farid99

Reputation: 712

using u_context structs - what is uc_stack.ss_flags used for?

I am attempting to manipulate threads in a C++ application using getContext() and setContext(). I noticed the ucontext_t struct has this field, uc_stack.ss_flags. What can these flags be used for? I am wondering how they could be used for garbage collection in a thread library. Usually they are set to zero by default.

Upvotes: 0

Views: 1681

Answers (1)

John Zwinck
John Zwinck

Reputation: 249502

In sigstack.h I see:

/* Possible values for `ss_flags.'.  */
enum
{
  SS_ONSTACK = 1,
#define SS_ONSTACK  SS_ONSTACK
  SS_DISABLE
#define SS_DISABLE  SS_DISABLE
};

Search for those takes us here: http://pubs.opengroup.org/onlinepubs/009695399/functions/sigaltstack.html

Which says:

  • SS_ONSTACK The process is currently executing on the alternate signal stack. Attempts to modify the alternate signal stack while the process is executing on it fail. This flag shall not be modified by processes.
  • SS_DISABLE The alternate signal stack is currently disabled.

Upvotes: 2

Related Questions