atomic_op(2)atomic_op(2)Nameatomic_op - perform test and set operation.
int atomic_op(op, addr)
op This argument is the operation type. If the operation
type is ATOMIC_SET, this call specifies the test and set
operation on location addr. If the operation type is
ATOMIC_CLEAR, this call specifies the clear operation on
addr This is the target address of the operation.
The call provides test and set operation at a user address.
For RISC systems, is executed as a system call. For VAX systems, a
system call is not executed for this library function.
If the atomic_op operation succeeds, then 0 is returned. Otherwise a
-1 is returned, and a more specific error code is stored in errno.
[EBUSY] The location specified by addr is already set.
[EINVAL] The op is not a valid operation type.
[EACCES] The address specified in addr is not write accessible.
[EALIGN] The addr is not on an integer boundary.