LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mandatory Locking (https://www.linuxquestions.org/questions/linux-software-2/mandatory-locking-468441/)

Kernel programmer 07-28-2006 12:33 AM

Mandatory Locking
 
A file is marked as a candidate for mandatory by setting the group-id bit in its file mode but removing the group-execute bit.Can Some body explain this in a more clearer way

raskin 07-28-2006 01:42 AM

Well, chmod g-x file; chmod g+s file. Ok, mandatory locking can be applied.

Kernel programmer 07-28-2006 04:00 AM

Thanks raskin for u r quick reply.
I will tell my question even more clearly.
When I Open a file, it would be associated with a "file" structure in open file table.
Now When I apply a lock on this file, Is there any field inside "file" structure which will be a modified to tell that this file is locked or Is there any other way.

raskin 07-28-2006 05:21 AM

According to your nick, you must have fresh kernel unpacked. Go to Documentation. read mandatory.txt . If you mean FILE*, well, FILE* is option. If you mean internal kernel structure - yes, but stable-api-nonsense.txt, so don't rely on it unless you are writing in-kernel code related to it in which case you look up in the source. Generally you have fcntl (read man) to get/set state of locking.


All times are GMT -5. The time now is 04:07 PM.