Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

In the xenstore and console rings, if we hit the highest byte, repeat…

… the read/write call. This matches the behaviour of the old C code (although it shouldn't be required)
  • Loading branch information...
commit 9af7d2e3a040288c05f7df12dead33dd3ce91887 1 parent f8c62c2
@djs55 authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/ring.ml
View
9 lib/ring.ml
@@ -327,6 +327,15 @@ module Pipe(RW: RW) = struct
memory_barrier (); (* XXX: not a write_memory_barrier? *)
RW.set_ring_input_cons t (Int32.of_int (cons + can_read));
can_read
+
+ let rec repeat f from buf ofs len =
+ let n = f from buf ofs len in
+ if n < len && n > 0
+ then n + (repeat f from buf (ofs + n) (len - n))
+ else n
+
+ let unsafe_read = repeat unsafe_read
+ let unsafe_write = repeat unsafe_write
end
module type Bidirectional_byte_stream = sig
Please sign in to comment.
Something went wrong with that request. Please try again.