go.sys/unix: add support for *xattr functions on FreeBSD

Add wrappers that provide Linux-y behavior around the FreeBSD extattr(2)
functions. This allows certain packages, like the fuse package to run
under FreeBSD.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/147850043
This commit is contained in:
William Orr
2014-10-08 07:29:25 -07:00
committed by Ian Lance Taylor
parent 7f1554891e
commit ac22431096
5 changed files with 941 additions and 0 deletions
+4
View File
@@ -74,6 +74,7 @@ includes_FreeBSD='
#include <termios.h>
#include <netinet/ip.h>
#include <netinet/ip_mroute.h>
#include <sys/extattr.h>
#if __FreeBSD__ >= 10
#define IFT_CARP 0xf8 // IFT_CARP is deprecated in FreeBSD 10
@@ -244,6 +245,9 @@ ccflags="$@"
$2 ~ /^(SCM_SRCRT)$/ {next}
$2 ~ /^(MAP_FAILED)$/ {next}
$2 ~ /^EXTATTR_NAMESPACE_NAMES/ ||
$2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next}
$2 !~ /^ETH_/ &&
$2 !~ /^EPROC_/ &&
$2 !~ /^EQUIV_/ &&