loopback

package
v1.57.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LoopSetFd       = 0x4C00
	LoopCtlGetFree  = 0x4C82
	LoopGetStatus64 = 0x4C05
	LoopSetStatus64 = 0x4C04
	LoopClrFd       = 0x4C01
	LoopSetCapacity = 0x4C07
)

IOCTL consts

View Source
const (
	LoFlagsAutoClear = 0x4C07
	LoFlagsReadOnly  = 1
	LoFlagsPartScan  = 8
	LoKeySize        = 32
	LoNameSize       = 64
)

LOOP consts.

Variables

View Source
var (
	ErrAttachLoopbackDevice   = errors.New("loopback attach failed")
	ErrGetLoopbackBackingFile = errors.New("Unable to get loopback backing file")
	ErrSetCapacity            = errors.New("Unable set loopback capacity")
)

Loopback related errors

Functions

func AttachLoopDevice

func AttachLoopDevice(sparseName string) (loop *os.File, err error)

AttachLoopDevice attaches the given sparse file to the next available loopback device. It returns an opened *os.File.

func AttachLoopDeviceRO added in v1.51.0

func AttachLoopDeviceRO(sparseName string) (loop *os.File, err error)

AttachLoopDeviceRO attaches the given sparse file opened read-only to the next available loopback device. It returns an opened *os.File.

func FindLoopDeviceFor

func FindLoopDeviceFor(file *os.File) *os.File

FindLoopDeviceFor returns a loopback device file for the specified file which is backing file of a loop back device.

func SetCapacity

func SetCapacity(file *os.File) error

SetCapacity reloads the size for the loopback device.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL