dump: Pass whole struct pid into thread dumping routine

And do "get real pid, report virtual one" inside.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Pass CoreEntry into thread-dumping routine

The number of arguments used to carry data via them is too
big already. Just fill the required core fields inside.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fs: Support umask dump/restore

This one is bound to task's fs info (with cwd and root)
thus put it in the fs.img file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
sysctl: zero is a valid number for a file descriptor

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: Don't allocate memory to mprotect with calloc

On my FC17 box calloc calls brk() and the subsequent mprotect(PROT_EXEC)
fails with EACCESS. Using mmap is safer here.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr: Support rlimits

Dump the with "new" prlimit syscall that works on arbitrary pid.

Restore is done in restorer _after_ mappings mixup and _before_
caps drop to make it set any max value.

The RLIM_INFINITY is handled explicitly to help future 64<->32
bits migration.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: Test that rlimits are c/r-ed

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Test suite: added support for the Debian distribution.

* Replaced the shell interpreter with bash to run
  the script test/zdtm.sh correctly.

* Added new directories into the routine contruct_root()
  searched by the Debian version of the dynamic linker.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>