Crate arceos_posix_api
source ·Expand description
POSIX-compatible APIs for ArceOS modules
Modules
- Platform-specific constants and parameters.
- POSIX C types.
Statics
- RX_ENVIRON
alloc
Save environment variables - environ
alloc
A pointer pointing to RX_ENVIRON
Functions
- environ_iter
alloc
Generate an iterator for environment variables - sys_accept⚠
net
Accept for connections on a socket - sys_bind
net
Bind a address to a socket. - Get clock time since booting
- Get clock time since booting
- sys_clone⚠
multitask
andmusl
Create new thread bysys_clone
, return new thread ID - 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_dup3
fd
andmusl
dup3
used by A64 for MUSL - sys_epoll_create
epoll
and (select
orpoll
orepoll
)Creates a new epoll instance. - sys_epoll_ctl⚠
epoll
and (select
orpoll
orepoll
)Control interface for an epoll file descriptor - sys_epoll_pwait⚠
epoll
and (select
orpoll
orepoll
)epoll_pwait
used by A64. Currently ignore signals - sys_epoll_wait⚠
epoll
and (select
orpoll
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
retrieve information about the file pointed byfd
- sys_fsync⚠
fs
fsync
- sys_futex
multitask
Futex
implementation inspired by Starry - sys_getaddrinfo⚠
net
Query addresses for a domain name. - Get the path of the current directory.
- sys_getitimer⚠
signal
Get timer to send signal after some time - 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. - Invalid syscall
- ioctl implementation, currently only support fd = 1
- 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
. - Creates a new, empty directory at the provided path.
- attempts to create a directory named pathname under directory pointed by
fd
- sys_mmap
alloc
Creates a new mapping in the virtual address space of the call‐ ing process. - sys_mprotect
alloc
Changes the access protections for the calling process’s memory pages containing any part of the address range in the interval [addr, addr+len-1].
addr must be aligned to a page boundary. - sys_munmap
alloc
Deletes the mappings for the specified address range - Sleep some nanoseconds
newfstatat
used by A64- sys_open
fs
Open a file byfilename
and insert it into the file descriptor table. - Open a file under a specific dir
- sys_pipe
pipe
Create a pipe - sys_pipe2
pipe
pipe2
syscall, used by AARCH64 - sys_poll⚠
poll
and (select
orpoll
orepoll
)Used to monitor multiple file descriptors for events - sys_ppoll⚠
poll
and (select
orpoll
orepoll
)ppoll
used by A64. Currently ignore signal - set/get resource limitations
- sys_pselect6⚠
select
and (select
orpoll
orepoll
)allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation (e.g., input possible) - sys_pthread_cond_broadcast⚠
multitask
Restarts all the threads that are waiting on the condition variable. - sys_pthread_cond_destroy⚠
multitask
Destroy a condition variable - sys_pthread_cond_init⚠
multitask
Initialize a condition variable - sys_pthread_cond_signal⚠
multitask
Restarts one of the threads that are waiting on the condition variable. - sys_pthread_cond_timedwait⚠
multitask
Wait for the condition variable to be signaled or timeout - sys_pthread_cond_wait⚠
multitask
Wait for the condition variable to be signaled - 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_getspecific
musl
andmultitask
Get the value of a specific key for a thread. - sys_pthread_join⚠
multitask
Waits for the given thread to exit, and stores the return value inretval
. - sys_pthread_key_create⚠
musl
andmultitask
Allocate a specific key for a process shared by all threads. - sys_pthread_key_delete
musl
andmultitask
Destroy a specific key for a process. - sys_pthread_mutex_destroy
multitask
Destroy the given mutex. - sys_pthread_mutex_init
multitask
Initialize a mutex. - sys_pthread_mutex_lock
multitask
Lock the given mutex. - sys_pthread_mutex_trylock
multitask
Lock the given mutex like sys_pthread_mutex_lock, except that it does not block the calling thread if the mutex is already locked. - sys_pthread_mutex_unlock
multitask
Unlock the given mutex. - sys_pthread_self
multitask
Returns thepthread
struct of current thread. - sys_pthread_setspecific
musl
andmultitask
Set the value of a specific key for a 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. - Remove a directory, which must be empty
- sigaction syscall for A64 musl
- Set mask for given thread
- Relinquish the CPU, and switches to another task.
- sys_select⚠
select
and (select
orpoll
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_sendmsg⚠
net
Send a message on a socket to the address connected. The message is pointed to by the elements of the array msg.msg_iov. - sys_sendto
net
Send a message on a socket to the address specified. - sys_set_tid_address
multitask
andmusl
Set child tid address - sys_setitimer⚠
signal
Set a timer to send a signal to the current process after a specified time - Set resource limitations
setsockopt
, currently ignored- sys_shutdown
net
Shut down a full-duplex connection. - sys_sigaction
signal
Set signal handler - sys_socket
net
Create an socket for communication. - sys_stat⚠
fs
Get the file metadata bypath
and write intobuf
. - Return sysinfo struct
umask
- Removes a file from the filesystem.
- deletes a name from the filesystem
- Write data to the file indicated by
fd
. - Write a vector.