diff --git a/.gitignore b/.gitignore
index 57b96b8..d8b3265 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,9 +18,6 @@ _cgo_defun.c
 _cgo_gotypes.go
 _cgo_export.*
 
-# Dependencies
-go.sum
-
 _testmain.go
 
 *.exe
diff --git a/.travis.sh b/.travis.sh
index fc86c4b..4241b61 100755
--- a/.travis.sh
+++ b/.travis.sh
@@ -9,6 +9,9 @@ GOOS=darwin  go build
 echo "Building for FreeBSD..."
 GOOS=freebsd go build
 
+echo "Building for Windows...(dummy)"
+GOOS=windows go build
+
 echo "Running tests..."
 go vet
 go test -v -race -coverprofile=coverage.txt -covermode=atomic
diff --git a/.travis.yml b/.travis.yml
index 4a8c966..0223e21 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,11 +2,12 @@ language: go
 sudo: false
 
 go:
-  - "1.11"
+  - "1.11.x"
 
 os:
   - linux
   - osx
+  - windows
 
 before_install:
   - go version
@@ -18,7 +19,8 @@ install:
 
 script:
   - ./.travis.sh
-  - diff <(goimports -d .) <(printf "")
+  # goimports on windows gives false positives
+  - if [[ "${TRAVIS_OS_NAME}" != "windows" ]]; then diff <(goimports -d .) <(printf ""); fi
 
 after_success:
   - bash <(curl -s https://codecov.io/bash)
diff --git a/README.md b/README.md
index a5c46bb..21b4db9 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,11 @@
 
 xattr
 =====
-Extended attribute support for Go (linux + darwin + freebsd).
+Extended attribute support for Go (linux + darwin + freebsd + netbsd).
 
 "Extended attributes are name:value pairs associated permanently with files and directories, similar to the environment strings associated with a process. An attribute may be defined or undefined. If it is defined, its value may be empty or non-empty." [See more...](https://en.wikipedia.org/wiki/Extended_file_attributes)
 
-`SetWithFlags` allows to additionally pass system flags to be forwarded to the underlying calls, FreeBSD does not support this and the parameter will be ignored.
+`SetWithFlags` allows to additionally pass system flags to be forwarded to the underlying calls. FreeBSD and NetBSD do not support this and the parameter will be ignored.
 
 The `L` variants of all functions (`LGet/LSet/...`) are identical to `Get/Set/...` except that they
 do not reference a symlink that appears at the end of a path. See
diff --git a/debian/changelog b/debian/changelog
index c06bd9c..4999cf3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-pkg-xattr (0.4.1+git20190326.f2ae4ae-1) UNRELEASED; urgency=medium
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sun, 23 Jun 2019 04:51:15 +0000
+
 golang-github-pkg-xattr (0.4.0-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..e9aa1d9
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,2 @@
+golang.org/x/sys v0.0.0-20181021155630-eda9bb28ed51 h1:GNXpDwiINQORfoRpKYZBUNeIGY4giY2DonS5etRdlnE=
+golang.org/x/sys v0.0.0-20181021155630-eda9bb28ed51/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
diff --git a/xattr_freebsd.go b/xattr_bsd.go
similarity index 99%
rename from xattr_freebsd.go
rename to xattr_bsd.go
index f4dbadf..09db849 100644
--- a/xattr_freebsd.go
+++ b/xattr_bsd.go
@@ -1,4 +1,4 @@
-// +build freebsd
+// +build freebsd netbsd
 
 package xattr
 
diff --git a/xattr_darwin.go b/xattr_darwin.go
index ba087ad..8bb8cd9 100644
--- a/xattr_darwin.go
+++ b/xattr_darwin.go
@@ -5,7 +5,6 @@ package xattr
 import (
 	"os"
 	"syscall"
-	"unsafe"
 
 	"golang.org/x/sys/unix"
 )
@@ -30,23 +29,7 @@ func getxattr(path string, name string, data []byte) (int, error) {
 }
 
 func lgetxattr(path string, name string, data []byte) (int, error) {
-	value, size := bytePtrFromSlice(data)
-	/*
-		ssize_t getxattr(
-			const char *path,
-			const char *name,
-			void *value,
-			size_t size,
-			u_int32_t position,
-			int options
-		)
-	*/
-	r0, _, err := syscall.Syscall6(syscall.SYS_GETXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))),
-		uintptr(unsafe.Pointer(syscall.StringBytePtr(name))), uintptr(unsafe.Pointer(value)), uintptr(size), 0, XATTR_NOFOLLOW)
-	if err != syscall.Errno(0) {
-		return int(r0), err
-	}
-	return int(r0), nil
+	return unix.Lgetxattr(path, name, data)
 }
 
 func fgetxattr(f *os.File, name string, data []byte) (int, error) {
@@ -58,7 +41,7 @@ func setxattr(path string, name string, data []byte, flags int) error {
 }
 
 func lsetxattr(path string, name string, data []byte, flags int) error {
-	return unix.Setxattr(path, name, data, flags|XATTR_NOFOLLOW)
+	return unix.Lsetxattr(path, name, data, flags)
 }
 
 func fsetxattr(f *os.File, name string, data []byte, flags int) error {
@@ -70,19 +53,7 @@ func removexattr(path string, name string) error {
 }
 
 func lremovexattr(path string, name string) error {
-	/*
-		int removexattr(
-			const char *path,
-			const char *name,
-			int options
-		);
-	*/
-	_, _, err := syscall.Syscall(syscall.SYS_REMOVEXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))),
-		uintptr(unsafe.Pointer(syscall.StringBytePtr(name))), XATTR_NOFOLLOW)
-	if err != syscall.Errno(0) {
-		return err
-	}
-	return nil
+	return unix.Lremovexattr(path, name)
 }
 
 func fremovexattr(f *os.File, name string) error {
@@ -94,21 +65,7 @@ func listxattr(path string, data []byte) (int, error) {
 }
 
 func llistxattr(path string, data []byte) (int, error) {
-	name, size := bytePtrFromSlice(data)
-	/*
-		ssize_t listxattr(
-			const char *path,
-			char *name,
-			size_t size,
-			int options
-		);
-	*/
-	r0, _, err := syscall.Syscall6(syscall.SYS_LISTXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))),
-		uintptr(unsafe.Pointer(name)), uintptr(size), XATTR_NOFOLLOW, 0, 0)
-	if err != syscall.Errno(0) {
-		return int(r0), err
-	}
-	return int(r0), nil
+	return unix.Llistxattr(path, data)
 }
 
 func flistxattr(f *os.File, data []byte) (int, error) {
diff --git a/xattr_test.go b/xattr_test.go
index 177b02c..dfcea78 100644
--- a/xattr_test.go
+++ b/xattr_test.go
@@ -1,4 +1,4 @@
-// +build linux darwin freebsd
+// +build linux darwin freebsd netbsd
 
 package xattr
 
diff --git a/xattr_unsupported.go b/xattr_unsupported.go
new file mode 100644
index 0000000..305aefd
--- /dev/null
+++ b/xattr_unsupported.go
@@ -0,0 +1,60 @@
+// +build !linux,!freebsd,!netbsd,!darwin
+
+package xattr
+
+import (
+	"os"
+)
+
+func getxattr(path string, name string, data []byte) (int, error) {
+	return 0, nil
+}
+
+func lgetxattr(path string, name string, data []byte) (int, error) {
+	return 0, nil
+}
+
+func fgetxattr(f *os.File, name string, data []byte) (int, error) {
+	return 0, nil
+}
+
+func setxattr(path string, name string, data []byte, flags int) error {
+	return nil
+}
+
+func lsetxattr(path string, name string, data []byte, flags int) error {
+	return nil
+}
+
+func fsetxattr(f *os.File, name string, data []byte, flags int) error {
+	return nil
+}
+
+func removexattr(path string, name string) error {
+	return nil
+}
+
+func lremovexattr(path string, name string) error {
+	return nil
+}
+
+func fremovexattr(f *os.File, name string) error {
+	return nil
+}
+
+func listxattr(path string, data []byte) (int, error) {
+	return 0, nil
+}
+
+func llistxattr(path string, data []byte) (int, error) {
+	return 0, nil
+}
+
+func flistxattr(f *os.File, data []byte) (int, error) {
+	return 0, nil
+}
+
+// dummy
+func stringsFromByteSlice(buf []byte) (result []string) {
+	return []string{}
+}