libct: start CT in a new session by default (v2)

v2: add a NOSETSID option in uapi/libct.h

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: set console (v2)

A console is set as controll terminal for the init in CT.

v2: add a wrapper in the C library
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: Use ERR_ helpers instead of duplicating code

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: Require error codes to be explicitly signed if needed

Same as kernel does -- error constants are positive values
but signed when needed. This allows to unify all the code
where constant -1 is mixed with LCTERR_ codes.

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