Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #88

Re: posix_spawnp never fails

From Peter <excessphase@gmail.com>
Newsgroups comp.os.linux.development.apps
Subject Re: posix_spawnp never fails
Date 2011-04-21 12:49 -0700
Organization http://groups.google.com
Message-ID <26c2e620-dcc5-481d-8a33-d543c55f32d2@n2g2000prj.googlegroups.com> (permalink)
References (1 earlier) <b6bd3c86-7703-4307-b530-8025f17ac186@d26g2000prn.googlegroups.com> <39f75515-532d-4350-8c02-bc999b4d1c39@f31g2000pri.googlegroups.com> <87sjtby1d3.fsf@sapphire.mobileactivedefense.com> <b0433a28-7773-4f1e-86e3-99ba5a8d1fbc@a21g2000prj.googlegroups.com> <1bsjtbihed.fsf@snowball.wb.pfeifferfamily.net>

Show all headers | View raw


On Apr 21, 11:33 am, Joe Pfeiffer <pfeif...@cs.nmsu.edu> wrote:


> Like he said:  the execvp failed in the newly created process, not the
> old one.  So the answer is 127.



How do you distinguish between a normal exit(127) and one created by
this routine?

Also -- there are multiple reasons why execvp() may fail.
How do I distinguish between them?

It is desirable to report all the error information to the caller!

And anyway -- nobody has told me yet, why it is not possible or not
desirable
that posix_spawnp() returns an error code in case of execvp fails.
I can implement this!!!!



> The posix_spawnp man page has a lot of information on this, including
> some interesting commentary on why it doesn't work as you're expecting
> here.

I'm not following this man page.
They are talking about "asynchonous error notification"
and they do not explain, why this error code could not be returned
from posix_spawn directly and synchonously.
They are telling me, that not all errors can be detected before fork()
is being called:
Of course -- there are other processes running which may change the
system between these checks and the following code.
That's why you should not try to be smarter than the system.


I quite like the interface of posix_spawnp().
But the implementation seems to have been done by the same people,
which gave us
* errno and
* library routines returning pointer to static memory and
* SIGPIPE and
* no way to deal with "no more space" errors during writing to memory
created by mmap() of a sparse file.


I'm less and less willing to accept such sick coding.
This is 2011!

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

posix_spawnp never fails Peter <excessphase@gmail.com> - 2011-04-20 07:38 -0700
  Re: posix_spawnp never fails Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-04-20 16:17 +0100
  Re: posix_spawnp never fails David Schwartz <davids@webmaster.com> - 2011-04-20 15:37 -0700
    Re: posix_spawnp never fails Peter <excessphase@gmail.com> - 2011-04-21 09:15 -0700
      Re: posix_spawnp never fails Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-04-21 18:12 +0100
        Re: posix_spawnp never fails Peter <excessphase@gmail.com> - 2011-04-21 11:25 -0700
          Re: posix_spawnp never fails Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-04-21 12:33 -0600
            Re: posix_spawnp never fails Peter <excessphase@gmail.com> - 2011-04-21 12:49 -0700
              Re: posix_spawnp never fails Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-04-21 14:57 -0600
                Re: posix_spawnp never fails Peter <excessphase@gmail.com> - 2011-04-21 14:09 -0700
                Re: posix_spawnp never fails Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-04-21 16:31 -0600
                Re: posix_spawnp never fails Richard Kettlewell <rjk@greenend.org.uk> - 2011-04-22 11:25 +0100
                Re: posix_spawnp never fails Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-04-22 18:02 +0100
              Re: posix_spawnp never fails Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-04-22 17:58 +0100
      Re: posix_spawnp never fails Peter <excessphase@gmail.com> - 2011-04-21 10:25 -0700
      Re: posix_spawnp never fails David Schwartz <davids@webmaster.com> - 2011-04-25 16:57 -0700

csiph-web