Add BADFD constant to permit compilation on darwin
diff --git a/const_darwin.go b/const_darwin.go
new file mode 100644
index 0000000..19c169a
--- /dev/null
+++ b/const_darwin.go
@@ -0,0 +1,21 @@
+// Copyright © 2016 Steve Francia <spf@spf13.com>.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// +build darwin
+
+package afero
+
+import (
+	"syscall"
+)
+
+const BADFD = syscall.EBADF
diff --git a/const_win_unix.go b/const_win_unix.go
new file mode 100644
index 0000000..3d246ef
--- /dev/null
+++ b/const_win_unix.go
@@ -0,0 +1,21 @@
+// Copyright © 2016 Steve Francia <spf@spf13.com>.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// +build !darwin
+
+package afero
+
+import (
+	"syscall"
+)
+
+const BADFD = syscall.EBADFD
diff --git a/union.go b/union.go
index bd6cff4..828cf0c 100644
--- a/union.go
+++ b/union.go
@@ -94,7 +94,7 @@
 	if f.layer != nil {
 		return f.layer.Close()
 	}
-	return syscall.EBADFD
+	return BADFD
 }
 
 func (f *UnionFile) Read(s []byte) (int, error) {
@@ -114,7 +114,7 @@
 	if f.base != nil {
 		return f.base.Read(s)
 	}
-	return 0, syscall.EBADFD
+	return 0, BADFD
 }
 
 func (f *UnionFile) ReadAt(s []byte, o int64) (int, error) {
@@ -128,7 +128,7 @@
 	if f.base != nil {
 		return f.base.ReadAt(s, o)
 	}
-	return 0, syscall.EBADFD
+	return 0, BADFD
 }
 
 func (f *UnionFile) Seek(o int64, w int) (pos int64, err error) {
@@ -142,7 +142,7 @@
 	if f.base != nil {
 		return f.base.Seek(o, w)
 	}
-	return 0, syscall.EBADFD
+	return 0, BADFD
 }
 
 func (f *UnionFile) Write(s []byte) (n int, err error) {
@@ -156,7 +156,7 @@
 	if f.base != nil {
 		return f.base.Write(s)
 	}
-	return 0, syscall.EBADFD
+	return 0, BADFD
 }
 
 func (f *UnionFile) WriteAt(s []byte, o int64) (n int, err error) {
@@ -170,7 +170,7 @@
 	if f.base != nil {
 		return f.base.WriteAt(s, o)
 	}
-	return 0, syscall.EBADFD
+	return 0, BADFD
 }
 
 func (f *UnionFile) Name() string {
@@ -234,7 +234,7 @@
 	if f.base != nil {
 		return f.base.Stat()
 	}
-	return nil, syscall.EBADFD
+	return nil, BADFD
 }
 
 func (f *UnionFile) Sync() (err error) {
@@ -248,7 +248,7 @@
 	if f.base != nil {
 		return f.base.Sync()
 	}
-	return syscall.EBADFD
+	return BADFD
 }
 
 func (f *UnionFile) Truncate(s int64) (err error) {
@@ -262,7 +262,7 @@
 	if f.base != nil {
 		return f.base.Truncate(s)
 	}
-	return syscall.EBADFD
+	return BADFD
 }
 
 func (f *UnionFile) WriteString(s string) (n int, err error) {
@@ -276,5 +276,5 @@
 	if f.base != nil {
 		return f.base.WriteString(s)
 	}
-	return 0, syscall.EBADFD
+	return 0, BADFD
 }