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)
29 #define FLUSHONREADCHECK \
30 if (__builtin_expect(fdesc->fcb->privflags & _FCB_FLUSHONREAD, 0)) \
32 fdesc->fcb->privflags &= ~_FCB_FLUSHONREAD; \
33 Flush(fdesc->fcb->handle); \
36 /* file descriptor structure - one per descriptor */
44 int __getfdslots(void);
45 void __getfdarray(APTR
*arrayptr
, int *slotsptr
);
46 void __setfdarray(APTR array
, int slots
);
47 void __setfdarraybase(struct PosixCIntBase
*PosixCBase2
);
48 fdesc
*__getfdesc(register int fd
);
49 void __setfdesc(register int fd
, fdesc
*fdesc
);
50 int __getfdslot(int wanted_fd
);
51 int __getfirstfd(register int startfd
);
52 int __open(int wanted_fd
, const char *pathname
, int flags
, int mode
);
53 void __updatestdio(void);
54 LONG
__oflags2amode(int flags
);
55 fdesc
*__alloc_fdesc(void);
56 void __free_fdesc(fdesc
*fdesc
);
57 void __close_on_exec_fdescs(void);
59 #endif /* ___FDESC_H */