about summary refs log tree commit diff
path: root/src/rt/sync/timer.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-22 18:36:28 -0700
committerbors <bors@rust-lang.org>2013-08-22 18:36:28 -0700
commit95c542e7fed0b6a76376f7c1146ac34499bbf238 (patch)
treefb1ffddf92c55e42a6ce164022d008c1cc52aa8f /src/rt/sync/timer.cpp
parent23bfa600a0f91f1ea62ea3f3783c358a7cb7da45 (diff)
parentb7cbd8a8fd69d7a2b540e3b4f9e808810fc1ddc0 (diff)
downloadrust-95c542e7fed0b6a76376f7c1146ac34499bbf238.tar.gz
rust-95c542e7fed0b6a76376f7c1146ac34499bbf238.zip
auto merge of #8655 : olsonjeffery/rust/newrt_file_io, r=pcwalton,brson
This PR includes the addition of the essential CRUD functionality exposed as a part of the `uv_fs_*` api. There's a lot more to be done, but the essential abstractions are in place and can be easily expanded.

A summary:

* `rt::io::file::FileStream` is fleshed out and behaves as a *non-positional* file stream (that is, it has a cursor that can be viewed/changed via `tell` and `seek`
* The underlying abstraction in `RtioFileStream` exposes pairs of `read(), write()` and `pread(), pwrite()`. The latter two take explicit `offset` params and don't respect the current cursor location in a file afaik. They both use the same underlying libuv impl
* Because libuv explicitly does *not* support `seek`/`tell` operations, these are impl'd in `UvFileStream` by using `lseek(2)` on the raw file descriptor.
* I did my best to flesh out and adhere to the stubbing that was already present in `rt::io::file` and the tests should back that up. There may be things missing.
* All of the work to test `seek`/`tell` is done in `rt::io::file`, even though the actual impl is down in `rt::uv::uvio`.
* We have the ability to spin up an `~RtioFileStream` from a raw file descriptor. This would be useful for interacting with stdin and stdout via newrt.
* The lowest level abstractions (in `rt::uv::file`) support fully synchronous/blocking interactions with the uv API and there is a CRUD test using it. This may also be useful for blocking printf, if desired (the default would be non-blocking and uses libuv's io threadpool)

There are a few polish things I need to do still (the foremost that I know of is undefined behavior when seek'ing beyond the file's boundary).

After this lands, I want to move on to mapping more of the `uv_fs_*` API (especially `uv_fs_stat`). Also a few people have mentioned interest in `uv_pipe_t` support. I'm open to suggestions.
Diffstat (limited to 'src/rt/sync/timer.cpp')
0 files changed, 0 insertions, 0 deletions