5 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
8 Desc: file descriptors handling internals - header file
14 /* file control block - one per file handle */
17 BPTR handle
;// if privflags has flag _FCB_ISDIR: BCPL pointer to struct FileLock
18 // otherwise: BCPL pointer to struct FileHandle
20 unsigned int opencount
;
21 unsigned int privflags
;
25 #define _FCB_ISDIR ((unsigned int)1<<0)
26 #define _FCB_DONTCLOSE_FH ((unsigned int)1<<1)
27 #define _FCB_FLUSHONREAD ((unsigned int)1<<2)
28 #define _FCB_CONSOLERAW ((unsigned int)1<<3)
30 #define FLUSHONREADCHECK \
31 if (__builtin_expect(fdesc->fcb->privflags & _FCB_FLUSHONREAD, 0)) \
33 fdesc->fcb->privflags &= ~_FCB_FLUSHONREAD; \
34 Flush(fdesc->fcb->handle); \
37 /* file descriptor structure - one per descriptor */
45 int __getfdslots(void);
46 void __getfdarray(APTR
*arrayptr
, int *slotsptr
);
47 void __setfdarray(APTR array
, int slots
);
48 void __setfdarraybase(struct PosixCIntBase
*PosixCBase2
);
49 fdesc
*__getfdesc(register int fd
);
50 void __setfdesc(register int fd
, fdesc
*fdesc
);
51 int __getfdslot(int wanted_fd
);
52 int __getfirstfd(register int startfd
);
53 int __open(int wanted_fd
, const char *pathname
, int flags
, int mode
);
54 void __updatestdio(void);
55 LONG
__oflags2amode(int flags
);
56 fdesc
*__alloc_fdesc(void);
57 void __free_fdesc(fdesc
*fdesc
);
58 void __close_on_exec_fdescs(void);
60 #endif /* ___FDESC_H */