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
allocSave environment variables - environ
allocA pointer pointing to RX_ENVIRON
Functions
- environ_iter
allocGenerate an iterator for environment variables - sys_accept⚠
netAccept for connections on a socket - sys_bind
netBind a address to a socket. - Get clock time since booting
- Get clock time since booting
- sys_clone⚠
multitaskandmuslCreate new thread bysys_clone, return new thread ID - Close a file by
fd. - sys_connect
netConnects the socket to the address specified. - sys_dup
fdDuplicate a file descriptor. - sys_dup2
fdDuplicate a file descriptor, but it uses the file descriptor number specified innew_fd. - sys_dup3
fdandmusldup3used by A64 for MUSL - sys_epoll_create
epolland (selectorpollorepoll)Creates a new epoll instance. - sys_epoll_ctl⚠
epolland (selectorpollorepoll)Control interface for an epoll file descriptor - sys_epoll_pwait⚠
epolland (selectorpollorepoll)epoll_pwaitused by A64. Currently ignore signals - sys_epoll_wait⚠
epolland (selectorpollorepoll)Waits for events on the epoll instance referred to by the file descriptor epfd. - Exit current task
- Manipulate file descriptor.
- sys_freeaddrinfo⚠
netFree queriedaddrinfostruct - sys_fstat⚠
fsretrieve information about the file pointed byfd - sys_fsync⚠
fsfsync - sys_futex
multitaskFuteximplementation inspired by Starry - sys_getaddrinfo⚠
netQuery addresses for a domain name. - Get the path of the current directory.
- sys_getegid⚠
fsObtain a valid group ID for the process - sys_geteuid⚠
fsObtain a valid user ID for the process - sys_getitimer⚠
signalGet timer to send signal after some time - sys_getpeername⚠
netGet peer address to which the socket sockfd is connected. - Get current thread ID.
- Get resource limitations
- sys_getsockname⚠
netGet current address to which the socket sockfd is bound. - Invalid syscall
- ioctl implementation, currently only support fd = 1
- sys_listen
netListen for connections on a socket - Set the position of the file indicated by
fd. - sys_lstat⚠
fsGet 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
allocCreates a new mapping in the virtual address space of the call‐ ing process. - sys_mprotect
allocChanges 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
allocDeletes the mappings for the specified address range - Sleep some nanoseconds
newfstatatused by A64- sys_open
fsOpen a file byfilenameand insert it into the file descriptor table. - Open a file under a specific dir
- sys_pipe
pipeCreate a pipe - sys_pipe2
pipepipe2syscall, used by AARCH64 - sys_poll⚠
polland (selectorpollorepoll)Used to monitor multiple file descriptors for events - sys_ppoll⚠
polland (selectorpollorepoll)ppollused by A64. Currently ignore signal - set/get resource limitations
- sys_pselect6⚠
selectand (selectorpollorepoll)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⚠
multitaskRestarts all the threads that are waiting on the condition variable. - sys_pthread_cond_destroy⚠
multitaskDestroy a condition variable - sys_pthread_cond_init⚠
multitaskInitialize a condition variable - sys_pthread_cond_signal⚠
multitaskRestarts one of the threads that are waiting on the condition variable. - sys_pthread_cond_timedwait⚠
multitaskWait for the condition variable to be signaled or timeout - sys_pthread_cond_wait⚠
multitaskWait for the condition variable to be signaled - sys_pthread_create⚠
multitaskCreate a new thread with the given entry point and argument. - sys_pthread_exit
multitaskExits the current thread. The valueretvalwill be returned to the joiner. - sys_pthread_getspecific
muslandmultitaskGet the value of a specific key for a thread. - sys_pthread_join⚠
multitaskWaits for the given thread to exit, and stores the return value inretval. - sys_pthread_key_create⚠
muslandmultitaskAllocate a specific key for a process shared by all threads. - sys_pthread_key_delete
muslandmultitaskDestroy a specific key for a process. - sys_pthread_mutex_destroy
multitaskDestroy the given mutex. - sys_pthread_mutex_init
multitaskInitialize a mutex. - sys_pthread_mutex_lock
multitaskLock the given mutex. - sys_pthread_mutex_trylock
multitaskLock 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
multitaskUnlock the given mutex. - sys_pthread_self
multitaskReturns thepthreadstruct of current thread. - sys_pthread_setspecific
muslandmultitaskSet the value of a specific key for a thread. - Read data from the file indicated by
fd. - sys_recv
netReceive a message on a socket. - sys_recvfrom⚠
netReceive a message on a socket and get its source address. - Rename
oldtonewIf 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⚠
selectand (selectorpollorepoll)Monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation - sys_send
netSend a message on a socket to the address connected. - sys_sendmsg⚠
netSend 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
netSend a message on a socket to the address specified. - sys_set_tid_address
multitaskandmuslSet child tid address - sys_setitimer⚠
signalSet a timer to send a signal to the current process after a specified time - Set resource limitations
setsockopt, currently ignored- sys_shutdown
netShut down a full-duplex connection. - sys_sigaction
signalSet signal handler - sys_socket
netCreate an socket for communication. - sys_stat⚠
fsGet the file metadata bypathand 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.