public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [POSIX]aio_suspend-4: we just need care the selected request.
@ 2010-10-27  7:55 Bian Naimeng
  0 siblings, 0 replies; only message in thread
From: Bian Naimeng @ 2010-10-27  7:55 UTC (permalink / raw)
  To: yanegomi; +Cc: ltp-list

At linux, the aio_suspend tests report following error:
  aio_suspend/4-1.c aio_suspend() should set errno to EAGAIN: 4 (Interrupted system call)

Man page said:
  The  aio_suspend()  function  suspends  the calling process until at least one of the asynchronous
  I/O requests in the list cblist of length n have completed, a signal is delivered, or timeout is
  not NULL and the time interval it indicates has passed.

When  a signal is delivered, whether should aio_suspend return immediately although 
we have set a SA_RESTART flag for this signal action?

Maybe the followed path is necessary.
------------------------------------------------------------------------------------------------------
We just care the selected IO request, and set a little timeout.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 conformance/interfaces/aio_suspend/4-1.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/conformance/interfaces/aio_suspend/4-1.c b/conformance/interfaces/aio_suspend/4-1.c
index 260c26a..dd8e5f0 100644
--- a/conformance/interfaces/aio_suspend/4-1.c
+++ b/conformance/interfaces/aio_suspend/4-1.c
@@ -47,8 +47,7 @@ int received_all	= 0;
 void
 sigrt1_handler(int signum, siginfo_t *info, void *context)
 {
-	if (info->si_value.sival_int == WAIT_FOR_AIOCB)
-		received_selected = 1;
+	received_selected = 1;
 }
 
 void
@@ -68,7 +67,7 @@ main ()
 	char *bufs;
 	struct sigaction action;
 	struct sigevent event;
-	struct timespec ts = {0, 10000000}; /* 10 ms */
+	struct timespec ts = {0, 1000}; /* 1 us */
 	int errors = 0;
 	int ret;
 	int err;
@@ -123,9 +122,11 @@ main ()
 		aiocbs[i]->aio_lio_opcode = LIO_READ;
 
 		/* Use SIRTMIN+1 for individual completions */
-		aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
-		aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
-		aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
+		if (i == WAIT_FOR_AIOCB) {
+			aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
+			aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
+			aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
+		}
 	}
 
 	/* Use SIGRTMIN+2 for list completion */
-- 
1.7.0.4



-- 
Regards
Bian Naimeng


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
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:[~2010-10-27  7:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27  7:55 [LTP] [POSIX]aio_suspend-4: we just need care the selected request Bian Naimeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox