_locking 常量_locking Constants

语法Syntax


#include <sys/locking.h>  

备注Remarks

_locking 函数调用中的 mode 参数指定要执行的锁定操作。The mode argument in the call to the _locking function specifies the locking action to be performed.

mode 参数必须是以下清单常量之一。The mode argument must be one of the following manifest constants.

_LK_LOCK
锁定指定字节。Locks the specified bytes. 如果无法锁定字节,该函数会在 1 秒后再次尝试。If the bytes cannot be locked, the function tries again after 1 second. 如果在 10 次尝试后仍无法锁定字节,该函数将返回一个错误。If, after 10 attempts, the bytes cannot be locked, the function returns an error.

_LK_RLCK
_LK_LOCK 相同。Same as _LK_LOCK.

_LK_NBLCK
锁定指定字节。Locks the specified bytes. 如果无法锁定字节,该函数将返回一个错误。If bytes cannot be locked, the function returns an error.

_LK_NBRLCK
_LK_NBLCK 相同。Same as _LK_NBLCK.

_LK_UNLCK
解锁指定字节。Unlocks the specified bytes. (这些字节必须在之前锁定。)(The bytes must have been previously locked.)

另请参阅See Also

_locking _locking
全局常量Global Constants