Make-sync_pipe-API-more-generic-and-update-related.patch.
Roy Lee <roylee17@gmail.com> noted:
Referring to the sync_pipes API, create_sync_pipes(), wait_son_startup(), notify_startup(), which is defined in the: testcases/kernel/syscalls/lib/libtestsuite.[ch], I found the new sync_pipes API very convenient to synchronize processes. However the naming might pose some semantic restrictions on their usages. Since it can be used for making parent to wait child, and vice versa, perhaps a better naming should be used. For example: sync_pipes_create (), sync_pipes_wait (), sync_pipes_notify(), other names will be good as long as they don't assume the caller is child or parent. Furthermore, since it is also suitable for being used in common test cases, moving  it outside the syscalls's directory to a more common place might be a good idea.
Renaud Lottiaux <Renaud.Lottiaux@kerlabs.com> noted:
I fully agree with your remarks. But if you want to make these functions more generic, it should be possible to call sync_pipe_wait / notify several times, which is not possible in the current code since I close file descriptors in these functions. A quite simple solution is to keep these file descriptors opened, and to add a function to close them or simply let these file descriptors being closed by libC or kernel at process end.
Signed-off-by: Roy Lee <roylee17@gmail.com>.
11 files changed