+/* Typedef specifying a count of bytes in a data block to be written
+ out or read in, using Lstream_read(), Lstream_write(), and related
+ functions. This MUST BE SIGNED, since it also is used in functions
+ that return the number of bytes actually read to or written from in
+ an operation, and these functions can return -1 to signal error.
+
+ Note that the standard Unix read() and write() functions define the
+ count going in as a size_t, which is UNSIGNED, and the count going
+ out as an ssize_t, which is SIGNED. This is a horrible design
+ flaw. Not only is it highly likely to lead to logic errors when a
+ -1 gets interpreted as a large positive number, but operations are
+ bound to fail in all sorts of horrible ways when a number in the
+ upper-half of the size_t range is passed in -- this number is
+ unrepresentable as an ssize_t, so code that checks to see how many
+ bytes are actually written (which is mandatory if you are dealing
+ with certain types of devices) will get completely screwed up.
+*/
+
+typedef EMACS_INT Lstream_data_count;
+