Expand description
ArceOS user program library for C apps.
Cargo Features
- CPU
smp
: Enable SMP (symmetric multiprocessing) support.fp_simd
: Enable floating point and SIMD support.
- Interrupts:
irq
: Enable interrupt handling support.
- Memory
alloc
: Enable dynamic memory allocation.tls
: Enable thread-local storage.
- Task management
multitask
: Enable multi-threading support.
- Upperlayer stacks
fs
: Enable file system support.net
: Enable networking support.signal
: Enable signal support.
- Lib C functions
Functions
- Abort the current process.
- accept⚠
net
Accept for connections on a socket - alarm⚠
signal
Set an alarm clock for delivery of a signal - ax_fcntl⚠
fd
Manipulate file descriptor. - ax_open⚠
fs
Open a file byfilename
and insert it into the file descriptor table. - ax_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. - bind⚠
net
Bind a address to a socket. - Get clock time since booting
- close⚠
fd
Close a file byfd
. - connect⚠
net
Connects the socket to the address specified. - dup⚠
fd
Duplicate a file descriptor. - dup2⚠
fd
Duplicate a file descriptor, use file descriptor specified innew_fd
. - dup3⚠
fd
Duplicate a file descriptor, the caller can force the close-on-exec flag to be set for the new file descriptor by specifyingO_CLOEXEC
in flags. - epoll_create⚠(
select
orpoll
orepoll
) andepoll
Creates a new epoll instance. - epoll_ctl⚠(
select
orpoll
orepoll
) andepoll
Control interface for an epoll file descriptor - epoll_wait⚠(
select
orpoll
orepoll
) andepoll
Waits for events on the epoll instance referred to by the file descriptor epfd. - exit⚠Exits the current thread.
- free⚠
alloc
Deallocate memory. - freeaddrinfo⚠
net
Free queriedaddrinfo
struct - fstat⚠
fs
Get file metadata byfd
and write intobuf
. - getaddrinfo⚠
net
Query addresses for a domain name. - getcwd⚠
fs
Get the path of the current directory. - getenv⚠
alloc
get the corresponding environ variable - getitimer⚠
signal
Set timer to send signal after some time - getpeername⚠
net
Get peer address to which the socket sockfd is connected. - Get current thread ID.
- Get resource limitations
- getsockname⚠
net
Get current address to which the socket sockfd is bound. - listen⚠
net
Listen for connections on a socket longjmp
implementation- lseek⚠
fs
Set the position of the file indicated byfd
. - lstat⚠
fs
Get the metadata of the symbolic link and write intobuf
. - malloc⚠
alloc
Allocate memory and return the memory address. - mkdir⚠
fs
Creates a new directory - Convert broken-down time into time since the Epoch.
- Sleep some nanoseconds
- pipe⚠
pipe
Create a pipe - poll⚠(
select
orpoll
orepoll
) andpoll
Monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation - pthread_cond_broadcast⚠
multitask
Restarts all the threads that are waiting on the condition variable. - pthread_cond_init⚠
multitask
Initialize a condition variable - pthread_cond_signal⚠
multitask
Restarts one of the threads that are waiting on the condition variable. - pthread_cond_wait⚠
multitask
Wait for the condition variable to be signaled - pthread_create⚠
multitask
Create a new thread with the given entry point and argument. - pthread_exit⚠
multitask
Exits the current thread. The valueretval
will be returned to the joiner. - pthread_join⚠
multitask
Waits for the given thread to exit, and stores the return value inretval
. - pthread_mutex_init⚠
multitask
Initialize a mutex. - pthread_mutex_lock⚠
multitask
Lock the given mutex. - pthread_mutex_trylock⚠
multitask
Lock the given mutex. If the mutex is already locked, it returns immediatly with the error code EBUSY. - pthread_mutex_unlock⚠
multitask
Unlock the given mutex. - pthread_self⚠
multitask
Returns thepthread
struct of current thread. - rand⚠Returns a 32-bit unsigned random integer
- Returns a 64-bit unsigned random integer
- read⚠Read data from the file indicated by
fd
. - recv⚠
net
Receive a message on a socket. - recvfrom⚠
net
Receive a message on a socket and get its source address. - rename⚠
fs
Renameold
tonew
If new exists, it is first removed. - rmdir⚠
fs
Remove a directory, which must be empty - select⚠(
select
orpoll
orepoll
) andselect
Monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation - send⚠
net
Send a message on a socket to the address connected. - sendto⚠
net
Send a message on a socket to the address specified. - setenv⚠
alloc
set an environ variable - setitimer⚠
signal
Set timer to send signal after some time setjmp
implementation- Set resource limitations
- shutdown⚠
net
Shut down a full-duplex connection. - socket⚠
net
Create an socket for communication. - Sets the seed for the 32-bit random number generator based on LCG.
- stat⚠
fs
Get the file metadata bypath
and write intobuf
. - Returns a pointer to the string representation of the given error code.
- strftime⚠
alloc
Convert date and time to a string. - calculate the length of a string, excluding the terminating null byte
- calculate the length of a string like strlen, but at most maxlen.
- strtod⚠
fp_simd
Convert a string to a double-precision number. - strtof⚠
fp_simd
Convert a string to a float number. - Return system configuration infomation
- ualarm⚠
signal
Schedule signal after given number of microseconds - unlink⚠
fs
Removes a file from the filesystem. - unsetenv⚠
alloc
unset an environ variable - Write data to the file indicated by
fd
. - Write a vector.