1b3e94a20d
From release 0.1.0 pre-patched archive. This includes all Red Bear modifications previously maintained as patches in local/patches/relibc/.
21 lines
413 B
C
21 lines
413 B
C
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "test_helpers.h"
|
|
|
|
int main(void) {
|
|
int fd = open("/usr", O_DIRECTORY);
|
|
ERROR_IF(open, fd, == -1);
|
|
UNEXP_IF(open, fd, < 0);
|
|
|
|
int status = fchdir(fd);
|
|
ERROR_IF(fchdir, status, == -1);
|
|
UNEXP_IF(fchdir, status, != 0);
|
|
|
|
int c = close(fd);
|
|
ERROR_IF(close, c, == -1);
|
|
UNEXP_IF(close, c, != 0);
|
|
}
|