summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/linux/types.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/unix/linux/types.go')
-rw-r--r--vendor/golang.org/x/sys/unix/linux/types.go61
1 files changed, 56 insertions, 5 deletions
diff --git a/vendor/golang.org/x/sys/unix/linux/types.go b/vendor/golang.org/x/sys/unix/linux/types.go
index 929bbbf50..f429c8f78 100644
--- a/vendor/golang.org/x/sys/unix/linux/types.go
+++ b/vendor/golang.org/x/sys/unix/linux/types.go
@@ -47,11 +47,12 @@ package unix
#include <sys/utsname.h>
#include <sys/wait.h>
#include <linux/filter.h>
+#include <linux/icmpv6.h>
#include <linux/keyctl.h>
#include <linux/netlink.h>
#include <linux/perf_event.h>
#include <linux/rtnetlink.h>
-#include <linux/icmpv6.h>
+#include <linux/stat.h>
#include <asm/termbits.h>
#include <asm/ptrace.h>
#include <time.h>
@@ -116,6 +117,21 @@ struct stat {
#endif
+// These are defined in linux/fcntl.h, but including it globally causes
+// conflicts with fcntl.h
+#ifndef AT_STATX_SYNC_TYPE
+# define AT_STATX_SYNC_TYPE 0x6000 // Type of synchronisation required from statx()
+#endif
+#ifndef AT_STATX_SYNC_AS_STAT
+# define AT_STATX_SYNC_AS_STAT 0x0000 // - Do whatever stat() does
+#endif
+#ifndef AT_STATX_FORCE_SYNC
+# define AT_STATX_FORCE_SYNC 0x2000 // - Force the attributes to be sync'd with the server
+#endif
+#ifndef AT_STATX_DONT_SYNC
+# define AT_STATX_DONT_SYNC 0x4000 // - Don't sync attributes with the server
+#endif
+
#ifdef TCSETS2
// On systems that have "struct termios2" use this as type Termios.
typedef struct termios2 termios_t;
@@ -146,7 +162,21 @@ struct sockaddr_hci {
sa_family_t hci_family;
unsigned short hci_dev;
unsigned short hci_channel;
-};;
+};
+
+// copied from /usr/include/bluetooth/bluetooth.h
+#define BDADDR_BREDR 0x00
+#define BDADDR_LE_PUBLIC 0x01
+#define BDADDR_LE_RANDOM 0x02
+
+// copied from /usr/include/bluetooth/l2cap.h
+struct sockaddr_l2 {
+ sa_family_t l2_family;
+ unsigned short l2_psm;
+ uint8_t l2_bdaddr[6];
+ unsigned short l2_cid;
+ uint8_t l2_bdaddr_type;
+};
// copied from /usr/include/linux/un.h
struct my_sockaddr_un {
@@ -249,6 +279,10 @@ type Stat_t C.struct_stat
type Statfs_t C.struct_statfs
+type StatxTimestamp C.struct_statx_timestamp
+
+type Statx_t C.struct_statx
+
type Dirent C.struct_dirent
type Fsid C.fsid_t
@@ -290,6 +324,8 @@ type RawSockaddrNetlink C.struct_sockaddr_nl
type RawSockaddrHCI C.struct_sockaddr_hci
+type RawSockaddrL2 C.struct_sockaddr_l2
+
type RawSockaddrCAN C.struct_sockaddr_can
type RawSockaddrALG C.struct_sockaddr_alg
@@ -338,6 +374,7 @@ const (
SizeofSockaddrLinklayer = C.sizeof_struct_sockaddr_ll
SizeofSockaddrNetlink = C.sizeof_struct_sockaddr_nl
SizeofSockaddrHCI = C.sizeof_struct_sockaddr_hci
+ SizeofSockaddrL2 = C.sizeof_struct_sockaddr_l2
SizeofSockaddrCAN = C.sizeof_struct_sockaddr_can
SizeofSockaddrALG = C.sizeof_struct_sockaddr_alg
SizeofSockaddrVM = C.sizeof_struct_sockaddr_vm
@@ -513,9 +550,15 @@ type Ustat_t C.struct_ustat
type EpollEvent C.struct_my_epoll_event
const (
- AT_FDCWD = C.AT_FDCWD
- AT_NO_AUTOMOUNT = C.AT_NO_AUTOMOUNT
- AT_REMOVEDIR = C.AT_REMOVEDIR
+ AT_EMPTY_PATH = C.AT_EMPTY_PATH
+ AT_FDCWD = C.AT_FDCWD
+ AT_NO_AUTOMOUNT = C.AT_NO_AUTOMOUNT
+ AT_REMOVEDIR = C.AT_REMOVEDIR
+
+ AT_STATX_SYNC_AS_STAT = C.AT_STATX_SYNC_AS_STAT
+ AT_STATX_FORCE_SYNC = C.AT_STATX_FORCE_SYNC
+ AT_STATX_DONT_SYNC = C.AT_STATX_DONT_SYNC
+
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
)
@@ -617,3 +660,11 @@ const (
_CPU_SETSIZE = C.__CPU_SETSIZE
_NCPUBITS = C.__NCPUBITS
)
+
+// Bluetooth
+
+const (
+ BDADDR_BREDR = C.BDADDR_BREDR
+ BDADDR_LE_PUBLIC = C.BDADDR_LE_PUBLIC
+ BDADDR_LE_RANDOM = C.BDADDR_LE_RANDOM
+)