.\" $NetBSD: ustore.9,v 1.2 2019/04/06 07:56:19 wiz Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Jason R. Thorpe. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd March 18, 2019 .Dt USTORE 9 .Os .Sh NAME .Nm ustore , .Nm ustore_8 , .Nm ustore_16 , .Nm ustore_32 , .Nm ustore_64 , .Nm ustore_char , .Nm ustore_short , .Nm ustore_int , .Nm ustore_long , .Nm ustore_ptr .Nd store data in user-space .Sh SYNOPSIS .In sys/systm.h .Ft int .Fn ustore_8 "const uint8_t *uaddr" "uint8_t val" .Ft int .Fn ustore_16 "const uint16_t *uaddr" "uint16_t val" .Ft int .Fn ustore_32 "const uint32_t *uaddr" "uint32_t val" .Ft int .Fn ustore_64 "const uint64_t *uaddr" "uint64_t val" .Ft int .Fn ustore_char "const unsigned char *uaddr" "unsigned char val" .Ft int .Fn ustore_short "const unsigned short *uaddr" "unsigned short val" .Ft int .Fn ustore_int "const unsigned int *uaddr" "unsigned int val" .Ft int .Fn ustore_long "const unsigned long *uaddr" "unsigned long val" .Ft int .Fn ustore_ptr "const void **uaddr" "void *val" .Sh DESCRIPTION The .Nm functions provide a way to store a value to single memory cells in user-space. In each case, the value .Ar val is stored in the user-space memory location referenced by .Ar uaddr . .Pp The .Nm ustore_64 function is only available on systems employing the .Sq LP64 memory model, which can be determined by testing for the presence of the .Dv _LP64 C preprocessor macro. .Sh RETURN VALUES The .Nm functions return 0 on success and an error number on failure. .Sh SEE ALSO .Xr copy 9 , .Xr ufetch 9 |