atomic_op.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 60 行

2
60
字号
.TH atomic_op 2.SH Nameatomic_op \- perform test and set operation..SH Syntax.nf.ft B #include <sys/lock.h>.PP.ft B int atomic_op(\fIop, addr\fR)int \fIop\fR;int \fI*addr\fR;.fi.SH Arguments.IP \fIop\fR 15This argument is the operation type.  If the operation type is ATOMIC_SET,this call specifies the test and set operation on location \fIaddr\fR.If the operation type is ATOMIC_CLEAR, this call specifies the clearoperation on location \fIaddr\fR..IP \fIaddr\fR 15This is the target address of the operation..SH Description.NXR "interlocked access".NXR "interlocked access" "test and set" "test and clear".NXR "test and set" "test and clear"The .PN atomic_op call provides test and set operation at a user address..PPFor RISC systems, .PN atomic_opis executed as a system call.For VAX systems, a system call is not executed forthis library function..SH Return ValuesIf the atomic_op operation succeeds,then 0 is returned.  Otherwise a \-1 is returned,and a more specific error code is stored in \fIerrno\fP..SH Diagnostics.TP 15[EBUSY]The location specified by .I addris already set..TP[EINVAL]The .I opis not a valid operation type..TP[EACCES]The address specified in .I addris not write accessible..TP[EALIGN]The.I addris not on an integer boundary.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?