12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FETCH (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> FETCH (9)<strong>NAME</strong>fetch, fubyte, fuibyte, fusword, fuswintr, fuword, fuiword —fetch data from user-spaceSYNOPSIS#include #include intfubyte(const void ∗base);intfusword(const void ∗base);intfuswintr(const void ∗base);longfuword(const void ∗base);DESCRIPTIONThe fetch functions are designed to copy small amounts of data from user-space.The fetch routines provide the following functionality:fubyte()fusword()fuswintr()fuword()Fetches a byte of data from the user-space address base.Fetches a short word of data from the user-space address base.Fetches a short word of data from the user-space address base. This function is safe to callduring an interrupt context.Fetches a word of data from the user-space address base.RETURN VALUESThe fetch functions return the data fetched or -1 on failure. Note that these functions all do "unsigned"access, and therefore will never sign extend byte or short values. This prevents ambiguity with the errorreturn value for all functions except fuword().SEE ALSOcopy(9), store(9)BUGSThe function fuword() has no way to unambiguously signal an error, because the data it reads might legitimatelybe the same as the -1 used to indicate an error. The other functions do not have this problem becausethe unsigned values returned by those can never match the -1 error return value.<strong>NetBSD</strong> 3.0 January 7, 1996 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!