From owner-svn-src-all@FreeBSD.ORG Sun May 24 17:48:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8DAD98D; Sun, 24 May 2015 17:48:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C83C1DD6; Sun, 24 May 2015 17:48:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OHmYUF030788; Sun, 24 May 2015 17:48:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OHmY21030787; Sun, 24 May 2015 17:48:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201505241748.t4OHmY21030787@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 24 May 2015 17:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283475 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 17:48:34 -0000 Author: dchagin Date: Sun May 24 17:48:34 2015 New Revision: 283475 URL: https://svnweb.freebsd.org/changeset/base/283475 Log: Convert Linux sigsets before showing. Linux kernel displays sigset always as 16x4 bit mask. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun May 24 17:47:20 2015 (r283474) +++ head/sys/compat/linprocfs/linprocfs.c Sun May 24 17:48:34 2015 (r283475) @@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$"); #include #endif /* __i386__ || __amd64__ */ +#include #include #include #include @@ -742,6 +743,7 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) segsz_t lsize; struct thread *td2; struct sigacts *ps; + l_sigset_t siglist, sigignore, sigcatch; int i; sx_slock(&proctree_lock); @@ -833,29 +835,25 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) /* * Signal masks - * - * We support up to 128 signals, while Linux supports 32, - * but we only define 32 (the same 32 as Linux, to boot), so - * just show the lower 32 bits of each mask. XXX hack. - * - * NB: on certain platforms (Sparc at least) Linux actually - * supports 64 signals, but this code is a long way from - * running on anything but i386, so ignore that for now. */ PROC_LOCK(p); - sbuf_printf(sb, "SigPnd:\t%08x\n", p->p_siglist.__bits[0]); - /* - * I can't seem to find out where the signal mask is in - * relation to struct proc, so SigBlk is left unimplemented. - */ - sbuf_printf(sb, "SigBlk:\t%08x\n", 0); /* XXX */ + bsd_to_linux_sigset(&p->p_siglist, &siglist); ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); - sbuf_printf(sb, "SigIgn:\t%08x\n", ps->ps_sigignore.__bits[0]); - sbuf_printf(sb, "SigCgt:\t%08x\n", ps->ps_sigcatch.__bits[0]); + bsd_to_linux_sigset(&ps->ps_sigignore, &sigignore); + bsd_to_linux_sigset(&ps->ps_sigcatch, &sigcatch); mtx_unlock(&ps->ps_mtx); PROC_UNLOCK(p); + sbuf_printf(sb, "SigPnd:\t%016jx\n", siglist.__mask); + /* + * XXX. SigBlk - target thread's signal mask, td_sigmask. + * To implement SigBlk pseudofs should support proc/tid dir entries. + */ + sbuf_printf(sb, "SigBlk:\t%016x\n", 0); + sbuf_printf(sb, "SigIgn:\t%016jx\n", sigignore.__mask); + sbuf_printf(sb, "SigCgt:\t%016jx\n", sigcatch.__mask); + /* * Linux also prints the capability masks, but we don't have * capabilities yet, and when we do get them they're likely to