Changes

Jump to navigation Jump to search
22 bytes added ,  13:09, 10 February 2015
m
Line 23: Line 23:  
It's well known that some kernel objects can be shared between tasks. For example, if a task calls <code>open()</code> to obtain a file descriptor and then <code>fork()</code>-s the file object referenced by the file descriptor becomes shared between the parent and its child. The similar thing happens when a task <code>dup()</code>-s a file -- he gets two file descriptors that reference the same file. Unlike this two subsequent <code>open()</code>-s result in two different file objects.
 
It's well known that some kernel objects can be shared between tasks. For example, if a task calls <code>open()</code> to obtain a file descriptor and then <code>fork()</code>-s the file object referenced by the file descriptor becomes shared between the parent and its child. The similar thing happens when a task <code>dup()</code>-s a file -- he gets two file descriptors that reference the same file. Unlike this two subsequent <code>open()</code>-s result in two different file objects.
   −
In kernel there's no API that can just reveal the tasks-to-objects map. Instead, there's an API called <code>kcmp()</code> that compares two e.g. file descriptors and reports back whether the file referenced by them is the same or not. In CRIU we have a [https://github.com/xemul/criu/blob/master/kcmp-ids.c KCMPIDS] engine that uses this API and turns the equals-notequals answers into a list of IDs of objects.
+
In kernel there's no API that can just reveal the tasks-to-objects map. Instead, there's an API called <code>kcmp()</code> that compares two e.g. file descriptors and reports back whether the file referenced by them is the same or not. In CRIU we have a [https://github.com/xemul/criu/blob/master/kcmp-ids.c KCMPIDS] engine that uses this API, build [[kcmp trees]] and turns the equals-notequals answers into a list of IDs of objects.
    
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Under the hood]]
 
[[Category:Under the hood]]

Navigation menu