plan9port/src/lib9/priv.c
Dan Cross fa325e9b42 Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-10 14:54:30 +00:00

32 lines
376 B
C

#include <u.h>
#include <libc.h>
#include "9proc.h"
static Lock privlock;
static ulong privmap;
int
privalloc(void)
{
int i;
lock(&privlock);
for(i=0; i<NPRIV; i++)
if((privmap&(1<<i)) == 0){
privmap |= (1<<i);
unlock(&privlock);
return i;
}
unlock(&privlock);
return -1;
}
void**
privmem(int i)
{
Uproc *up;
up = _p9uproc(0);
return &up->priv[i];
}