1.\" $NetBSD: ustore.9,v 1.2 2019/04/06 07:56:19 wiz Exp $ 2.\" 3.\" Copyright (c) 2019 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Jason R. Thorpe. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd March 18, 2019 31.Dt USTORE 9 32.Os 33.Sh NAME 34.Nm ustore , 35.Nm ustore_8 , 36.Nm ustore_16 , 37.Nm ustore_32 , 38.Nm ustore_64 , 39.Nm ustore_char , 40.Nm ustore_short , 41.Nm ustore_int , 42.Nm ustore_long , 43.Nm ustore_ptr 44.Nd store data in user-space 45.Sh SYNOPSIS 46.In sys/systm.h 47.Ft int 48.Fn ustore_8 "const uint8_t *uaddr" "uint8_t val" 49.Ft int 50.Fn ustore_16 "const uint16_t *uaddr" "uint16_t val" 51.Ft int 52.Fn ustore_32 "const uint32_t *uaddr" "uint32_t val" 53.Ft int 54.Fn ustore_64 "const uint64_t *uaddr" "uint64_t val" 55.Ft int 56.Fn ustore_char "const unsigned char *uaddr" "unsigned char val" 57.Ft int 58.Fn ustore_short "const unsigned short *uaddr" "unsigned short val" 59.Ft int 60.Fn ustore_int "const unsigned int *uaddr" "unsigned int val" 61.Ft int 62.Fn ustore_long "const unsigned long *uaddr" "unsigned long val" 63.Ft int 64.Fn ustore_ptr "const void **uaddr" "void *val" 65.Sh DESCRIPTION 66The 67.Nm 68functions provide a way to store a value to single memory cells in 69user-space. 70In each case, the value 71.Ar val 72is stored in the user-space memory location referenced by 73.Ar uaddr . 74.Pp 75The 76.Nm ustore_64 77function is only available on systems employing the 78.Sq LP64 79memory model, which can be determined by testing for the presence of the 80.Dv _LP64 81C preprocessor macro. 82.Sh RETURN VALUES 83The 84.Nm 85functions return 0 on success and an error number on failure. 86.Sh SEE ALSO 87.Xr copy 9 , 88.Xr ufetch 9 89