Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fueword(9) [freebsd man page]

FETCH(9)						   BSD Kernel Developer's Manual						  FETCH(9)

NAME
fetch, fubyte, fuswintr, fuword, fuword16, fuword32, fuword64, fueword, fueword32, fueword64 -- fetch data from user-space SYNOPSIS
#include <sys/types.h> #include <sys/systm.h> int fubyte(volatile const void *base); long fuword(volatile const void *base); int fuword16(volatile const void *base); int32_t fuword32(volatile const void *base); int64_t fuword64(volatile const void *base); long fueword(volatile const void *base, long *val); int32_t fueword32(volatile const void *base, int32_t *val); int64_t fueword64(volatile const void *base, int64_t *val); #include <sys/resourcevar.h> int fuswintr(void *base); DESCRIPTION
The fetch functions are designed to copy small amounts of data from user-space of the current process. If read is successful, it is per- formed atomically. The data read must be naturally aligned. The fetch routines provide the following functionality: fubyte() Fetches a byte of data from the user-space address base. The byte read is zero-extended into the results variable. fuword() Fetches a word of data (long) from the user-space address base. fuword16() Fetches 16 bits of data from the user-space address base. The half-word read is zero-extended into the results variable. fuword32() Fetches 32 bits of data from the user-space address base. fuword64() Fetches 64 bits of data from the user-space address base. fuswintr() Fetches a short word of data from the user-space address base. This function is safe to call during an interrupt context. fueword() Fetches a word of data (long) from the user-space address base and stores the result in the variable pointed by val. fueword32() Fetches 32 bits of data from the user-space address base and stores the result in the variable pointed by val. fueword64() Fetches 64 bits of data from the user-space address base and stores the result in the variable pointed by val. The callers of fuword(), fuword32() and fuword64() functions cannot distinguish between -1 read from userspace and function failure. RETURN VALUES
The fubyte(), fuword(), fuword16(), fuword32(), fuword64(), and fuswintr() functions return the data fetched or -1 on failure. The fueword(), fueword32() and fueword64() functions return 0 on success and -1 on failure. SEE ALSO
copy(9), store(9) BSD
October 29, 2014 BSD

Check Out this Related Man Page

COPY(9)                                                    BSD Kernel Developer's Manual                                                   COPY(9)

NAME
copy, copyin, copyout, copystr, copyinstr -- kernel copy functions SYNOPSIS
#include <sys/types.h> #include <sys/systm.h> int copyin(const void *uaddr, void *kaddr, size_t len); int copyout(const void *kaddr, void *uaddr, size_t len); int copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done); int copyinstr(const void *uaddr, void *kaddr, size_t len, size_t *done); DESCRIPTION
The copy functions are designed to copy contiguous data from one address to another. All but copystr() copy data from user-space to kernel- space or vice-versa. The copy routines provide the following functionality: copyin() Copies len bytes of data from the user-space address uaddr to the kernel-space address kaddr. copyout() Copies len bytes of data from the kernel-space address kaddr to the user-space address uaddr. copystr() Copies a NUL-terminated string, at most len bytes long, from kernel-space address kfaddr to kernel-space address kdaddr. The number of bytes actually copied, including the terminating NUL, is returned in *done (if done is non-NULL). copyinstr() Copies a NUL-terminated string, at most len bytes long, from user-space address uaddr to kernel-space address kaddr. The num- ber of bytes actually copied, including the terminating NUL, is returned in *done (if done is non-NULL). RETURN VALUES
The copy functions return 0 on success or EFAULT if a bad address is encountered. In addition, the copystr(), and copyinstr() functions return ENAMETOOLONG if the string is longer than len bytes. SEE ALSO
fetch(9), store(9) BSD January 7, 1996 BSD
Man Page