* [LTP] [RFC] uClinux vs. Crackerjack tests
@ 2009-10-06 9:50 Jiří Paleček
0 siblings, 0 replies; only message in thread
From: Jiří Paleček @ 2009-10-06 9:50 UTC (permalink / raw)
To: ltp-list@lists.sourceforge.net
Hello,
the recently introduced tests from Crackerjack use some subroutines that
use fork(). However, according to the documentation, fork is not available
on uClinux, and LTP seems to support this. Although I haven't noticed any
complaints to the functionality of the tests on uClinux, I wonder whether
they actually work.
I wonder whether simple functions executed in the child process couldn't
be replaced by some shell code, like this, to make them work on uClinux:
diff --git a/testcases/kernel/syscalls/utils/common_j_h.c
b/testcases/kernel/syscalls/utils/common_j_h.c
index c460d85..8e7dbf8 100644
--- a/testcases/kernel/syscalls/utils/common_j_h.c
+++ b/testcases/kernel/syscalls/utils/common_j_h.c
@@ -117,15 +117,25 @@ static void sigterm_handler(int sig)
*/
pid_t create_sig_proc(unsigned long usec, int sig, unsigned count)
{
- pid_t pid, cpid;
+ pid_t pid = getpid(), cpid;
+#ifdef UCLINUX
+ char buffer[256];
+
+ snprintf(buffer, 256, "COUNT=%d TIME=%ld SIG=%d; while [
$(COUNT-=1) -gt 0 ]; do sleep $TIME; kill -$SIG $PPID; done",
+ count, (usec+999999)/1000000,
sig);
+ if((cpid = vfork()) == 0) {
+ execlp("sh", "-c", buffer, (void*)0);
+ _exit(1);
+ }
- pid = getpid();
+#else
WITH_SIGNALS_BLOCKED(
if((cpid = fork()) == 0) {
tst_sig(NOFORK, SIG_DFL, NULL);
signal(SIGTERM, sigterm_handler);
}
);
+#endif
switch (cpid) {
case 0:
while(count-- > 0) {
It isn't an exact replacement (the sleep interval granularity is 1 second
in the shell version), but this parameter isn't crucial for the function
of the tests that use it. It would save us an extra binary or altering all
the tests that use this function.
Regards
Jiri Palecek
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-10-06 9:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06 9:50 [LTP] [RFC] uClinux vs. Crackerjack tests Jiří Paleček
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox