| Summary: | Add posix_spawn(3) | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Ed Schouten <ed> |
| Component: | standards | Assignee: | David Xu <davidxu> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 8.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Ed Schouten
2008-03-24 15:40:03 UTC
* Ed Schouten <ed@80386.nl> wrote: > > > This patch still misses a manual page. > > FreeBSD has an permit to use the verbatim POSIX specification in its > > manual pages, with proper attribution. > > See the /usr/share/examples/mdoc/POSIX-copyright > > I'll take a look at it soon. I will probably store a final diff > somewhere online, because the manual pages will make the diff too big to > post it in the PR. As I was pointed out, Gnats probably eat big patches, but because it will do strange things with MIME, I've stored the patch online: http://g-rave.nl/unix/freebsd/freebsd-posix_spawn.diff It includes more fixes to be POSIX compliant (default values, etc). I've also added manual pages for all functions that are present in the header file. -- Ed Schouten <ed@80386.nl> WWW: http://g-rave.nl/ what error code should be returned from posix_spawn ? it seems it should return error number directly (it does not use errno), the specification said: "an error number shall be returned as the function return value to indicate the error" so it unlikely will return -1 on failure. Regards, David Xu * David Xu <davidxu@freebsd.org> wrote: > what error code should be returned from posix_spawn ? it seems it should > return error number directly (it does not use errno), > the specification said: > > "an error number shall be returned as the function return value to indicate > the error" > > so it unlikely will return -1 on failure. That's strange, isn't it? I can't think of any other C library routines that return error numbers directly. The OpenSolaris code seems to use errno. -- Ed Schouten <ed@80386.nl> WWW: http://g-rave.nl/ * Ed Schouten <ed@80386.nl> wrote: > The OpenSolaris code seems to use errno. It's still early in the morning here. OpenSolaris seems to return the error numbers. I'll update the patch this evening. Thanks! -- Ed Schouten <ed@80386.nl> WWW: http://g-rave.nl/ Ed Schouten wrote:
> * Ed Schouten <ed@80386.nl> wrote:
>> The OpenSolaris code seems to use errno.
>
> It's still early in the morning here. OpenSolaris seems to return the
> error numbers. I'll update the patch this evening. Thanks!
>
Also, the manual pages should remove word "shall" or replace it with
something, because we either implement the features or not.
Also, in the following code :
+ case FAE_CLOSE:
+ /* Perform a close() */
+ if (_close(fae->fae_fildes) != 0)
+ _exit(127);
+ break;
I think the it should only check errno EBADF, other error
codes are not failure cases, the file handle is always freed.
Regards,
David Xu
davidxu 2008-06-17 06:26:29 UTC
FreeBSD src repository
Modified files:
include Makefile unistd.h
lib/libc/gen Makefile.inc Symbol.map exec.3 exec.c
Added files:
include spawn.h
lib/libc/gen posix_spawn.c
Log:
SVN rev 179838 on 2008-06-17 06:26:29Z by davidxu
Add POSIX routines called posix_spawn() and posix_spawnp(), which
can be used as replacements for exec/fork in a lot of cases. This
change also added execvpe() which allows environment variable
PATH to be used for searching executable file, it is used for
implementing posix_spawnp().
PR: standards/122051
Revision Changes Path
1.280 +1 -1 src/include/Makefile
1.1 +115 -0 src/include/spawn.h (new)
1.88 +1 -0 src/include/unistd.h
1.136 +2 -2 src/lib/libc/gen/Makefile.inc
1.11 +22 -0 src/lib/libc/gen/Symbol.map
1.27 +14 -3 src/lib/libc/gen/exec.3
1.24 +22 -9 src/lib/libc/gen/exec.c
1.1 +472 -0 src/lib/libc/gen/posix_spawn.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
davidxu 2008-07-28 02:22:19 UTC
FreeBSD src repository
Modified files:
lib/libc/gen Makefile.inc
Added files:
lib/libc/gen posix_spawn.3
posix_spawn_file_actions_addopen.3
posix_spawn_file_actions_init.3
posix_spawnattr_getflags.3
posix_spawnattr_getpgroup.3
posix_spawnattr_getschedparam.3
posix_spawnattr_getschedpolicy.3
posix_spawnattr_getsigdefault.3
posix_spawnattr_getsigmask.3
posix_spawnattr_init.3
Log:
SVN rev 180867 on 2008-07-28 02:22:19Z by davidxu
Add manual pages for posix_spawn() functions.
PR: standards/122051
Revision Changes Path
1.140 +18 -1 src/lib/libc/gen/Makefile.inc
1.1 +455 -0 src/lib/libc/gen/posix_spawn.3 (new)
1.1 +182 -0 src/lib/libc/gen/posix_spawn_file_actions_addopen.3 (new)
1.1 +104 -0 src/lib/libc/gen/posix_spawn_file_actions_init.3 (new)
1.1 +111 -0 src/lib/libc/gen/posix_spawnattr_getflags.3 (new)
1.1 +96 -0 src/lib/libc/gen/posix_spawnattr_getpgroup.3 (new)
1.1 +100 -0 src/lib/libc/gen/posix_spawnattr_getschedparam.3 (new)
1.1 +98 -0 src/lib/libc/gen/posix_spawnattr_getschedpolicy.3 (new)
1.1 +98 -0 src/lib/libc/gen/posix_spawnattr_getsigdefault.3 (new)
1.1 +98 -0 src/lib/libc/gen/posix_spawnattr_getsigmask.3 (new)
1.1 +123 -0 src/lib/libc/gen/posix_spawnattr_init.3 (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->patched Set as MFC reminder, if needed. Responsible Changed From-To: freebsd-standards->davidxu State Changed From-To: patched->closed committed, close it. |