I found this very surprising! My mental model of running programs from a shell did not include the possibility of a program reaching up into the
shell and forcing it to run a command. Can anyone explain the mechanism by which Emacs is communicating with my shell in this situation? Does it rely
on the process still being running (albeit in the background)?
Benjamin Esham <usenet@esham.io> writes:
I found this very surprising! My mental model of running programs from a
shell did not include the possibility of a program reaching up into the
shell and forcing it to run a command. Can anyone explain the mechanism by >> which Emacs is communicating with my shell in this situation? Does it rely >> on the process still being running (albeit in the background)?
On Linux, have a look for TIOCSTI in ‘man ioctl-tty’.
In general, if you want to know how a program achieved some kind of OS interaction like this, strace is good for shedding light on the question.
Richard Kettlewell <invalid@invalid.invalid> writes:
Benjamin Esham <usenet@esham.io> writes:
I found this very surprising! My mental model of running programs from a >>> shell did not include the possibility of a program reaching up into the
shell and forcing it to run a command. Can anyone explain the mechanism by >>> which Emacs is communicating with my shell in this situation? Does it rely >>> on the process still being running (albeit in the background)?
On Linux, have a look for TIOCSTI in ‘man ioctl-tty’.
It's 'man ioctl_tty' (underscore, not hyphen).
Richard Kettlewell <invalid@invalid.invalid> writes:
Benjamin Esham <usenet@esham.io> writes:
I found this very surprising! My mental model of running programs from a >>> shell did not include the possibility of a program reaching up into the
shell and forcing it to run a command. Can anyone explain the mechanism by >>> which Emacs is communicating with my shell in this situation? Does it rely >>> on the process still being running (albeit in the background)?
On Linux, have a look for TIOCSTI in ‘man ioctl-tty’.
It's 'man ioctl_tty' (underscore, not hyphen).
Benjamin Esham <usenet@esham.io> writes:
I found this very surprising! My mental model of running programs from a
shell did not include the possibility of a program reaching up into the
shell and forcing it to run a command. Can anyone explain the mechanism
by which Emacs is communicating with my shell in this situation? Does it
rely on the process still being running (albeit in the background)?
On Linux, have a look for TIOCSTI in ‘man ioctl-tty’.
In general, if you want to know how a program achieved some kind of OS interaction like this, strace is good for shedding light on the question.
Keith Thompson wrote:[...]
Richard Kettlewell <invalid@invalid.invalid> writes:
On Linux, have a look for TIOCSTI in ‘man ioctl-tty’.
It's 'man ioctl_tty' (underscore, not hyphen).
Interesting--I don't have that man page on my system (Ubuntu 16.04), and typing "man ioct<TAB>" suggests that the relevant pages I have are "ioctl", "ioctl_fat", and "ioctl_list", the latter of which describes itself as "a list of ioctl calls in Linux/i386 kernel 1.3.27". (That kernel was released on September 14, 1995, if you were curious.)
I wonder if Ubuntu relegates the ioctl_tty page to some "extra docs" package that isn't installed by default. Which distribution are you using?
Keith Thompson wrote:
Benjamin Esham <usenet@esham.io> writes:
Keith Thompson wrote:
It's 'man ioctl_tty' (underscore, not hyphen).
Interesting--I don't have that man page on my system (Ubuntu 16.04), and >>> typing "man ioct<TAB>" suggests that the relevant pages I have are
"ioctl", "ioctl_fat", and "ioctl_list", the latter of which describes
itself as "a list of ioctl calls in Linux/i386 kernel 1.3.27". (That
kernel was released on September 14, 1995, if you were curious.)
I wonder if Ubuntu relegates the ioctl_tty page to some "extra docs"
package that isn't installed by default. Which distribution are you
using?
On my Ubuntu 18.04.3 system, that man page is part of the "manpages-dev"
package -- but so are the ioctl and ioctl_* man pages, including the
ones you listed.
I do indeed have manpages-dev installed... some digging on the Ubuntu Packages Search site reveals that this man page was not part of that package in Xenial (16.04, the version I'm using) but was added in the next release (Bionic, 18.04) and has been there since. I wonder what the reason was for the omission.
Benjamin Esham <usenet@esham.io> writes:
Keith Thompson wrote:
It's 'man ioctl_tty' (underscore, not hyphen).
Interesting--I don't have that man page on my system (Ubuntu 16.04), and
typing "man ioct<TAB>" suggests that the relevant pages I have are
"ioctl", "ioctl_fat", and "ioctl_list", the latter of which describes
itself as "a list of ioctl calls in Linux/i386 kernel 1.3.27". (That
kernel was released on September 14, 1995, if you were curious.)
I wonder if Ubuntu relegates the ioctl_tty page to some "extra docs"
package that isn't installed by default. Which distribution are you
using?
On my Ubuntu 18.04.3 system, that man page is part of the "manpages-dev" package -- but so are the ioctl and ioctl_* man pages, including the
ones you listed.
Benjamin Esham <usenet@esham.io> writes:
Keith Thompson wrote:
Benjamin Esham <usenet@esham.io> writes:
I wonder if Ubuntu relegates the ioctl_tty page to some "extra docs"
package that isn't installed by default. Which distribution are you
using?
On my Ubuntu 18.04.3 system, that man page is part of the "manpages-dev" >>> package -- but so are the ioctl and ioctl_* man pages, including the
ones you listed.
I do indeed have manpages-dev installed... some digging on the Ubuntu
Packages Search site reveals that this man page was not part of that
package in Xenial (16.04, the version I'm using) but was added in the
next release (Bionic, 18.04) and has been there since. I wonder what the
reason was for the omission.
[snip]
Try "man tty_ioctl" or "man 4 tty_ioctl". (On Ubuntu 18.04, "tty_ioctl" redirects to "ioctl_tty".)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:34:23 |
Calls: | 6,640 |
Files: | 12,187 |
Messages: | 5,325,146 |