From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PIyQv-0005SO-I0 for ltp-list@lists.sourceforge.net; Thu, 18 Nov 2010 06:57:25 +0000 Received: from out20.sjc.mx.trendmicro.com ([216.99.131.77]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1PIyQt-0000mN-RH for ltp-list@lists.sourceforge.net; Thu, 18 Nov 2010 06:57:25 +0000 From: "Mitani" References: <000001cb798d$1aaa0210$4ffe0630$@co.jp> <4CCE73A6.9020901@cn.fujitsu.com> <4CE4AD0D.1050501@cn.fujitsu.com> <4CE4B2B6.4030408@cn.fujitsu.com> In-Reply-To: <4CE4B2B6.4030408@cn.fujitsu.com> Date: Thu, 18 Nov 2010 15:57:14 +0900 Message-ID: <000001cb86ed$d4984070$7dc8c150$@co.jp> MIME-Version: 1.0 Content-Language: ja Subject: Re: [LTP] [PATCH] fix "sigaction" tests List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: 'Bian Naimeng' , Garrett Cooper Cc: ltp-list@lists.sourceforge.net > -----Original Message----- > From: Bian Naimeng [mailto:biannm@cn.fujitsu.com] > Sent: Thursday, November 18, 2010 2:00 PM > To: Garrett Cooper > Cc: Gui Jianfeng; ltp-list@lists.sourceforge.net; 當座 健市; Mitani > Subject: Re: [LTP] [PATCH] fix "sigaction" tests > > > > Garrett Cooper wrote: > > 2010/11/17 Bian Naimeng : > >> > >> Garrett Cooper wrote: > >>> On Mon, Nov 1, 2010 at 1:00 AM, Gui Jianfeng > wrote: > >>>> Garrett Cooper wrote: > >>>>> 2010/10/31 Mitani : > >>>> ... > >>>>>> int main() > >>>>>> { > >>>>>> @@ -133,6 +152,12 @@ > >>>>>> > >>>>>> struct sigaction sa; > >>>>>> > >>>>>> + /* Checking for Kernel Version */ > >>>>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 ) > >>>>>> + { > >>>>>> + UNTESTED( "sem_wait() returned EINTR on kernel > versions > >>>>>> lower than 2.6.22" ); > >>>>>> + } > >>>>>> + > >>>>>> /* Initialize output */ > >>>>>> output_init(); > >>>>>> > >>>>>> ============ > >>>>>> > >>>>>> Above patch is revision only for templates. > >>>>>> The following procedure is necessary after applying patch: > >>>>>> ------------ > >>>>>> #cd > testcases/open_posix_testsuite/conformance/interfaces/sigaction/ > >>>>>> #./gentests.pl > >>>>>> ------------ > >>>>>> > >>>>>> Similar revisions are necessary for other 25 "sigaction" tests. > >>>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite. > >>>>> Same with BSDisms (at least they shouldn't... if they do, then slap > me > >>>>> or whoever did the commit). > >>>> Do you mean the culprit is Linux-isms? > >>> Mitani-san is proposing that I `fix' the testcases to work on RHEL > >>> 4.8. These testcases should function with minimal change for all > >>> versions of Unix. > >>> > >> This open_posix_suite is the part of LTP(linux test project), must > we > >> make sure it can work at all versions of unix? > > > > I use it in FreeBSD and others have used it in other versions of Unix > > (in the past), based on the README. There's no reason why we need to > > maintain something that philosophically diverges from the upstream > > project's goal because it will make merging more painful and > > unnecessary. > > > > OK, i get it. Thanks. ^_^ > > Then, whether should we remove the following case, because it invokes > the uname that it's not exsit at 4.3 BSD. > conformance/interfaces/pthread_mutex_init/speculative/5-2.c > > Thanks > Bian > > >> What about this patch? If you think so, other similar patchs will > be post. > >> > >> > -------------------------------------------------------------------- > ----------- > >> > >> At older linux kernel(2.6.22 before), a signal handler always > interrupts a > >> blocked call to one of these functions, regardless of the use of the > sigaction > >> SA_RESTART flag, so we should not test these cases at this situation. > >> > >> Althought uname is not exsit at 4.3 BSD, but this open_posix_suite > just > >> the part of LTP(linux test project), so i think it's not a problem. > >> > >> Signed-off-by: Bian Naimeng > >> > >> --- > >> .../conformance/interfaces/sigaction/16-1.c | 27 > ++++++++++++++++++++ > >> 1 files changed, 27 insertions(+), 0 deletions(-) > >> > >> diff --git > a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16 > -1.c > b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16 > -1.c > >> index 706dbfc..3d6e1a1 100644 > >> --- > a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16 > -1.c > >> +++ > b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16 > -1.c > >> @@ -50,6 +50,7 @@ Anyway, a false negative status cannot be returned. > >> #include > >> #include > >> #include > >> +#include > >> > >> #include > >> #include > >> @@ -95,6 +96,27 @@ Anyway, a false negative status cannot be returned. > >> volatile sig_atomic_t caught = 0; > >> sem_t sem; > >> > >> +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + > (c)) > >> + > >> +int check_linux() > >> +{ > >> + struct utsname tn; > >> + int r1, r2, r3; > >> + > >> + if (0 > uname(&tn)) { > >> + UNRESOLVED( errno, "uname failed" ); > >> + } > >> + > >> + if (strcmp(tn.sysname, "Linux") != 0) > >> + return 0; > >> + > >> + sscanf(tn.release, "%d.%d.%d", &r1, &r2, &r3); > >> + if (KERNEL_VERSION(r1, r2, r3) >= KERNEL_VERSION(2, 6, 22)) > >> + return 1; > >> + > >> + return 0; > >> +} > >> + > >> /* Handler function */ > >> void handler( int signo ) > >> { > >> @@ -133,6 +155,11 @@ int main() > >> > >> struct sigaction sa; > >> > >> + if (!check_linux()) > >> + UNTESTED( "A signal handler always interrupts sem_wait > " > >> + "at linux release, regardless of the use > of " > >> + "the sigaction SA_RESTART flag" ); > >> + > >> /* Initialize output */ > >> output_init(); > > > > > > -- > Regards > Bian Naimeng I applied Bian's patch in my system, and build succeeded. I'm OK with the Bian's patch. Thank you-- -Tomonori Mitani ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list