blob: 91000ebb3c103c3389b6c0c91cd68927c0072546 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#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;
}
|