| 1 | // RUN: %clangxx -O0 %s -o %t && %run %t |
|---|---|
| 2 | // UNSUPPORTED: android |
| 3 | |
| 4 | #include <assert.h> |
| 5 | #include <fcntl.h> |
| 6 | #include <stdlib.h> |
| 7 | #include <sys/stat.h> |
| 8 | #include <sys/types.h> |
| 9 | |
| 10 | int main(int argc, char **argv) { |
| 11 | int mount_id; |
| 12 | struct file_handle *handle = reinterpret_cast<struct file_handle *>( |
| 13 | malloc(size: sizeof(*handle) + MAX_HANDLE_SZ)); |
| 14 | |
| 15 | handle->handle_bytes = MAX_HANDLE_SZ; |
| 16 | int res = name_to_handle_at(AT_FDCWD, name: "/dev/null", handle: handle, mnt_id: &mount_id, flags: 0); |
| 17 | assert(!res); |
| 18 | |
| 19 | free(ptr: handle); |
| 20 | return 0; |
| 21 | } |
| 22 |
