ref: 7975eec3e602fd5bc3e93c78f4166259190f2fe9
dir: /emu/port/file.c/
#include "dat.h"
#include "fns.h"
#include "error.h"
int
openmode(ulong o)
{
if(o >= (OTRUNC|OCEXEC|ORCLOSE|OEXEC))
error(Ebadarg);
o &= ~(OTRUNC|OCEXEC|ORCLOSE);
if(o > OEXEC)
error(Ebadarg);
if(o == OEXEC)
return OREAD;
return o;
}