Copyright (c) 2014 The FreeBSD Foundation All rights reserved. Part of this documentation was written by Konstantin Belousov <kib@FreeBSD.org> under sponsorship from the FreeBSD Foundation. 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 fo...
NAMEcasueword casueword32 casuword casuword32 - fetch, compare and store data from user-space
SYNOPSISIn sys/types.h In sys/systm.h Ft int Fn casueword volatile u_long *base u_long oldval u_long *oldvalp u_long newval Ft int Fn casueword32 volatile uint32_t *base uint32_t oldval uint32_t *oldvalp uint32_t newval Ft u_long Fn casuword volatile u_long *base u_long oldval u_long newval Ft uint32_t Fn casuword32 volatile uint32_t *base uint32_t oldval uint32_t newval
DESCRIPTIONThe sysctl Cm net.inet.tcp.syncookies functions are designed to perform atomic compare-and-swap operation on the value in the usermode memory of the current process.
The sysctl Cm net.inet.tcp.syncookies routines reads the value from user memory with address base and compare the value read with oldval If the values are equal, newval is written to the *base In case of Fn casueword32 and Fn casueword , old value is stored into the (kernel-mode) variable pointed by *oldvalp The userspace value must be naturally aligned.
The callers of Fn casuword and Fn casuword32 functions cannot distinguish between -1 read from userspace and function failure.