PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
fdman.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef _FDMAN_H_
12
13#include <sys/types.h>
14#include <ps2sdkapi.h>
15
16#define _FDMAN_H_
17
18#define __FILENO_MAX 64
19
20#define __IS_FD_VALID(FD) \
21 ( (FD >= 0) && (FD < __FILENO_MAX) && (__descriptormap[FD] != NULL) )
22
23typedef struct {
24 uint32_t flags;
25 uint32_t ref_count;
28
29extern __descriptormap_type *__descriptormap[__FILENO_MAX];
30
31void __fdman_init();
32void __fdman_deinit();
33int __fdman_get_new_descriptor();
34int __fdman_get_dup_descriptor(int fd);
35int __fdman_get_dup2_descriptor(int fd, int newfd);
36void __fdman_release_descriptor(int fd);
37
38#endif