代码之家  ›  专栏  ›  技术社区  ›  David Citron

Solaris pstack输出:“SYS#0”是什么意思?

  •  2
  • David Citron  · 技术社区  · 16 年前

    ff309858 SYS#0    ()
    ff309848 void MyHashMap<const void*,unsigned,AlignedMmapInstance<65536U>::SourceHeap>::set(const void*,unsigned) (ff31eed4, 9bf20000, 10000, 40, 9bf1fff0, ff31e738) + 134
    ...
    

    /8:   flags = PR_STOPPED|PR_ISTOP|PR_ASLEEP
    why = PR_REQUESTED
    sigmask = 0xfffffeff,0x00003fff
    

    编辑:

    编辑:

    编辑: 公认的答案是正确的。此外,至少在SPARC上 g1 注册 should contain 系统调用号,但在我们的核心文件中似乎并非如此。

    1 回复  |  直到 13 年前
        1
  •  2
  •   Martin Carpenter    16 年前

    试试这个:

    $ cat foo.c
    #include <stdio.h>
    
    int main(int argc, char *argv[]) {
    
        char buf[1024];
        proc_sysname(0, buf, 1024);
        printf("%s\n", buf);
    
    }
    $ gcc -ofoo -lproc foo.c
    $ ./foo
    SYS#0
    $
    

    SYS#0 <sys/syscall.h> (系统调用表)您将找到以下内容:

    /* syscall enumeration MUST begin with 1 */
    
    /*
     * SunOS/SPARC uses 0 for the indirect system call SYS_syscall
     * but this doesn't count because it is just another way
     * to specify the real system call number.
     */
    
    #define SYS_syscall 0
    

    syscall(SYS_syscall, foo, bar, ...) 相当于直接通话 syscall(foo, bar, ...) .