From owner-freebsd-arch@FreeBSD.ORG Fri Aug 31 22:52:07 2007 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C2C16A417 for ; Fri, 31 Aug 2007 22:52:07 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (penna-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id D782013C461 for ; Fri, 31 Aug 2007 22:52:06 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.1/8.14.1) with ESMTP id l7VMq2O3001524 for ; Fri, 31 Aug 2007 18:52:02 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: freebsd-arch@FreeBSD.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-5VC5dfdhhdL4pmUdMfXX" Organization: FreeBSD, Inc. Date: Fri, 31 Aug 2007 18:52:01 -0400 Message-Id: <1188600721.1255.11.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on creme-brulee.marcuscom.com Cc: Subject: Understanding interrupted system calls X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2007 22:52:07 -0000 --=-5VC5dfdhhdL4pmUdMfXX Content-Type: text/plain Content-Transfer-Encoding: quoted-printable In my attempts to debug the problems with ConsoleKit and the VT_WAITACTIVE ioctl, I delved into the tsleep/msleep code, and I think I have a pretty good idea when it returns EINTR vs. ERESTART. However, I'm curious as to why I have to do something like the following to allow a process waiting in tsleep() to die when it receives a termination signal (e.g. SIGTERM or SIGINT): struct sigaction sa; sa.sa_handler =3D SIG_DFL; ... sigaction (SIGTERM, &sa, NULL); Shouldn't the ps_sigintr set be initialized to the default set of termination signals by default (e.g. in init_main.c proc0_init())? That is, shouldn't the list of signals whose default action is to terminate the process (according to signal(3)) be allowed to interrupt a system call by default? If one then wants to restart the syscall, they can explicitly do: struct sigaction sa; sa.sa_flags =3D SA_RESTART; ... sigaction (SIGTERM, &sa, NULL); I'm just trying to get a better handle on why terminating a program that is running the VT_WAITACTIVE ioctl leaves an unkillable process on FreeBSD, but apparently just causes the program to terminate on Linux. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-5VC5dfdhhdL4pmUdMfXX Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBG2JuLb2iPiv4Uz4cRAuAMAJ90Mx4EM5avJpf8l39v3lD6qLGGEgCgkVas F7UWS+dPX84jJeec94h2hFU= =TFHe -----END PGP SIGNATURE----- --=-5VC5dfdhhdL4pmUdMfXX--