1 // Copyright 2017 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <fcntl.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <threads.h>
10 
11 #include <blobfs/blobfs.h>
12 #include <fs/vfs.h>
13 #include <fuchsia/io/c/fidl.h>
14 #include <lib/fdio/io.h>
15 #include <lib/fdio/util.h>
16 #include <lib/fdio/vfs.h>
17 #include <zircon/device/vfs.h>
18 #include <zircon/syscalls.h>
19 #include <zircon/types.h>
20 
21 namespace blobfs {
22 
GetHandles(uint32_t flags,fuchsia_io_NodeInfo * info)23 zx_status_t VnodeBlob::GetHandles(uint32_t flags, fuchsia_io_NodeInfo* info) {
24     if (IsDirectory()) {
25         info->tag = fuchsia_io_NodeInfoTag_directory;
26         return ZX_OK;
27     }
28     info->tag = fuchsia_io_NodeInfoTag_file;
29     zx_status_t r = GetReadableEvent(&info->file.event);
30     if (r < 0) {
31         return r;
32     }
33 
34     return ZX_OK;
35 }
36 
37 }
38