fix: remove cgo deps for ioctl (#22701)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2025-06-07 08:42:14 +08:00
committed by GitHub
co-authored by Qiu Jian
parent b677cef407
commit ae09aa3c82
2 changed files with 3 additions and 6 deletions
-3
View File
@@ -84,9 +84,6 @@ vet:
# cmd/esxi-agent: prepare_dir
# CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
cmd/host: prepare_dir
CGO_ENABLED=1 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
cmd/%: prepare_dir
CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
+3 -3
View File
@@ -17,7 +17,7 @@ package ioctl
/*
#include <linux/loop.h>
*/
import "C"
//import "C"
import (
"fmt"
"os"
@@ -38,9 +38,9 @@ import (
const (
LOOP_CTL_PATH = "/dev/loop-control"
LOOP_CTL_REMOVE = C.LOOP_CTL_REMOVE
LOOP_CTL_REMOVE = 0x4c81 // 19585 C.LOOP_CTL_REMOVE
// LOOP_CTL_GET_FREE = C.LOOP_CTL_GET_FREE
LOOP_CTL_ADD = C.LOOP_CTL_ADD
LOOP_CTL_ADD = 0x4c80 // 19584 C.LOOP_CTL_ADD
)
func AddDevice(devNumber int) (string, error) {