Unix/Linux Go Back    

NetBSD 6.1.5 - man page for ucas (netbsd section 9)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

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

     ucas -- atomic memory operations on user-space address

     #include <sys/systm.h>

     ucas_ptr(volatile void *uptr, void *old, void *new, void *retp);

     ucas_int(volatile int *uptr, int old, int new, int *retp);

     These functions provide compare-and-swap (CAS) functionality on user-space address.

     Except that they can be safely used for the kernel to access user-space address, they are
     semantically equivalents of atomic_cas(3).

     uptr  The pointer to the variable.  This should be a user-space pointer.

     old   The value to compare with the variable.

     new   The value to store to the variable.

     retp  The pointer to the memory to store the old value of the variable.

     On success, these functions return 0.  In that case, the caller can consult the value
     returned via retp to check the result of the CAS operation.  Otherwise, these functions
     return an appropriate errno(9) error code, typically EFAULT.

     atomic_cas(3), intro(9)

     Conceptually, the retp argument of ucas_ptr() would be of void **.  The current prototype is
     a compromise for usability.

BSD					 October 24, 2011				      BSD
Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 09:36 AM.