| 45 | } |
| 46 | |
| 47 | bool aio_fstream::open(const char* path, unsigned int oflags, unsigned int mode) |
| 48 | { |
| 49 | ACL_VSTREAM* fp = acl_vstream_fopen(path, oflags, mode, 8192); |
| 50 | if (fp == NULL) { |
| 51 | return false; |
| 52 | } |
| 53 | stream_ = acl_aio_open(handle_->get_handle(), fp); |
| 54 | |
| 55 | // ���û���� enable_error ���� handle �������첽������, |
| 56 | // ͬʱע��رռ���ʱ�ص����� |
| 57 | this->enable_error(); |
| 58 | |
| 59 | // ֻ�е������ӳɹ���ſ� hook IO ��д״̬ |
| 60 | // hook ���ص����� |
| 61 | if ((oflags & (O_RDONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC))) { |
| 62 | this->enable_read(); |
| 63 | } |
| 64 | |
| 65 | // hook д�ص����� |
| 66 | if ((oflags & (O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC))) { |
| 67 | this->enable_write(); |
| 68 | } |
| 69 | |
| 70 | return true; |
| 71 | } |
| 72 | |
| 73 | bool aio_fstream::open_trunc(const char* path, unsigned int mode /* = 0600 */) |
| 74 | { |
nothing calls this directly
no test coverage detected