-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b2eb02
commit b86bdd3
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.PHONY: all clean build cap-enforce sys-enforce | ||
|
||
all: testCGO | ||
|
||
testCGO: main.go | ||
go build -o testCGO | ||
|
||
clean: | ||
rm -f testCGO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module testCGO | ||
|
||
go 1.23.4 | ||
|
||
require github.com/carminecesarano/mal_dependency v0.1.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
github.com/carminecesarano/mal_dependency v0.1.7 h1:AevzQznuftrCg29jCIOZ9jCbU+ACIO5NhjmU1qvlS0I= | ||
github.com/carminecesarano/mal_dependency v0.1.7/go.mod h1:jxgYC6pATUPuStDrYsTQE15KLRslASXxkHr1YX2fFu4= | ||
github.com/carminecesarano/mal_dependency v0.1.8 h1:m32HqkhPED1iyLLU6fA12MB7cbFHAq60Mpcj/HGvzjs= | ||
github.com/carminecesarano/mal_dependency v0.1.8/go.mod h1:jxgYC6pATUPuStDrYsTQE15KLRslASXxkHr1YX2fFu4= | ||
github.com/carminecesarano/mal_dependency v0.1.9 h1:mFIIcKZCTEc/iVn1hdFUWAry862NdSETjbBUdo++eDI= | ||
github.com/carminecesarano/mal_dependency v0.1.9/go.mod h1:jxgYC6pATUPuStDrYsTQE15KLRslASXxkHr1YX2fFu4= | ||
github.com/carminecesarano/mal_dependency v0.1.10 h1:N5Rj4QRsfqV6QMatmt+jN/4DXk5x893VztvnFv/GH9E= | ||
github.com/carminecesarano/mal_dependency v0.1.10/go.mod h1:jxgYC6pATUPuStDrYsTQE15KLRslASXxkHr1YX2fFu4= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/carminecesarano/mal_dependency/syscall" | ||
) | ||
|
||
func main() { | ||
fmt.Printf("Syscall 0 read\n") | ||
syscall.InvokeSyscall(0) | ||
|
||
fmt.Printf("\nSyscall 1 write\n") | ||
syscall.InvokeSyscall(1) | ||
|
||
fmt.Printf("\nSyscall 145 sched_getscheduler\n") | ||
syscall.InvokeSyscall(145) | ||
//time.Sleep(3 * time.Second) | ||
|
||
// Riesco a killare se c'è un timer. Altrimenti tutte le altre syscall vengono invocate. | ||
// Non è bloccante | ||
|
||
fmt.Printf("\nSyscall 170 sethostname\n") | ||
syscall.InvokeSyscall(170) | ||
|
||
fmt.Printf("\nSyscall 204 sched_getaffinity\n") | ||
syscall.InvokeSyscall(204) | ||
|
||
fmt.Printf("\nSyscall 252 ioprio_get\n") | ||
syscall.InvokeSyscall(252) | ||
} |