Commit e3f9388e authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

unix: add Linux blkpg_ioctl_arg and blkpg_partition types

For manipulating Linux partitions with the BLKPG ioctl.

Change-Id: I2196038ccfc39ecd6926817c3b310d0837220095
Reviewed-on: https://go-review.googlesource.com/125642
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 10b189e7
......@@ -73,6 +73,7 @@ package unix
#include <linux/socket.h>
#include <linux/hdreg.h>
#include <linux/rtc.h>
#include <linux/blkpg.h>
// abi/abi.h generated by mkall.go.
#include "abi/abi.h"
......@@ -312,6 +313,15 @@ struct ustat {
char f_fpack[6];
};
// my_blkpg_partition is blkpg_partition with unsigned devname & volname.
struct my_blkpg_partition {
long long start;
long long length;
int pno;
unsigned char devname[BLKPG_DEVNAMELTH];
unsigned char volname[BLKPG_VOLNAMELTH];
};
*/
import "C"
......@@ -1516,3 +1526,16 @@ type RTCTime C.struct_rtc_time
type RTCWkAlrm C.struct_rtc_wkalrm
type RTCPLLInfo C.struct_rtc_pll_info
// BLKPG ioctl:
type BlkpgIoctlArg C.struct_blkpg_ioctl_arg
type BlkpgPartition C.struct_my_blkpg_partition
const (
BLKPG = C.BLKPG
BLKPG_ADD_PARTITION = C.BLKPG_ADD_PARTITION
BLKPG_DEL_PARTITION = C.BLKPG_DEL_PARTITION
BLKPG_RESIZE_PARTITION = C.BLKPG_RESIZE_PARTITION
)
......@@ -1852,3 +1852,25 @@ type RTCPLLInfo struct {
Negmult int32
Clock int32
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
}
const (
BLKPG = 0x1269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1872,3 +1872,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x1269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1841,3 +1841,26 @@ type RTCPLLInfo struct {
Negmult int32
Clock int32
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x1269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1851,3 +1851,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x1269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1846,3 +1846,26 @@ type RTCPLLInfo struct {
Negmult int32
Clock int32
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1853,3 +1853,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1853,3 +1853,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1846,3 +1846,26 @@ type RTCPLLInfo struct {
Negmult int32
Clock int32
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1861,3 +1861,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1861,3 +1861,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
......@@ -1878,3 +1878,27 @@ type RTCPLLInfo struct {
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x1269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment