1 | // REQUIRES: linux |
---|---|
2 | // RUN: %clangxx_msan -O0 %s -o %t && %run %t |
3 | |
4 | #include <cassert> |
5 | #include <cstdlib> |
6 | #include <fcntl.h> |
7 | #include <sys/stat.h> |
8 | |
9 | int main(void) { |
10 | struct stat64 st; |
11 | int dirfd = open(file: "/dev", O_RDONLY); |
12 | if (fstatat64(fd: dirfd, file: "null", buf: &st, flag: 0)) |
13 | exit(1); |
14 | |
15 | assert(S_ISCHR(st.st_mode)); |
16 | |
17 | return 0; |
18 | } |
19 |