git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: "Johannes Sixt" <j.sixt@viscovery.net>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Matthias Lederhofer" <matled@gmx.net>,
	"Jürgen Rühle" <j-r@online.de>,
	austin-group-futures-l@opengroup.org
Subject: setting working dir in posix_spawn() (Re: Fix 'git log' early pager startup error case)
Date: Thu, 26 Aug 2010 01:18:15 -0500	[thread overview]
Message-ID: <20100826061815.GH9708@burratino> (raw)
In-Reply-To: <4C752739.3010808@redhat.com>

(+cc: austin-group-futures)

Eric Blake wrote:
> On 08/25/2010 01:00 AM, Johannes Sixt wrote:

>> Just FYI, posix_spawn() is not sufficiently capable for the demands of
>> start_command(): It doesn't allow to set a new CWD for the spawned process.
>
> And even if posix_spawn() were capable, cygwin doesn't yet implement it.

Hmm, okay.  You have access to win32api, though, right?  So it should
be possible to reuse code from compat/mingw.c::mingw_spawnvpe.

Do you think there would be any interest in a posix_spawn() variant
that takes a dir parameter?  I am imagining something like this:

 int posix_spawn2(pid_t *restrict pid, const char *restrict path,
	const posix_spawn_file_actions_t *file_actions,
	const posix_spawnattr_t *restrict attrp,
	char *const argv[restrict], char *const envp[restrict],
	const char *dir);

or this:

 int posix_spawn2(pid_t *restrict pid, const char *restrict path,
	const posix_spawn_file_actions_t *file_actions,
	const posix_spawnattr_t *restrict attrp,
	char *const argv[restrict], char *const envp[restrict],
	int dirfd);

or this:

 int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t
	*file_actions, int dirfd);

  reply	other threads:[~2010-08-26  6:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 17:33 Fix 'git log' early pager startup error case Linus Torvalds
2010-08-25  1:36 ` Jonathan Nieder
2010-08-25  7:00   ` Johannes Sixt
2010-08-25 14:22     ` Eric Blake
2010-08-26  6:18       ` Jonathan Nieder [this message]
2010-08-26  7:16         ` setting working dir in posix_spawn() (Re: Fix 'git log' early pager startup error case) Joshua Juran
2010-08-26 14:13         ` Eric Blake
2010-08-25 19:16 ` Fix 'git log' early pager startup error case Junio C Hamano
2010-08-25 20:05   ` Linus Torvalds

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=20100826061815.GH9708@burratino \
    --to=jrnieder@gmail.com \
    --cc=austin-group-futures-l@opengroup.org \
    --cc=eblake@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j-r@online.de \
    --cc=j.sixt@viscovery.net \
    --cc=matled@gmx.net \
    --cc=torvalds@linux-foundation.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.
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).