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.
- Lib C functions
Functions§
- abort⚠
- Abort the current process.
- accept⚠
- Accept for connections on a socket
- ax_
fcntl ⚠ - Manipulate file descriptor.
- ax_open⚠
- Open a file by
filenameand insert it into the file descriptor table. - bind⚠
- Bind a address to a socket.
- clock_
gettime ⚠ - Get clock time since booting
- close⚠
- Close a file by
fd. - connect⚠
- Connects the socket to the address specified.
- dup⚠
- Duplicate a file descriptor.
- dup2⚠
- Duplicate a file descriptor, use file descriptor specified in
new_fd. - dup3⚠
- Duplicate a file descriptor, the caller can force the close-on-exec flag to
be set for the new file descriptor by specifying
O_CLOEXECin flags. - epoll_
create ⚠ - Creates a new epoll instance.
- epoll_
ctl ⚠ - Control interface for an epoll file descriptor
- epoll_
wait ⚠ - Waits for events on the epoll instance referred to by the file descriptor epfd.
- exit⚠
- Exits the current thread.
- free⚠
- Deallocate memory.
- freeaddrinfo⚠
- Free queried
addrinfostruct - fstat⚠
- Get file metadata by
fdand write intobuf. - getaddrinfo⚠
- Query addresses for a domain name.
- getcwd⚠
- Get the path of the current directory.
- getpeername⚠
- Get peer address to which the socket sockfd is connected.
- getpid⚠
- Get current thread ID.
- getrlimit⚠
- Get resource limitations
- getsockname⚠
- Get current address to which the socket sockfd is bound.
- listen⚠
- Listen for connections on a socket
- longjmp⚠
longjmpimplementation- lseek⚠
- Set the position of the file indicated by
fd. - lstat⚠
- Get the metadata of the symbolic link and write into
buf. - malloc⚠
- Allocate memory and return the memory address.
- mktime⚠
- Convert broken-down time into time since the Epoch.
- nanosleep⚠
- Sleep some nanoseconds
- pipe⚠
- Create a pipe
- pthread_
create ⚠ - Create a new thread with the given entry point and argument.
- pthread_
exit ⚠ - Exits the current thread. The value
retvalwill be returned to the joiner. - pthread_
join ⚠ - Waits for the given thread to exit, and stores the return value in
retval. - pthread_
mutex_ ⚠init - Initialize a mutex.
- pthread_
mutex_ ⚠lock - Lock the given mutex.
- pthread_
mutex_ ⚠unlock - Unlock the given mutex.
- pthread_
self ⚠ - Returns the
pthreadstruct of current thread. - rand⚠
- Returns a 32-bit unsigned pseudo random interger.
- random⚠
- Returns a 64-bit unsigned pseudo random number.
- read⚠
- Read data from the file indicated by
fd. - recv⚠
- Receive a message on a socket.
- recvfrom⚠
- Receive a message on a socket and get its source address.
- rename⚠
- Rename
oldtonewIf new exists, it is first removed. - select⚠
- Monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation
- send⚠
- Send a message on a socket to the address connected.
- sendto⚠
- Send a message on a socket to the address specified.
- setjmp⚠
setjmpimplementation- setrlimit⚠
- Set resource limitations
- shutdown⚠
- Shut down a full-duplex connection.
- socket⚠
- Create an socket for communication.
- srand⚠
- Sets the seed for the random number generator.
- stat⚠
- Get the file metadata by
pathand write intobuf. - strerror⚠
- Returns a pointer to the string representation of the given error code.
- strftime⚠
- Convert date and time to a string.
- strtod⚠
- Convert a string to a double-precision number.
- strtof⚠
- Convert a string to a float number.
- sysconf⚠
- Return system configuration infomation
- write⚠
- Write data to the file indicated by
fd. - writev⚠
- Write a vector.