From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#55153: 29.0.50; Implement system_process_attributes on Cygwin Date: Wed, 27 Apr 2022 12:45:45 -0400 Message-ID: References: <96920ef8-e5c6-0b9f-a8f4-b7e0b1c53328@cornell.edu> <83zgk6bk11.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------PrVaqgUF0beKnVL9158eQ5mQ" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25413"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Cc: 55153@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 27 18:46:10 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njknq-0006Ot-BA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Apr 2022 18:46:10 +0200 Original-Received: from localhost ([::1]:47566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njknp-0007Tz-3t for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Apr 2022 12:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njknj-0007T4-11 for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2022 12:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njkni-0003WO-OB for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2022 12:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1njkni-0003U5-Gc for bug-gnu-emacs@gnu.org; Wed, 27 Apr 2022 12:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Apr 2022 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55153 X-GNU-PR-Package: emacs Original-Received: via spool by 55153-submit@debbugs.gnu.org id=B55153.165107795713377 (code B ref 55153); Wed, 27 Apr 2022 16:46:02 +0000 Original-Received: (at 55153) by debbugs.gnu.org; 27 Apr 2022 16:45:57 +0000 Original-Received: from localhost ([127.0.0.1]:44073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njknd-0003Th-CH for submit@debbugs.gnu.org; Wed, 27 Apr 2022 12:45:57 -0400 Original-Received: from mail-bn7nam10on2115.outbound.protection.outlook.com ([40.107.92.115]:44000 helo=NAM10-BN7-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njknb-0003TT-ET for 55153@debbugs.gnu.org; Wed, 27 Apr 2022 12:45:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oXxgeDCuAx9ialTOFkKPRjVmd19UTAc8MCn56goNapzAPr8Z/S6LzvPPM68zsPEB+1SFq29zMFOe+f+fEo8Qb+TeSZ5myP3WWXwAU7jKeZqkYmSJ4MHg49cpcDfjF9l52V7i6oYJzg1I85LYr/FOf5dagcqhbWhDdVrdrzlsZklkLIk1iVwCHuYrv18cuasrzOuLXWfUzxuMaRn4NI22X6ZuTr4qTm2kokxgjal06kXPLEkhANOEcv8JTdGmK9uNs2GvT94WMK2ztP3e5ErddmmLtHU93HhcC5xBfVCii/2HoD2hDqC0hv8014gdtIQnoAJuD/0dQyWX34Cw3AOMzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nPFWs0nFv6pYXG2T+3/nOu1k3NNwRn8AFISLx0kCGAY=; b=nlDAh8hiv6PZmjl72V8m3k56tR5wCD65v6M1aPo4qP1Kb6KZlzBg8GI9ovZFjpyuZwbQmQr93MyJFQwU5o4XuLnOT0Y1gZjhe7ocYK5sza/uD0G0n/H+l9idzKtsvBIie/hZAMHUO6CXkNWhIUaxUTkKvSGyziGa1h6qikOeru2rko0ux7lrISBeZeDuCMxVeomsNQBP7qxovJMCeDi4y4fZE3E84Q9RhPRlpj+Ekly0Yk0rwYutf7E+UzG4E2MvHy0e63pe+j5l/p6G8QHBrxdtZw1bxIo2mBpYJPKChmpVEhGHBaIte01pMJVeyPnSStOahODCkfQUqVj9UUCCdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nPFWs0nFv6pYXG2T+3/nOu1k3NNwRn8AFISLx0kCGAY=; b=OGlsHyDRSa3karXTZ+YNwUpfrZB3E34tCeByVLqeZBn047B3wnyIwtsOGCPHqz9aaKQ+n1mlsfwsx595guh71DxAEYokei22GVaJsshstfRbqFfmQm9sNxASW4rsA3/QXUjmTYU7rEpmFpUK1cgxDaewyGB6XnTf1DGjuEsleUY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cornell.edu; Original-Received: from BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) by CY4PR04MB0440.namprd04.prod.outlook.com (2603:10b6:903:b4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Wed, 27 Apr 2022 16:45:48 +0000 Original-Received: from BN7PR04MB4388.namprd04.prod.outlook.com ([fe80::ed45:6a5d:b109:673e]) by BN7PR04MB4388.namprd04.prod.outlook.com ([fe80::ed45:6a5d:b109:673e%6]) with mapi id 15.20.5206.013; Wed, 27 Apr 2022 16:45:48 +0000 Content-Language: en-US In-Reply-To: <83zgk6bk11.fsf@gnu.org> X-ClientProxiedBy: MN2PR05CA0036.namprd05.prod.outlook.com (2603:10b6:208:c0::49) To BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4071bac2-3263-448b-070c-08da286d6172 X-MS-TrafficTypeDiagnostic: CY4PR04MB0440:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YxqdR1UQUvUrv0hvhd0dNwrM1kpBYD2EMwHYXVVPFAKvq/gfH+WP+LeBEzf6mByYwaJm5r7EfjC7weskb29r3v4jV3WJtEo40mMGh4s1Hc/m71LXlxkLzL6NRVbTSGcDRgXg/RdnS7/FpdN3tJYwkRdTRD9yq/8hDMbrUQT1v1v8cbt5KzQVMe+n5+dIjsEh5HygKomB+oAg0QXNwjG034Z0cxsNapEueVgeXdyC42Wl0i586ZhxvelE8cmXQ5V9GD9dQ/CKaCbC08Rwk9dJdTrGYJlgzPcGeVepgAgwLqZnjqNl4OhHKBw+EH6Hztu1GdsyCH3sw9pLex21GwWcUkNvTeayyYKokKfwfXb5Y/WjYs/yVDgNChjLK8yyKi32HfkJzcsP+/oafQ8B1oxglo5+O1AFQK23ll+0S2FP8TKMNmaY17pWbgulwO0xlBiF+FKI4LK/rNHio0U1QcZBVk2VyQ8D26UTy4YTJSupKzZs44xlUkOuuhjO1ZM6TpENkZTEThvhZ45WuMnVvYMWMU8kWhq7NMrBT+jYNFg33Ki8TsVttLwJeBYVQv5I408XcfhVofW4A/KRxkIbD/03Z26ePDaWqbhHF/Dtn9XcZoLiEB4II/2kKcXhUmtozPFc7A6sBAgP8S5YnQbweJTPBVbYnCLd0AQmAH26SvGEM66+u59ljbCTN2coBBU97P9dVzxZJmw8Fl2t1BFVftRNmwcmspE4eKt5nnwcF/i1dvmePHjOaH0+O6cYPKsuz VFG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(508600001)(2616005)(75432002)(86362001)(31696002)(6512007)(33964004)(26005)(53546011)(6506007)(38100700002)(6666004)(186003)(786003)(2906002)(66946007)(66556008)(66476007)(316002)(36756003)(235185007)(5660300002)(8936002)(31686004)(4326008)(6916009)(83380400001)(8676002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: j31OxZAMKmxprZ8Kp2Atdu8keOK50cXBlaf941mWAaaBU3YKLRH244iB72M9chHwIV9/Xn3NorInVSs28Xja+tXqQTlwLvQ5rmCV3D/JpdY+Ik592/xngJqatNOFUGY2fcNMvaSzU7kBCA6P2q7vurEOORB5WnI1mSd6LpJ2A8Rgm96XfVgzr3Z7sEHK85u6XYG8E1reN78Hi+W0p9B0tdKRCQPvLzudM9UY/kq+pXPw+BHtgWxoIvO0vw2Q1NG9gdV/bRLmhlUfj+MhrovVdXMZtoga43v4XtZngY0UPvH6ErCAJXkKrLAU4S+Z6tYoNmg8ZwqieJRDaUqnU5HFEA4BM42H7qQchKhppqI/Js4y1p/+q9Il3grDZP6NOG/EcrQTbZnIgjGLHUnTj5fLN0+1eYTuBuX6U67+a9o+UdXxfKbjtj8AlKfh5ygPduuXqw75AEOlIXu/b4WDkluMBp21qB+aFRME/axwN+cMNog5tvT2kEkhoqS+N/OUGYn4s4hmzLQmXgJfNjwoxBsnRvIdzI0CDJFIkx+VxK9McdE37YlL7+eOfjCxkuF7FrtM8UZpRrdKJPYCL6GHb/TQ9+j4YBvXkNXJ4ftM+BN/L12x7u40HByI8lPAUPLWvPnxqHuSy1RmY/MRFUCOvEA0Ai9zXtcjZBbNWwpz4olLTRo96LVyS8FOy5V7jpNaPS5HBJzjQ8FV1PqM0cwqtJs+DTglUlEd4CJXj56HFib0KtXD6nqIa+kadqfS6i ISWRAf3yTTMlzAJ9ywyyP5DCPNza0ZuFJNLSXUJT5hPFCCmKaAcfw8RRxxjp2GClbeux+aTfvkTpmBItoYmOVXOt1O7H2jpNAC X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 4071bac2-3263-448b-070c-08da286d6172 X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 16:45:48.0255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d+gJOogVI6i1QkYFUt4fVU1CPlCGhBDnjTdFKMzRCHoWem4tS31Kc4BiuTEZLR8/qwHPX2WgaJI5JEzvpZks0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB0440 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230798 Archived-At: --------------PrVaqgUF0beKnVL9158eQ5mQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/27/2022 11:53 AM, Eli Zaretskii wrote: >> Date: Wed, 27 Apr 2022 11:16:46 -0400 >> From: Ken Brown >> >> +# ifdef CYGWIN >> + /* ttname */ >> + strcpy (procfn_end, "/ctty"); >> + fd = emacs_open (fn, O_RDONLY, 0); >> + if (fd < 0) >> + nread = 0; >> + else >> + { >> + record_unwind_protect_int (close_file_unwind, fd); >> + nread = emacs_read_quit (fd, procbuf, sizeof procbuf); >> + } >> + /* /proc//ctty should always end in newline. */ >> + if (0 < nread && procbuf[nread - 1] == '\n') >> + procbuf[nread - 1] = '\0'; >> + else >> + procbuf[0] = '\0'; >> + attrs = Fcons (Fcons (Qttname, build_string (procbuf)), attrs); > > Is what you read from /proc//ctty guaranteed to be pure-ASCII > string? Yes. It's typically something like "/dev/pty0". > P.S. Doesn't this warrant a NEWS entry? Revised patch attached, with a NEWS entry. Ken --------------PrVaqgUF0beKnVL9158eQ5mQ Content-Type: text/plain; charset=UTF-8; name="0001-Implement-system_process_attributes-on-Cygwin.patch" Content-Disposition: attachment; filename="0001-Implement-system_process_attributes-on-Cygwin.patch" Content-Transfer-Encoding: base64 RnJvbSA1YWY0ODNiM2FkY2Q0NzVhMmQ1NDRjOGYyMzQ2MmQ5MDA1NTQ5OGMwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLZW4gQnJvd24gPGticm93b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