| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/node.h" | 5 #include "nacl_io/node.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <poll.h> | 10 #include <poll.h> |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 Error Node::Tcgetattr(struct termios* termios_p) { return EINVAL; } | 158 Error Node::Tcgetattr(struct termios* termios_p) { return EINVAL; } |
| 159 | 159 |
| 160 Error Node::Tcsetattr(int optional_actions, const struct termios* termios_p) { | 160 Error Node::Tcsetattr(int optional_actions, const struct termios* termios_p) { |
| 161 return EINVAL; | 161 return EINVAL; |
| 162 } | 162 } |
| 163 | 163 |
| 164 int Node::GetLinks() { return stat_.st_nlink; } | 164 int Node::GetLinks() { return stat_.st_nlink; } |
| 165 | 165 |
| 166 int Node::GetMode() { return stat_.st_mode & ~S_IFMT; } | 166 int Node::GetMode() { return stat_.st_mode & ~S_IFMT; } |
| 167 | 167 |
| 168 Error Node::GetSize(size_t* out_size) { | 168 Error Node::GetSize(off_t* out_size) { |
| 169 *out_size = stat_.st_size; | 169 *out_size = stat_.st_size; |
| 170 return 0; | 170 return 0; |
| 171 } | 171 } |
| 172 | 172 |
| 173 int Node::GetType() { return stat_.st_mode & S_IFMT; } | 173 int Node::GetType() { return stat_.st_mode & S_IFMT; } |
| 174 | 174 |
| 175 void Node::SetType(int type) { | 175 void Node::SetType(int type) { |
| 176 assert((type & ~S_IFMT) == 0); | 176 assert((type & ~S_IFMT) == 0); |
| 177 stat_.st_mode &= ~S_IFMT; | 177 stat_.st_mode &= ~S_IFMT; |
| 178 stat_.st_mode |= type; | 178 stat_.st_mode |= type; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 199 return ENOTDIR; | 199 return ENOTDIR; |
| 200 } | 200 } |
| 201 | 201 |
| 202 int Node::ChildCount() { return 0; } | 202 int Node::ChildCount() { return 0; } |
| 203 | 203 |
| 204 void Node::Link() { stat_.st_nlink++; } | 204 void Node::Link() { stat_.st_nlink++; } |
| 205 | 205 |
| 206 void Node::Unlink() { stat_.st_nlink--; } | 206 void Node::Unlink() { stat_.st_nlink--; } |
| 207 | 207 |
| 208 } // namespace nacl_io | 208 } // namespace nacl_io |
| OLD | NEW |