[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what does regex depend on sys_wait?
From: |
Eric Blake |
Subject: |
Re: what does regex depend on sys_wait? |
Date: |
Tue, 28 Sep 2010 13:42:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4 |
On 09/28/2010 01:33 PM, Bruno Haible wrote:
Eric Blake wrote:
Hmm - this would be the first time that one of our replacement headers
#includes a non-replacement header
I agree that we shouldn't go this route. libunistring installs the gnulib-
created variants of stdint.h and stdbool.h in public locations (under different
names); I think some of Simon's packages do the same.
Thinking more _why_ should<stdlib.h> declare WIFEXITED etc. at all? Most
programs I've seen include<sys/wait.h> for this purpose. The answer is that
<stdlib.h> declares the system() function and WIFEXITED etc. are useful for
analyzing its return code.
So my proposal would be
- Introduce a new module 'system', that provides all a user needs for using
the system() function according to POSIX.
- Make dependencies system -> stdlib
system -> sys_wait
but not stdlib -> sys_wait.
- Change<stdlib.h> so that it #include<sys/wait.h> only when the 'system'
module has been requested.
Also seems like a reasonable solution to me.
New module 'system'.
* modules/system: New file.
* lib/stdlib.in.h: Include<sys/wait.h> only when the 'system' module
is present.
It doesn't hurt to unconditionally include <sys/wait.h> when WEXITSTATUS
is undefined; it's just that we can't guarantee that including
<sys/wait.h> will define WEXITSTATUS unless sys_wait is also in use
(which it will be if the system module is in use).
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_SYSTEM.
* modules/stdlib (Depends-on): Remove sys_wait.
(Makefile.am): Substitute GNULIB_SYSTEM.
* doc/posix-functions/system.texi: Mention the new module.
* doc/posix-headers/stdlib.texi: Likewise.
Reported by Sam Steingold<address@hidden>.
Missing a change to tests/test-stdlib.c to not test the system()-related
macros unless the GNULIB_SYSTEM indicator is set.
+++ lib/stdlib.in.h Tue Sep 28 21:24:54 2010
@@ -39,7 +39,7 @@
#include<stddef.h>
/* MirBSD 10 defines WEXITSTATUS in<sys/wait.h>, not in<stdlib.h>. */
-#ifndef WEXITSTATUS
+#if @GNULIB_SYSTEM@&& !defined WEXITSTATUS
# include<sys/wait.h>
#endif
So I'm not convinced we need this hunk.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
- Re: what does regex depend on sys_wait?, (continued)
- Re: what does regex depend on sys_wait?, Paul Eggert, 2010/09/28
- Re: what does regex depend on sys_wait?, Eric Blake, 2010/09/28
- Re: what does regex depend on sys_wait?, Eric Blake, 2010/09/28
- Re: what does regex depend on sys_wait?, Paul Eggert, 2010/09/28
- Re: what does regex depend on sys_wait?, Eric Blake, 2010/09/28
- Re: what does regex depend on sys_wait?, Bruno Haible, 2010/09/28
- Re: what does regex depend on sys_wait?, Paul Eggert, 2010/09/28
- Re: what does regex depend on sys_wait?, Eric Blake, 2010/09/28
- Re: what does regex depend on sys_wait?, Paul Eggert, 2010/09/28
- Re: what does regex depend on sys_wait?, Bruno Haible, 2010/09/28
- Re: what does regex depend on sys_wait?,
Eric Blake <=
- Re: what does regex depend on sys_wait?, Bruno Haible, 2010/09/28