c - storage size of isn’t known using sigaltstack struct -


i'm using sigalstack struct, details at:

here (mac osx)

here (linux)

i'm declaring

struct sigaltstack aa; 

and keep getting following error

error: storage size of ‘aa’ isn’t known 

i read , checked storage size of ‘names’ isn’t known i'm declaring it, doesn't apply.

you can't use uninitialized alternate stack that. have allocate space stack in ss_sp field , set corresponding size in ss_size field.

the man7 link linked has more information on this. in fact, provides example @ bottom of page:

stack_t ss;  ss.ss_sp = malloc(sigstksz); if (ss.ss_sp == null)     /* handle error */; ss.ss_size = sigstksz; ss.ss_flags = 0; if (sigaltstack(&ss, null) == -1)     /* handle error */; 

hope helps.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -