| 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/kernel_proxy.h" | 5 #include "nacl_io/kernel_proxy.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 <pthread.h> | 10 #include <pthread.h> |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 return result; | 551 return result; |
| 552 } | 552 } |
| 553 | 553 |
| 554 // TODO(noelallen): Needs implementation. | 554 // TODO(noelallen): Needs implementation. |
| 555 int KernelProxy::fchmod(int fd, int mode) { | 555 int KernelProxy::fchmod(int fd, int mode) { |
| 556 errno = EINVAL; | 556 errno = EINVAL; |
| 557 return -1; | 557 return -1; |
| 558 } | 558 } |
| 559 | 559 |
| 560 int KernelProxy::access(const char* path, int amode) { | 560 int KernelProxy::access(const char* path, int amode) { |
| 561 errno = EINVAL; | 561 Path rel; |
| 562 return -1; | 562 |
| 563 Mount* mnt; |
| 564 Error error = AcquireMountAndPath(path, &mnt, &rel); |
| 565 if (error) { |
| 566 errno = error; |
| 567 return -1; |
| 568 } |
| 569 |
| 570 error = mnt->Access(rel, amode); |
| 571 ReleaseMount(mnt); |
| 572 if (error) { |
| 573 errno = error; |
| 574 return -1; |
| 575 } |
| 576 return 0; |
| 563 } | 577 } |
| 564 | 578 |
| 579 // TODO(noelallen): Needs implementation. |
| 565 int KernelProxy::link(const char* oldpath, const char* newpath) { | 580 int KernelProxy::link(const char* oldpath, const char* newpath) { |
| 566 errno = EINVAL; | 581 errno = EINVAL; |
| 567 return -1; | 582 return -1; |
| 568 } | 583 } |
| 569 | 584 |
| 570 int KernelProxy::symlink(const char* oldpath, const char* newpath) { | 585 int KernelProxy::symlink(const char* oldpath, const char* newpath) { |
| 571 errno = EINVAL; | 586 errno = EINVAL; |
| 572 return -1; | 587 return -1; |
| 573 } | 588 } |
| 574 | 589 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 } | 684 } |
| 670 | 685 |
| 671 int fd = AllocateFD(handle); | 686 int fd = AllocateFD(handle); |
| 672 mnt->AcquireNode(node); | 687 mnt->AcquireNode(node); |
| 673 | 688 |
| 674 ReleaseHandle(handle); | 689 ReleaseHandle(handle); |
| 675 ReleaseMount(mnt); | 690 ReleaseMount(mnt); |
| 676 | 691 |
| 677 return fd; | 692 return fd; |
| 678 } | 693 } |
| OLD | NEW |