On Thursday 12 September 2013 05:47:35 [email protected] wrote: > > LTP employs FORK_OR_VFORK macro which is defined as: > > > > #ifdef UCLINUX > > #define FORK_OR_VFORK vfork > > #define MAP_PRIVATE_EXCEPT_UCLINUX 0 > > #else > > #define FORK_OR_VFORK fork > > #define MAP_PRIVATE_EXCEPT_UCLINUX MAP_PRIVATE > > #endif > > > > So, on UCLINUX it is a vfork call. > > > > But many testcases use this macro and try to use functions other than > > exec() and _exit() inside a child. > > Example - syscalls/setfsuid/setfsuid04.c. > > And I suppose that because of that fact these testcases may fail on > > UCLINUX (or behave unexpectedly). > > > > Is this situation left intentionally? Does somebody care about this > > issue? Or we simply ignore it. > > > > I'm just curious. :) > > Most of the testcases does vfork() then exec itself with some parameter > in argv[] to create the child, which is correct and as close to fork() > as uClinux can get. See self_exec() in lib/self_exec.c. > > There seems to be a few testcases that does just call FORK_OR_VFORK and > use it in a way that violates the specs, these may work or may not, that > depends on actual implementation of vfork in uClinux. > > I'm trying not to break any of uClinux code in LTP but as I have no > uClinux hardware nor much interest in fixing it I'm not trying to fix it > actively.
you do not need a no-mmu kernel to test this code. any system can run LTP test cases built with UCLINUX=1. the idea with FORK_OR_VFORK is to keep people from just using fork() all the time. there are some test cases where the logic "just works" and we get it for free on no-mmu builds. but there are other cases where we have to do the self_exec() business. all in all, overuse of this macro makes our lives easier. also, note that since these are Linux tests, the stringent requirements laid out in `man vfork` aren't the entire picture. if you know how the internals work, there are a lot of things you can do in a vfork child beyond exec/exit. like manipulating file descriptors. -mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. Consolidate legacy IT systems to a single system of record for IT 2. Standardize and globalize service processes across IT 3. Implement zero-touch automation to replace manual, redundant tasks http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
