Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: grant <[email protected]>
  • Loading branch information
grantseltzer committed Mar 8, 2019
1 parent 925cdac commit 106b660
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net/lookup_darwin_386.s
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
TEXT runtime·res_search_trampoline(SB),NOSPLIT,$0
PUSHL BP
MOVL SP, BP
SUBL $24, SP
MOVL 32(SP), CX
SUBL $24, SP
MOVL 32(SP), CX
MOVL 16(CX), AX // arg 5 anslen
MOVL AX, 16(SP)
MOVL 12(CX), AX // arg 4 answer
Expand Down
32 changes: 32 additions & 0 deletions src/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"fmt"
"os"
"runtime"

"golang.org/x/net/dns/dnsmessage"
)

func main() {

name := []byte(os.Args[1])

var buffer = [512]byte{}
ret := runtime.Res_search(&name[0], 1, 1, &buffer[0], 512)
if ret != 0 {
fmt.Println(ret)
}

bufferSlice := buffer[:]

msg := &dnsmessage.Message{}

err := msg.Unpack(bufferSlice)
if err != nil {
fmt.Println(err)
}

fmt.Println("\n\n\n\n")
fmt.Println(msg.Answers[0].Body)
}

0 comments on commit 106b660

Please sign in to comment.