Fcntl() question about process id
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.)
精彩评论