Newer
Older
ubixos / src / lib / libc / sys / getpid.c
@reddawg reddawg on 28 May 2002 569 bytes Its Been lots of work
/**************************************************************************************
 Copyright (c) 2002 The UbixOS Project
 All rights reserved.

 Redistribution and use in source and binary forms, with or without modification,
 are prohibited.

 $Id$

**************************************************************************************/

#include <sys/types.h>

uShort getpid(void) {
  int pid = -1;
  uShort *pidPtr;
  pidPtr = pid;
  asm(
//    "movl %2,%%ebx \n"
    "int %0        \n"
    :
    : "i" (0x80),"a" (1),"b" (pidPtr)
    );
  return(pidPtr);
  }