GNU bug report logs - #55153
29.0.50; Implement system_process_attributes on Cygwin

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Wed, 27 Apr 2022 15:06:02 UTC

Severity: normal

Found in version 29.0.50

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55153 <at> debbugs.gnu.org
Subject: bug#55153: 29.0.50; Implement system_process_attributes on Cygwin
Date: Wed, 27 Apr 2022 12:45:45 -0400
[Message part 1 (text/plain, inline)]
On 4/27/2022 11:53 AM, Eli Zaretskii wrote:
>> Date: Wed, 27 Apr 2022 11:16:46 -0400
>> From: Ken Brown <kbrown <at> cornell.edu>
>>
>> +# 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/<pid>/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/<pid>/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
[0001-Implement-system_process_attributes-on-Cygwin.patch (text/plain, attachment)]

This bug report was last modified 3 years and 29 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.