loader.go 848 字节
Newer Older
1 2 3 4 5 6 7 8 9 10
// +build linux

package nsenter

/*
#cgo LDFLAGS: -ldl

#include <stdio.h>
#include <stdlib.h>

11 12 13 14 15 16
extern void *fptr_pal_get_version;
extern void *fptr_pal_init;
extern void *fptr_pal_exec;
extern void *fptr_pal_kill;
extern void *fptr_pal_destroy;
extern void *fptr_pal_create_process;
17 18 19 20 21 22 23 24
*/
import "C"

import (
	"unsafe"
)

func SymAddrPalVersion() unsafe.Pointer {
25
	return unsafe.Pointer(C.fptr_pal_get_version)
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
}

func SymAddrPalInit() unsafe.Pointer {
	return unsafe.Pointer(C.fptr_pal_init)
}

func SymAddrPalExec() unsafe.Pointer {
	return unsafe.Pointer(C.fptr_pal_exec)
}

func SymAddrPalKill() unsafe.Pointer {
	return unsafe.Pointer(C.fptr_pal_kill)
}

func SymAddrPalDestroy() unsafe.Pointer {
	return unsafe.Pointer(C.fptr_pal_destroy)
}
43 44 45 46

func SymAddrPalCreateProcess() unsafe.Pointer {
	return unsafe.Pointer(C.fptr_pal_create_process)
}