3 readnum, readstr \- device read routines
7 int readstr(ulong off, char *buf, ulong n, char *str)
10 int readnum(ulong off, char *buf, ulong n, ulong val, int size)
15 simplify the return of strings and numbers from device
18 because they deal with any buffering and boundary cases.
19 Several parameters to the read call are often handed on directly
23 the address of the user's buffer, as
25 and the number of bytes requested, as
27 Both functions return the number of bytes they have stored in
29 and which can often be returned directly from the device read routine.
32 satisfies a read by copying data into
34 from the NUL-terminated string in
36 The data transferred is selected and limited by
43 converts the unsigned integer
45 to a decimal representation in
47 The value is right-justified in a field of
49 places and is followed by a blank.
51 can be the global constant
58 .B /sys/src/9/port/devcons.c