diff options
Diffstat (limited to 'src/sysdeps')
-rw-r--r-- | src/sysdeps/trychroot.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sysdeps/trychroot.c b/src/sysdeps/trychroot.c new file mode 100644 index 0000000..42d8872 --- /dev/null +++ b/src/sysdeps/trychroot.c @@ -0,0 +1,20 @@ +/* ISC license. */ + +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif + +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif + +#include <unistd.h> + +int main (void) +{ + if (chroot("/") < 0) return 1 ; + return 0 ; +} |