1 /* $Id: fdtable.h,v 1.3 2002/03/11 20:50:49 hyperion Exp $
6 * POSIX+ subsystem file descriptor table data structure
8 * This file is part of the ReactOS Operating System.
11 * Created by KJK::Hyperion <noog@libero.it>
13 * THIS SOFTWARE IS NOT COPYRIGHTED
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 #ifndef __PSX_FDTABLE_H_INCLUDED__
25 #define __PSX_FDTABLE_H_INCLUDED__
31 #include <psx/safeobj.h>
36 typedef struct __tagfildes_t
45 typedef struct __tagfdtable_t
48 int32_t LowestUnusedFileNo
;
49 int32_t UsedDescriptors
;
50 int32_t AllocatedDescriptors
;
51 uint32_t DescriptorsBitmap
[OPEN_MAX
/ 32];
52 __fildes_t
*Descriptors
;
58 int __fdtable_init(__fdtable_t
*);
59 int __fdtable_free(__fdtable_t
*);
61 int __fdtable_entry_isavail(__fdtable_t
*, int);
62 int __fdtable_entry_nextavail(__fdtable_t
*, int);
63 int __fdtable_entry_add(__fdtable_t
*, int, __fildes_t
*, __fildes_t
**);
64 int __fdtable_entry_remove(__fdtable_t
*, int);
65 __fildes_t
*__fdtable_entry_get(__fdtable_t
*, int);
68 #define __FDTABLE_MAGIC MAGIC('F', 'D', 'T', 'B')
70 #endif /* __PSX_FDTABLE_H_INCLUDED__ */