OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/mount_node.h" | 5 #include "nacl_io/mount_node.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <poll.h> | 9 #include <poll.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 *out_size = stat_.st_size; | 146 *out_size = stat_.st_size; |
147 return 0; | 147 return 0; |
148 } | 148 } |
149 | 149 |
150 int MountNode::GetType() { return stat_.st_mode & S_IFMT; } | 150 int MountNode::GetType() { return stat_.st_mode & S_IFMT; } |
151 | 151 |
152 bool MountNode::IsaDir() { return (stat_.st_mode & S_IFDIR) != 0; } | 152 bool MountNode::IsaDir() { return (stat_.st_mode & S_IFDIR) != 0; } |
153 | 153 |
154 bool MountNode::IsaFile() { return (stat_.st_mode & S_IFREG) != 0; } | 154 bool MountNode::IsaFile() { return (stat_.st_mode & S_IFREG) != 0; } |
155 | 155 |
| 156 bool MountNode::IsaSock() { return (stat_.st_mode & S_IFSOCK) != 0; } |
| 157 |
156 bool MountNode::IsaTTY() { return (stat_.st_mode & S_IFCHR) != 0; } | 158 bool MountNode::IsaTTY() { return (stat_.st_mode & S_IFCHR) != 0; } |
157 | 159 |
158 Error MountNode::AddChild(const std::string& name, | 160 Error MountNode::AddChild(const std::string& name, |
159 const ScopedMountNode& node) { | 161 const ScopedMountNode& node) { |
160 return ENOTDIR; | 162 return ENOTDIR; |
161 } | 163 } |
162 | 164 |
163 Error MountNode::RemoveChild(const std::string& name) { return ENOTDIR; } | 165 Error MountNode::RemoveChild(const std::string& name) { return ENOTDIR; } |
164 | 166 |
165 Error MountNode::FindChild(const std::string& name, ScopedMountNode* out_node) { | 167 Error MountNode::FindChild(const std::string& name, ScopedMountNode* out_node) { |
166 out_node->reset(NULL); | 168 out_node->reset(NULL); |
167 return ENOTDIR; | 169 return ENOTDIR; |
168 } | 170 } |
169 | 171 |
170 int MountNode::ChildCount() { return 0; } | 172 int MountNode::ChildCount() { return 0; } |
171 | 173 |
172 void MountNode::Link() { stat_.st_nlink++; } | 174 void MountNode::Link() { stat_.st_nlink++; } |
173 | 175 |
174 void MountNode::Unlink() { stat_.st_nlink--; } | 176 void MountNode::Unlink() { stat_.st_nlink--; } |
175 | 177 |
176 } // namespace nacl_io | 178 } // namespace nacl_io |
177 | 179 |
OLD | NEW |