Note that there are some explanatory texts on larger screens.

plurals
  1. PODetails of Syscall.RawSyscall() & Syscall.Syscall() in Go?
    primarykey
    data
    text
    <p>I'm reading source code in package <code>syscall</code> now, and met some problems:</p> <p>Since I'm totally a noob of <code>syscall</code> and <code>assembly</code>, so don't hesitate to share anything you know about it :)</p> <p>First about func <code>RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)</code> : what does its parameter <code>trap, a1, a2, a3</code> &amp; return value <code>r1 r2</code> means? I've searched documents and site but seems lack of description about this.</p> <p>Second, since I'm using <code>darwin/amd64</code> I searched source code and find it here: <a href="http://golang.org/src/pkg/syscall/asm_darwin_amd64.s?h=RawSyscall" rel="nofollow">http://golang.org/src/pkg/syscall/asm_darwin_amd64.s?h=RawSyscall</a></p> <p>Seems it's written by assemble(which I can't understand), can you explain what happened in line 61-80, and what's the meaning of <code>ok1:</code> part under line 76?</p> <p>I also found some code in <a href="http://golang.org/src/pkg/syscall/zsyscall_darwin_amd64.go" rel="nofollow">http://golang.org/src/pkg/syscall/zsyscall_darwin_amd64.go</a> , what does <code>zsyscall</code> mean in its filename? </p> <p>What's the difference between <code>syscall</code> &amp; <code>rawsyscall</code>? </p> <p>How and when to use them if I want to write my own syscall function(Yes, os package gave many choices but there are still some situation it doesn't cover)?</p> <p>So many noob questions, thanks for your patience to read and answer :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload