Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 18 Jul 2002 02:24:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 18 Jul 2002 02:24:43 -0400 Received: from jive.SoftHome.net ([66.54.152.27]:13725 "HELO jive.SoftHome.net") by vger.kernel.org with SMTP id ; Thu, 18 Jul 2002 02:24:40 -0400 From: irfan_hamid@softhome.net To: linux-kernel@vger.kernel.org Reply-To: irfan_hamid@softhome.net Subject: cli()/sti() clarification Date: Thu, 18 Jul 2002 00:27:40 -0600 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [202.52.197.1] Message-ID: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 31 Hi, I added two system calls, blockintr() and unblockintr() to give cli()/sti() control to userland programs (yes I know its not advisable) but I only want to do it as a test. My test program looks like this: blockintr(); /* Some long calculations */ unblockintr(); The problem is that if I press Ctrl+C during the calculation, the program terminates. So I checked the _syscallN() and __syscall_return() macros to see if they explicitly call sti() before returning to userspace, but they dont. Reading the lkml archives, I found that cli() disables only the interrupts, exceptions are allowed, so it makes sense that the SIGINT was delivered, but if thats the case, then how come the SIGINT was delivered from the Ctrl+C? Doesnt this mean that the SIGINT signal was generated as a result of the keyboard interrupt? I know I am missing something here, would appreciate if someone could point me in the right direction. Regards, Irfan Hamid. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/