2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-26 03:47:35 +00:00
criu/compel/test/rsys/victim.c
Pavel Emelyanov 483f3e886b compel: Test for remote syscall execution
The library can be used not only to run infection blobs,
but also just to execute syscalls remotely and here's
an example of how to do this.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:14 +03:00

17 lines
192 B
C

#include <unistd.h>
int main(int argc, char **argv)
{
int i;
while (1) {
if (read(0, &i, sizeof(i)) != sizeof(i))
break;
i = getsid(0);
write(1, &i, sizeof(i));
}
return 0;
}