From a7d97aace0b03bedead413ec782269d62e032341 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 16 Mar 2020 20:40:48 +0000 Subject: [PATCH] unix: add disk ioctl constants for FreeBSD These ioctls make it possible to obtain information on the geometry of disk devices, such as their sector size and total size in bytes. Change-Id: I16449fb1a68b84d266b3fdfda9905cb448676968 GitHub-Last-Rev: 3742e7aec276ffa263fc2dfd6cb3724bb9eda1c0 GitHub-Pull-Request: golang/sys#61 Reviewed-on: https://go-review.googlesource.com/c/sys/+/223537 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- unix/mkerrors.sh | 2 ++ unix/zerrors_freebsd_386.go | 16 ++++++++++++++++ unix/zerrors_freebsd_amd64.go | 16 ++++++++++++++++ unix/zerrors_freebsd_arm.go | 16 ++++++++++++++++ unix/zerrors_freebsd_arm64.go | 16 ++++++++++++++++ 5 files changed, 66 insertions(+) diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh index c5d0c068..bc076cf6 100755 --- a/unix/mkerrors.sh +++ b/unix/mkerrors.sh @@ -105,6 +105,7 @@ includes_FreeBSD=' #include #include #include +#include #include #include #include @@ -493,6 +494,7 @@ ccflags="$@" $2 !~ "RTF_BITS" && $2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ || $2 ~ /^BIOC/ || + $2 ~ /^DIOC/ || $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || diff --git a/unix/zerrors_freebsd_386.go b/unix/zerrors_freebsd_386.go index b72544fc..ff274623 100644 --- a/unix/zerrors_freebsd_386.go +++ b/unix/zerrors_freebsd_386.go @@ -355,6 +355,22 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 + DIOCGATTR = 0xc144648e + DIOCGDELETE = 0x80106488 + DIOCGFLUSH = 0x20006487 + DIOCGFRONTSTUFF = 0x40086486 + DIOCGFWHEADS = 0x40046483 + DIOCGFWSECTORS = 0x40046482 + DIOCGIDENT = 0x41006489 + DIOCGMEDIASIZE = 0x40086481 + DIOCGPHYSPATH = 0x4400648d + DIOCGPROVIDERNAME = 0x4400648a + DIOCGSECTORSIZE = 0x40046480 + DIOCGSTRIPEOFFSET = 0x4008648c + DIOCGSTRIPESIZE = 0x4008648b + DIOCSKERNELDUMP = 0x804c6490 + DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 + DIOCZONECMD = 0xc06c648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 diff --git a/unix/zerrors_freebsd_amd64.go b/unix/zerrors_freebsd_amd64.go index 9f382678..70debb1d 100644 --- a/unix/zerrors_freebsd_amd64.go +++ b/unix/zerrors_freebsd_amd64.go @@ -355,6 +355,22 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 + DIOCGATTR = 0xc148648e + DIOCGDELETE = 0x80106488 + DIOCGFLUSH = 0x20006487 + DIOCGFRONTSTUFF = 0x40086486 + DIOCGFWHEADS = 0x40046483 + DIOCGFWSECTORS = 0x40046482 + DIOCGIDENT = 0x41006489 + DIOCGMEDIASIZE = 0x40086481 + DIOCGPHYSPATH = 0x4400648d + DIOCGPROVIDERNAME = 0x4400648a + DIOCGSECTORSIZE = 0x40046480 + DIOCGSTRIPEOFFSET = 0x4008648c + DIOCGSTRIPESIZE = 0x4008648b + DIOCSKERNELDUMP = 0x80506490 + DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 + DIOCZONECMD = 0xc080648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 diff --git a/unix/zerrors_freebsd_arm.go b/unix/zerrors_freebsd_arm.go index 16db56ab..e4719873 100644 --- a/unix/zerrors_freebsd_arm.go +++ b/unix/zerrors_freebsd_arm.go @@ -355,6 +355,22 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 + DIOCGATTR = 0xc144648e + DIOCGDELETE = 0x80106488 + DIOCGFLUSH = 0x20006487 + DIOCGFRONTSTUFF = 0x40086486 + DIOCGFWHEADS = 0x40046483 + DIOCGFWSECTORS = 0x40046482 + DIOCGIDENT = 0x41006489 + DIOCGMEDIASIZE = 0x40086481 + DIOCGPHYSPATH = 0x4400648d + DIOCGPROVIDERNAME = 0x4400648a + DIOCGSECTORSIZE = 0x40046480 + DIOCGSTRIPEOFFSET = 0x4008648c + DIOCGSTRIPESIZE = 0x4008648b + DIOCSKERNELDUMP = 0x804c6490 + DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 + DIOCZONECMD = 0xc06c648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 diff --git a/unix/zerrors_freebsd_arm64.go b/unix/zerrors_freebsd_arm64.go index 1a1de345..0b855177 100644 --- a/unix/zerrors_freebsd_arm64.go +++ b/unix/zerrors_freebsd_arm64.go @@ -355,6 +355,22 @@ const ( CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 + DIOCGATTR = 0xc148648e + DIOCGDELETE = 0x80106488 + DIOCGFLUSH = 0x20006487 + DIOCGFRONTSTUFF = 0x40086486 + DIOCGFWHEADS = 0x40046483 + DIOCGFWSECTORS = 0x40046482 + DIOCGIDENT = 0x41006489 + DIOCGMEDIASIZE = 0x40086481 + DIOCGPHYSPATH = 0x4400648d + DIOCGPROVIDERNAME = 0x4400648a + DIOCGSECTORSIZE = 0x40046480 + DIOCGSTRIPEOFFSET = 0x4008648c + DIOCGSTRIPESIZE = 0x4008648b + DIOCSKERNELDUMP = 0x80506490 + DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 + DIOCZONECMD = 0xc080648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78