Skip to content

Commit 9eef40a

Browse files
fd0bradfitz
authored andcommitted
unix: Add FADV_* constants
These constants are used for fadvise() on Linux and were missing from the ztypes_linux_*.go files. Including the bluetooth headers is necessary so that cgo can resolve struct sockaddr_hci. Fixes golang/go#15114 Change-Id: I1538b5a7b9b24f910c0520d446b2fa5bd8a09013 Reviewed-on: https://go-review.googlesource.com/21753 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent a80ff22 commit 9eef40a

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

unix/types_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ package unix
5555
#include <unistd.h>
5656
#include <ustat.h>
5757
#include <utime.h>
58+
#include <bluetooth/bluetooth.h>
59+
#include <bluetooth/hci.h>
5860
5961
#ifdef TCSETS2
6062
// On systems that have "struct termios2" use this as type Termios.

unix/ztypes_linux_386.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ type Flock_t struct {
151151
Pid int32
152152
}
153153

154+
const (
155+
FADV_NORMAL = 0x0
156+
FADV_RANDOM = 0x1
157+
FADV_SEQUENTIAL = 0x2
158+
FADV_WILLNEED = 0x3
159+
FADV_DONTNEED = 0x4
160+
FADV_NOREUSE = 0x5
161+
)
162+
154163
type RawSockaddrInet4 struct {
155164
Family uint16
156165
Port uint16

unix/ztypes_linux_amd64.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ type Flock_t struct {
153153
Pad_cgo_1 [4]byte
154154
}
155155

156+
const (
157+
FADV_NORMAL = 0x0
158+
FADV_RANDOM = 0x1
159+
FADV_SEQUENTIAL = 0x2
160+
FADV_WILLNEED = 0x3
161+
FADV_DONTNEED = 0x4
162+
FADV_NOREUSE = 0x5
163+
)
164+
156165
type RawSockaddrInet4 struct {
157166
Family uint16
158167
Port uint16

0 commit comments

Comments
 (0)