mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-31 22:36:44 -04:00
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: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user