rst: Compile fix for rst mem API usage in rlims

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
always set scheduler and priority in restore to ensure correctness

Make criu still set scheduler and priority on restored process even
when its setting is the default one. Or if criu itself has special
setting on it, forked processes will inherit it, which is a wrong setting
for restored ones.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
x86: Sanitize arch_alloc_thread_info

- We have a convention to return -1 on error
- Drop empty line

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: Fix memory alloc/frees for core entry, v2

- return -1 on error
- assign allocated entries immediately
- test for fpstate allocated on free path

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pstree: Move thread_core allocation to generic routine

It's not arch dependent by any means, thus it looks
strange that we allocate it in arch/ but free in
pstree.c.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
syscalls -- Add sys_sigaltstack

Will need it to retrieve signal stack parameters.
Note for simplicty I declared the syscall having
void * arguments, while libc has it as stack_t *.
This need to be cleaned up one day (because
we use similar structure for sigframe definition
and need to merge both definitions down).

ARM syscall def from alekskartashov@

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
headers: Beautify sigframe.h

- include "protobuf/core.pb-c.h" for CoreEntry definition
- gather structure predeclaration on top
- move general comment on top as well
- add extern for construct_sigframe helper

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>