/ gettid.s (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes

#include <emx/asm386.h>

        .globl  __gettid

        .text

        ALIGN

__gettid:
        cmpb    $0, __osmode            /* _osmode == DOS_MODE? */
        je      1f                      /* Yes -> */
        fs
        movl    12, %eax                /* ptib2 */
        movl    0(%eax), %eax           /* TID */
Lreturn:EPILOGUE(_gettid)

        ALIGN
1:      movl    $1, %eax
        jmp     Lreturn
