Files
mkrtos-real/mkrtos_user/lib/libc_backend/inc/fd_map.h

22 lines
435 B
C
Raw Normal View History

2023-11-18 22:58:10 +08:00
#pragma once
2023-11-18 23:31:00 +08:00
#include <u_types.h>
2023-11-18 22:58:10 +08:00
2023-11-18 23:31:00 +08:00
typedef struct fd_map_entry
{
2023-12-08 23:55:00 +08:00
uint32_t svr_fd;
uint32_t priv_fd;
2023-11-18 23:31:00 +08:00
uint8_t type;
uint8_t flags;
} fd_map_entry_t;
enum fd_type
{
FD_TTY,
FD_FS,
};
2023-12-08 23:55:00 +08:00
int fd_map_alloc(uint32_t svr_fd, uint32_t priv_fd, enum fd_type type);
2023-11-18 22:58:10 +08:00
int fd_map_update(int fd, fd_map_entry_t *new_entry);
int fd_map_free(int fd, fd_map_entry_t *ret_entry);
2023-11-18 23:31:00 +08:00
int fd_map_get(int fd, fd_map_entry_t *new_entry);