This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/PING] include sys/types.h before sys/prctl.h (for mips-irix).


A friendly request for a small patch posted about 3 weeks ago...
Thank you!

On Tue, Nov 23, 2010 at 08:54:18AM -0800, Joel Brobecker wrote:
> On mips-irix, sys/prctl.h depends on various types such as ptid_t being
> declared.  Otherwise, the build fails as follow:
> 
>     /usr/include/sys/prctl.h:45:9: error: expected specifier-qualifier-list before 'pid_t'
>     /usr/include/sys/prctl.h:91:17: error: expected specifier-qualifier-list before 'uint32_t'
>     [...]


libiberty/ChangeLog:

        * setproctitle.c: If <sys/types.h> exists, include it before including
        <sys/prctl.h>.

Tested on x86_64-linux, where both HAVE_SYS_PRCTL_H and HAVE_SYS_TYPES_H
are defined (I used the gdb-testsuite).  OK to commit?

Thanks,
-- 
Joel

---
 libiberty/setproctitle.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libiberty/setproctitle.c b/libiberty/setproctitle.c
index ceb0a38..dfcf000 100644
--- a/libiberty/setproctitle.c
+++ b/libiberty/setproctitle.c
@@ -21,6 +21,9 @@ Boston, MA 02110-1301, USA.  */
 #include "config.h"
 #endif
 #ifdef HAVE_SYS_PRCTL_H
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #include <sys/prctl.h>
 #endif
 #include "ansidecl.h"

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]