Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

atomic_op(2)

Name

atomic_op − perform test and set operation. 

Syntax

#include <sys/lock.h>

int atomic_op(op, addr)
int op;
int *addr;

Arguments

opThis 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 location addr. 

addrThis is the target address of the operation. 

Description

The atomic_op call provides test and set operation at a user address.

For RISC systems, atomic_op is executed as a system call. For VAX systems, a system call is not executed for this library function.

Return Values

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. 

Diagnostics

[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. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026