开发者

Fcntl() question about process id

开发者 https://www.devze.com 2023-03-15 07:09 出处:网络
I am debugging some code and there is l_pid = 0 always for setting file locks.. It seems odd to me.. Is this correct?Documentation d开发者_如何学运维oesnt say about 0 zero value ..l_pid is only meanin

I am debugging some code and there is l_pid = 0 always for setting file locks.. It seems odd to me.. Is this correct?Documentation d开发者_如何学运维oesnt say about 0 zero value ..


l_pid is only meaningful when getting the lock status with F_GETLK; when setting a lock, if it succeeds then you know what pid owns it. :) (And the buffer is returned unmodified it it fails.)

0

精彩评论

暂无评论...
验证码 换一张
取 消