diff mbox

[4/7] Add unistd.h wrapper for VxWorks.

Message ID 4FCF8748.9030708@verizon.net
State New
Headers show

Commit Message

rbmj June 6, 2012, 4:37 p.m. UTC
On VxWorks, unistd.h doesn't define everything it should, like
read/write, etc.  This wrapper adds the things it should define
so everything can be compliant and compile correctly without
manual modification.

Changes:

     * fixincludes/inclhack.def: Added AAB_vxworks_unistd fix
---
  fixincludes/inclhack.def |   26 ++++++++++++++++++++++++++
  1 files changed, 26 insertions(+), 0 deletions(-)
diff mbox

Patch

From e389d506193e80713b9511713a220867159f5a8e Mon Sep 17 00:00:00 2001
From: rbmj <rbmj@verizon.net>
Date: Mon, 4 Jun 2012 14:02:08 -0400
Subject: [PATCH 4/7] Add unistd.h wrapper for VxWorks.

On VxWorks, unistd.h doesn't define everything it should, like
read/write, etc.  This wrapper adds the things it should define
so everything can be compliant and compile correctly without
manual modification.

Changes:

	* fixincludes/inclhack.def: Added AAB_vxworks_unistd fix
---
 fixincludes/inclhack.def |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index a7e49cd..54a8b8d 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -438,6 +438,32 @@  fix = {
 	_EndOfHeader_;
 };
 
+/*
+ *  This hack makes makes unistd.h more POSIX-compliant on VxWorks
+ */
+fix = {
+	hackname	= AAB_vxworks_unistd;
+	files	   = unistd.h;
+	mach		= "*-*-vxworks*";
+	
+	replace		= <<- _EndOfHeader_
+	#ifndef _UNISTD_H
+	#define _UNISTD_H
+	#include_next <unistd.h>
+	#include <ioLib.h>
+	#ifndef STDIN_FILENO
+	#define STDIN_FILENO 0
+	#endif
+	#ifndef STDOUT_FILENO
+	#define STDOUT_FILENO 1
+	#endif
+	#ifndef STDERR_FILENO
+	#define STDERR_FILENO 2
+	#endif
+	#endif /* _UNISTD_H */
+	_EndOfHeader_;
+};
+
 
 /*
  * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,
-- 
1.7.5.4