2 Copyright © 2014, The AROS Development Team. All rights reserved.
5 Desc: Special handling for NIL: locks and file handles
9 #include "dos_intern.h"
11 SIPTR
handleNIL(LONG action
, SIPTR arg1
, SIPTR arg2
, SIPTR arg3
)
15 case(ACTION_FINDUPDATE
):
16 case(ACTION_FINDINPUT
):
17 case(ACTION_FINDOUTPUT
):
19 struct FileHandle
* fh
= BADDR(arg1
);
21 fh
->fh_Interactive
= DOSFALSE
;/* NIL: is not considered interactive */
22 return (SIPTR
)MKBADDR(fh
);
24 case(ACTION_INFO
): return (SIPTR
)0;
25 case(ACTION_FREE_LOCK
):
27 FreeMem((APTR
)arg1
, sizeof(struct FileLock
));
30 case(ACTION_COPY_DIR_FH
):
32 struct FileLock
*fl
= AllocMem(sizeof(struct FileLock
), MEMF_PUBLIC
| MEMF_CLEAR
);
33 fl
->fl_Access
= SHARED_LOCK
;
34 return (SIPTR
)MKBADDR(fl
);
36 case(ACTION_FH_FROM_LOCK
):
38 struct FileHandle
* fh
= BADDR(arg2
);
39 fh
->fh_Interactive
= DOSFALSE
;
40 FreeMem((APTR
)arg3
, sizeof(struct FileLock
));
41 return (SIPTR
)DOSTRUE
;
43 case(ACTION_WRITE
): return (SIPTR
)arg3
;
44 case(ACTION_PARENT_FH
): return (SIPTR
)BNULL
;