From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from x35.xmailserver.org ([69.30.125.51]:39654 "EHLO x35.xmailserver.org") by vger.kernel.org with ESMTP id S1161385AbWATANz (ORCPT ); Thu, 19 Jan 2006 19:13:55 -0500 Received: from [10.107.17.130] by x35.dev.mdolabs.com with [XMail 1.23 ESMTP Server] id for from ; Thu, 19 Jan 2006 16:13:50 -0800 Date: Thu, 19 Jan 2006 16:13:49 -0800 (PST) From: Davide Libenzi Subject: Re: new syscalls In-Reply-To: Message-ID: References: <20060118133629.1cda96fd.akpm@osdl.org> <20060118172802.5155048f.akpm@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-arch-owner@vger.kernel.org To: Andrew Morton Cc: tony.luck@intel.com, linux-arch@vger.kernel.org, janak@us.ibm.com, Ulrich Drepper , dwmw2@infradead.org, dhowells@redhat.com, christoph@lameter.com List-ID: On Thu, 19 Jan 2006, Davide Libenzi wrote: > On Wed, 18 Jan 2006, Andrew Morton wrote: > >> Davide Libenzi wrote: >>> >>> How sophisticated this has to be? >> >> umm >> >> - test basic functionality >> >> - test things which should fail: syscall arguments out-of-bounds, >> negative syscall args, etc. invalid fd. valid fd but for the wrong type >> of file. >> >> - if you can, something which will test the 32bit->64bit->32bit >> conversions which 32-bit userspace on 64-bit kernel needs to do. > > Somehow, I knew I didn't have to ask :) Here you go: http://www.xmailserver.org/epoll_pwait_test.c There is a problem with the test we have inside the kernel about the size of sigset_t, from the kernel (8 bytes on i386) and the glibc one (128 bytes): if (sigmask) { if (sigsetsize != sizeof(sigset_t)) return -EINVAL; if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask))) return -EFAULT; sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP)); sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); } ATM I left the check and I bolt 8 inside the test software, but this needs nicer handling. Typical run will show: davide@debstar:~/tmp$ ./epoll_pwait_test Testing from wrong epfd type : OK Testing from closed epfd type : OK Testing numevents <= 0 : OK Testing numevents too big : OK Testing wrong sigmask size : OK Testing getevents when none available : OK Testing getevents when one available : OK Testing signal when blocked : OK Testing signal when non blocked : OK - Davide