Skip to content

Commit 63efc66

Browse files
committed
unix: add IoctlLoopConfigure on linux
LOOP_CONFIGURE ioctl is used to setup and configure all loop device parameters in a single step.
1 parent 1bfbee0 commit 63efc66

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

unix/ioctl_linux.go

+5
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,8 @@ func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) {
231231
func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
232232
return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value))
233233
}
234+
235+
// IoctlLoopConfigure configures all loop device parameters in a single step
236+
func IoctlLoopConfigure(fd int, value *LoopConfig) error {
237+
return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value))
238+
}

unix/linux/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -3001,6 +3001,7 @@ const (
30013001

30023002
type LoopInfo C.struct_loop_info
30033003
type LoopInfo64 C.struct_loop_info64
3004+
type LoopConfig C.struct_loop_config
30043005

30053006
// AF_TIPC
30063007

unix/mkerrors.sh

+1
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ ccflags="$@"
519519
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
520520
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
521521
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
522+
$2 == "LOOP_CONFIGURE" ||
522523
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
523524
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
524525
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||

unix/zerrors_linux.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux.go

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)