zsh-users
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Anyone familiar with auto-fu.zsh project?
Date: Wed, 13 Jun 2018 06:43:32 -0500	[thread overview]
Message-ID: <211F8EDD-6F25-4AD3-B947-A786E620C3AA@dana.is> (raw)
In-Reply-To: <CAKc7PVDU1FKdu3qc1FcnNO3x-nhFAkLe8MzFpUonWAs=7v=G7g@mail.gmail.com>

On 13 Jun 2018, at 05:48, Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
>But how to run a binary without forking first? I would have to be
>`exec getppid`.

As far as i understand it:

  % echo $$; ( ./getppid 1; ./getppid 2 )
  29746 30173 29746

echo $$     -> main shell
(           -> fork() to sub-shell; new PID, so the PPID is the main shell
./getppid 1 -> fork() and exec(); new PID, so the PPID is the sub-shell
./getppid 2 -> sub-shell is about to finish, so fork()ing again is unnecessary;
               exec() directly instead. getppid assumes the PID of the
               sub-shell, so the PPID remains the main shell

On 13 Jun 2018, at 05:48, Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
>Procfs is nice but lives in a word of cats, echos, ls -l – I mean,
>it's a world of text, files and symlinks. IMO it is good to allow
>users cat etc. it from interactive command line, but for short
>programs, it's like taking away coherency from them, they have to open
>a channel for this file tree, I feel this is unstable.

They wouldn't have to do anything, the script would do it for them. In any case,
if procfs is good enough to implement ps, pgrep, top, &c., on Linux and Solaris,
i bet it's probably good enough for this

dana


  reply	other threads:[~2018-06-13 11:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 17:42 Sebastian Gniazdowski
2018-06-06 18:35 ` Eric Freese
2018-06-09 15:30   ` Sebastian Gniazdowski
2018-06-10  0:58     ` Eric Freese
2018-06-11  5:24       ` Sebastian Gniazdowski
2018-06-11  8:25         ` Eric Freese
2018-06-11  9:46           ` Sebastian Gniazdowski
2018-06-12  1:55             ` Eric Freese
2018-06-12 10:23               ` Sebastian Gniazdowski
2018-06-12 11:32               ` Peter Stephenson
2018-06-13  4:09                 ` Eric Freese
2018-06-13  7:26                   ` dana
2018-06-13  7:32                     ` Sebastian Gniazdowski
2018-06-13  8:28                       ` Sebastian Gniazdowski
2018-06-13  9:17                         ` dana
2018-06-13 10:48                           ` Sebastian Gniazdowski
2018-06-13 11:43                             ` dana [this message]
2018-06-14  8:55                           ` Peter Stephenson
2018-06-14  9:48                             ` dana
2018-06-14 10:00                               ` Peter Stephenson
2018-06-13  7:27                   ` Sebastian Gniazdowski
2018-06-06 23:45 ` Takeshi Banse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=211F8EDD-6F25-4AD3-B947-A786E620C3AA@dana.is \
    --to=dana@dana.is \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).