1 /* $Id: fdtable.h,v 1.2 2002/02/20 09:17:55 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__
30 #include <psx/safeobj.h>
35 typedef struct __tagfildes_t
44 typedef struct __tagfdtable_t
47 int32_t LowestUnusedFileNo
;
48 int32_t UsedDescriptors
;
49 int32_t AllocatedDescriptors
;
50 uint32_t DescriptorsBitmap
[OPEN_MAX
/ 32];
51 __fildes_t
*Descriptors
;
57 int __fdtable_init(__fdtable_t
*);
58 int __fdtable_free(__fdtable_t
*);
60 int __fdtable_entry_isavail(__fdtable_t
*, int);
61 int __fdtable_entry_nextavail(__fdtable_t
*, int);
62 int __fdtable_entry_add(__fdtable_t
*, int, __fildes_t
*, __fildes_t
**);
63 int __fdtable_entry_remove(__fdtable_t
*, int);
64 __fildes_t
*__fdtable_entry_get(__fdtable_t
*, int);
67 #define __FDTABLE_MAGIC MAGIC('F', 'D', 'T', 'B')
69 #endif /* __PSX_FDTABLE_H_INCLUDED__ */