Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2520904ybi; Sun, 9 Jun 2019 13:58:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi0WVvKNrEbwU/eqr70V6BUJh35dt3ADUmWjywai6S3ZVY1FvMHgQUjwwkpcXorLNpwxW9 X-Received: by 2002:a17:90a:9202:: with SMTP id m2mr17720507pjo.37.1560113883040; Sun, 09 Jun 2019 13:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560113883; cv=none; d=google.com; s=arc-20160816; b=QNnqHKhkhmy/V2B69QTLkTFCUFkAJIRwUu9fK+unT6MjFOZsGTqtc0THFq8kEQUiAS Q0iBwnd91a1aptGjoEvkDo9S3dZRxTdJD3G36gEX6iB4LyHduNSq+SInxUTrdv9T8tWU BCTRgGXm1arJV/059mYilEiAA1DgeERDU74CTLN7B6Hr4VmcOEL+A9S57FXSv4j/0yOT 0XFZVM4igaNlNPBQiytjgW9JOnYXmu0UdlRD3aE0zjnLpYh2hkBxIYW1YI7qmPjyic2j rV8+fDEXbS0qnuQU1GAAl6UtItbQSQU5MCKv7rminWkQjTB7e5WaNr2ART/qzcA2JyUP BRpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:user-agent:openpgp:in-reply-to :content-disposition:mime-version:references:message-id:cc:to:from :date:dkim-signature; bh=OJHA/ztj2Mefp9KTnxgvWqb7CJ2Zz+U6e1UeukWwwkg=; b=viAdBjtq0+TZjzfFKXVNHTOAEQWHypcrpYNr1o8jYppnbcVA3ClXfIYDGvactIM9dy fC50AXJQfsHwjVj8f7I3UZ1UpxbyEhxOSRKyP9MHP1eNBvfnLJgparBdXJvjg6pzdQnl Ag133HuSX8IngI1r4/rXL0/svOVaUEVEmE6mq9wn7AmWzjo0/VBXMWRYNoCjJRDKeYYT S1BPUNjsBOJ88tRKONOHf27nT9eD0cP4NihRcnIw5mBkvYaOVEX52tKiFil9CFUnxJI5 wwHX2n7PdWnaikwCWlzLQO7HuoiQp3eLFKkELwsJRN2Sjbldq7Cn3RhNg7i7VBEnc4U8 zpHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cs.msu.ru header.s=dkim header.b=IyAeS95x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cs.msu.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba7si7666142plb.105.2019.06.09.13.57.46; Sun, 09 Jun 2019 13:58:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@cs.msu.ru header.s=dkim header.b=IyAeS95x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cs.msu.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbfFIU4f (ORCPT + 99 others); Sun, 9 Jun 2019 16:56:35 -0400 Received: from mx.cs.msu.ru ([188.44.42.42]:16306 "EHLO mail.cs.msu.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729637AbfFIU4f (ORCPT ); Sun, 9 Jun 2019 16:56:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.msu.ru; s=dkim; h=Subject:In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OJHA/ztj2Mefp9KTnxgvWqb7CJ2Zz+U6e1UeukWwwkg=; b=IyAeS95x09kYjxICmLDMpH0/z0 PxsU+ukRTdzwLKHbzq3dIk7JFcjgLYJvxWgmpdfQVljipwoyPsP8ZuSFAZJ4NpQm6ZHgIue6uVGel 8EWdNU2GioogFMojEad3hyHuL3qnkG+GI5HbopuxxO/AzNHIs/B+pb6bk3vXwJ7vSl/iwCiH2LGv4 82PaVJsj5rzb3+L569NGITAkweXOf15lXzr3/zARA3EmBdw5AUqv8lcCjurf4Ubwgh5UN7GRj9pag CZuU9DZ+hNoyLZiC5VDDLvBb2//s/Uv+PpBPrG1PjfQDK18nascY6iul049H21oShU2UVUUb7pugo 85thOULw==; Received: from [37.204.119.143] (port=60738 helo=cello) by mail.cs.msu.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92 (FreeBSD)) (envelope-from ) id 1ha4rN-000Oz8-MR; Sun, 09 Jun 2019 23:56:13 +0300 Date: Sun, 9 Jun 2019 23:56:10 +0300 From: Arseny Maslennikov To: Pavel Machek Cc: Greg Kroah-Hartman , Jiri Slaby , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, "Vladimir D . Seleznev" Message-ID: <20190609205610.GB3736@cello> References: <20190605081906.28938-1-ar@cs.msu.ru> <20190609174139.GA11944@xo-6d-61-c0.localdomain> <20190609194013.GA3736@cello> <20190609195132.GA1430@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: <20190609195132.GA1430@amd> OpenPGP: url=http://grep.cs.msu.ru/~ar/pgp-key.asc User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 37.204.119.143 X-SA-Exim-Mail-From: ar@cs.msu.ru X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.cs.msu.ru X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_ALL autolearn=no autolearn_force=no version=3.4.2 Subject: Re: [PATCH 0/7] TTY Keyboard Status Request X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 09, 2019 at 09:51:32PM +0200, Pavel Machek wrote: > Hi! >=20 > > > > This patch series introduces TTY keyboard status request, a feature= of > > > > the n_tty line discipline that reserves a character in struct termi= os > > > > (^T by default) and reacts to it by printing a short informational = line > > > > to the terminal and sending a Unix signal to the tty's foreground > > > > process group. The processes may, in response to the signal, output= a > > > > textual description of what they're doing. > > > >=20 > > > > The feature has been present in a similar form at least in > > > > Free/Open/NetBSD; it would be nice to have something like this in L= inux > > > > as well. There is an LKML thread[1] where users have previously > > > > expressed the rationale for this. > > > >=20 > > > > The current implementation does not break existing kernel API in any > > > > way, since, fortunately, all the architectures supported by the ker= nel > > > > happen to have at least 1 free byte in the termios control character > > > > array. > > >=20 > > > I like the idea... I was often wondering "how long will this dd take"= =2E (And in > > > case of dd, SIGUSR1 does the job). > > >=20 > > > I assume this will off by default, so that applications using ^T toda= y will not > > > get surprise signals? > >=20 > > If any of isig, icanon and iexten is disabled on the tty, the signal is > > not sent. >=20 > As expected. >=20 > > Any application that wants to handle raw terminal input events itself, > > e.g. vim, mutt, libreadline, anything ncurses-based, etc., has to turn > > off the tty's cooked mode, i.e. at least icanon. This means those > > applications are unaffected. >=20 > Agreed, those are unaffected. >=20 > But if I have an application doing read() from console (without > manipulating tty), am I going to get surprise signal when user types > ^T? >=20 > Pavel As of now, that application will indeed receive a signal that is guaranteed to be ignored by default. This is similar to SIGWINCH, which is default-ignored as well: if the terminal width/height changes (like when a terminal emulator window is resized), its foreground pgrp gets a surprise signal as well, and the processes that don't care about WINCH (and thus have default disposition) do not get confused. E.g. 'strace cat' demonstrates this quite clearly. --OwLcNYc0lM97+oe1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE56JD3UKTLEu/ddrm9dQjyAYL01AFAlz9cmUACgkQ9dQjyAYL 01DiLg/8Cdt57FGiYnFdFUmPdCyKxLZO0UgRuqJbBGCmjFsGXF/mS1R0Qb+UPmWk 5dFRRhixDpGMFkSSnk179OJkHWBmDUvtV0FMYCyp0CkGCG5YcLxVfYG7fcaVWiQN qt/HZ1G1q6EAI5eLVOKHKA1N8h599rbJjZYH6j7le9W20DjN6LphexUp6HZ7IsF5 B1KslK5hNfSVAs9GZ9XMAptrcbJ4OusvLJJNfacKwoIrBMmAXkTIx32jxndbkeAn U5F5Vs0hyjmnboOBYTzF5NGF8/PPPtVwXnu00FjpM+Hz+3pc9SEfbS4r4h7QiG6R emKrGX/mTLeQcyk8XPtmInVqpcG5dWGhxeOu/H92ZpRzCl3gnUSzJr5/DFQrYa4T 1B0e1Vp5pGbEHS8mY1TwrXe/BldIkumiESjeaNkqqhDsBEla7xxGM2Pj7F/7DOIn FYVOFNQ4kqxaGspvd1qzpwVPV4sVBDlQDYqkQu/l0c52MW8z76zDr7cwWnc0bevL iETVpoQm0WQNbZWj4N2RSNLjwr9LgV4xpG9vLVUyOyXq7aIRQy+4EqhwIXUaL5uj OLLKjs/LB3sYNUfm/qsS2FhA2QMKXo2SQMoFLAsrWv3mAZGXIHTbun5BtGMwYMx0 pBNC888Vvyn+4VgqZ6jp4ho2Lul5Ga9m7s/4/wso0lGe+QAbK88= =phyb -----END PGP SIGNATURE----- --OwLcNYc0lM97+oe1--