00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __POSIX_FDESC_H__
00011 #define __POSIX_FDESC_H__ 1
00012 #include <libc.h>
00013
00014 struct iovec
00015 {
00016 void *iov_base;
00017 size_t iov_len;
00018 };
00019
00020 typedef struct s_fshare
00021 {
00022 int gate;
00023 int gate_id;
00024 } t_fshare;
00025
00026 #define FDESCOPT_NOCACHE (1<<0u)
00027
00028 typedef enum
00029 {
00030 FDESC_NOT_IN_LTABLE = 100,
00031 FDESC_NOT_AVAIL,
00032 FDESC_BAD_REFCNT,
00033 FDESC_PROP_FETCH,
00034 FDESC_PROP_STORE,
00035 FDESC_PROP_DELETE,
00036 FDESC_PROP_ATTACH,
00037 FDESC_PROP_DETACH,
00038 } t_fdesc_suberrno_codes;
00039
00040
00041
00042 void fdesc_init(void);
00043 void fdesc_cache_invalidate(void);
00044 void fdesc_cache_add(int fd, t_fshare *fshare, int refcnt);
00045 int fdesc_cache_get(int fd, t_fshare *fshare, int *refcnt);
00046 void fdesc_cache_dump(void);
00047 t_fdesc *fdesc_get_i(int fd);
00048 int fshare_get(resid_t resid, t_fshare *fshare, int *refcnt);
00049 int fdesc_get(int d, u_int32_t fdescopts, t_fdesc **fdesc, t_fshare *fshare, int *refcnt, char *s);
00050 int fdesc_nextd(int from);
00051 int fshare_add(resid_t *resid, int gate, int gate_id, mode_t perm);
00052 int fshare_rm(resid_t resid);
00053 int fdesc_add(int d, resid_t resid, int statusfl, int fl);
00054 int fdesc_rm(t_fdesc *fdesc, t_fshare *fshare, int refcnt);
00055 void fdesc_dump(void);
00056 #endif