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