Crate arceos_posix_api
source ·Expand description
POSIX-compatible APIs for ArceOS modules
Modules§
- Platform-specific constants and parameters.
- POSIX C types.
Functions§
- sys_accept⚠
net
Accept for connections on a socket - sys_bind
net
Bind a address to a socket. - Get clock time since booting
- Close a file by
fd
. - sys_connect
net
Connects the socket to the address specified. - sys_dup
fd
Duplicate a file descriptor. - sys_dup2
fd
Duplicate a file descriptor, but it uses the file descriptor number specified innew_fd
. - sys_epoll_create
epoll
and (select
orepoll
)Creates a new epoll instance. - sys_epoll_ctl⚠
epoll
and (select
orepoll
)Control interface for an epoll file descriptor - sys_epoll_wait⚠
epoll
and (select
orepoll
)Waits for events on the epoll instance referred to by the file descriptor epfd. - Exit current task
- Manipulate file descriptor.
- sys_freeaddrinfo⚠
net
Free queriedaddrinfo
struct - sys_fstat⚠
fs
Get file metadata byfd
and write intobuf
. - sys_getaddrinfo⚠
net
Query addresses for a domain name. - Get the path of the current directory.
- sys_getpeername⚠
net
Get peer address to which the socket sockfd is connected. - Get current thread ID.
- Get resource limitations
- sys_getsockname⚠
net
Get current address to which the socket sockfd is bound. - sys_listen
net
Listen for connections on a socket - Set the position of the file indicated by
fd
. - sys_lstat⚠
fs
Get the metadata of the symbolic link and write intobuf
. - Sleep some nanoseconds
- sys_open
fs
Open a file byfilename
and insert it into the file descriptor table. - sys_pipe
pipe
Create a pipe - sys_pthread_create⚠
multitask
Create a new thread with the given entry point and argument. - sys_pthread_exit
multitask
Exits the current thread. The valueretval
will be returned to the joiner. - sys_pthread_join⚠
multitask
Waits for the given thread to exit, and stores the return value inretval
. - sys_pthread_mutex_init
multitask
Initialize a mutex. - sys_pthread_mutex_lock
multitask
Lock the given mutex. - sys_pthread_mutex_unlock
multitask
Unlock the given mutex. - sys_pthread_self
multitask
Returns thepthread
struct of current thread. - Read data from the file indicated by
fd
. - sys_recv
net
Receive a message on a socket. - sys_recvfrom⚠
net
Receive a message on a socket and get its source address. - Rename
old
tonew
If new exists, it is first removed. - Relinquish the CPU, and switches to another task.
- sys_select⚠
select
and (select
orepoll
)Monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation - sys_send
net
Send a message on a socket to the address connected. - sys_sendto
net
Send a message on a socket to the address specified. - Set resource limitations
- sys_shutdown
net
Shut down a full-duplex connection. - sys_socket
net
Create an socket for communication. - sys_stat⚠
fs
Get the file metadata bypath
and write intobuf
. - Return system configuration infomation
- Write data to the file indicated by
fd
. - Write a vector.