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 <limits.h> | 10 #include <limits.h> |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 int KernelProxy::fdatasync(int fd) { | 569 int KernelProxy::fdatasync(int fd) { |
570 errno = ENOSYS; | 570 errno = ENOSYS; |
571 return -1; | 571 return -1; |
572 } | 572 } |
573 | 573 |
574 int KernelProxy::isatty(int fd) { | 574 int KernelProxy::isatty(int fd) { |
575 ScopedKernelHandle handle; | 575 ScopedKernelHandle handle; |
576 Error error = AcquireHandle(fd, &handle); | 576 Error error = AcquireHandle(fd, &handle); |
577 if (error) { | 577 if (error) { |
578 errno = error; | 578 errno = error; |
579 return -1; | 579 return 0; |
580 } | 580 } |
581 | 581 |
582 error = handle->node()->IsaTTY(); | 582 error = handle->node()->Isatty(); |
583 if (error) { | 583 if (error) { |
584 errno = error; | 584 errno = error; |
585 return -1; | 585 return 0; |
586 } | 586 } |
587 | 587 |
588 return 0; | 588 return 1; |
589 } | 589 } |
590 | 590 |
591 int KernelProxy::ioctl(int fd, int request, va_list args) { | 591 int KernelProxy::ioctl(int fd, int request, va_list args) { |
592 ScopedKernelHandle handle; | 592 ScopedKernelHandle handle; |
593 Error error = AcquireHandle(fd, &handle); | 593 Error error = AcquireHandle(fd, &handle); |
594 if (error) { | 594 if (error) { |
595 errno = error; | 595 errno = error; |
596 return -1; | 596 return -1; |
597 } | 597 } |
598 | 598 |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 errno = ENOTSOCK; | 1629 errno = ENOTSOCK; |
1630 return -1; | 1630 return -1; |
1631 } | 1631 } |
1632 | 1632 |
1633 return 0; | 1633 return 0; |
1634 } | 1634 } |
1635 | 1635 |
1636 #endif // PROVIDES_SOCKET_API | 1636 #endif // PROVIDES_SOCKET_API |
1637 | 1637 |
1638 } // namespace_nacl_io | 1638 } // namespace_nacl_io |
OLD | NEW |