[snip]
> lock.l_type = F_WRLCK ; <================
> lock.l_whence = SEEK_SET ;
> lock.l_start = 0 ;
> lock.l_len = 0 ;
> lock.l_pid = 0 ; // ignored
>
> int err = fcntl (fd, F_SETLK, &lock) ;
I know nothing about file locking in Unix, but it looks like you
requested write lock, i.e. forbid writing to a file. Why are you
surprised that reads are allowed?
Probably someone else would comment on why rm is working, though...
-- vda - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/