Crate axlibc

source ·
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
    • fd: Enable file descriptor table.
    • pipe: Enable pipe support.
    • select: Enable synchronous I/O multiplexing (select) support.
    • epoll: Enable event polling (epoll) support.

Functions§

  • Abort the current process.
  • acceptnet
    Accept for connections on a socket
  • Manipulate file descriptor.
  • ax_openfs
    Open a file by filename and insert it into the file descriptor table.
  • bindnet
    Bind a address to a socket.
  • Get clock time since booting
  • closefd
    Close a file by fd.
  • connectnet
    Connects the socket to the address specified.
  • dupfd
    Duplicate a file descriptor.
  • dup2fd
    Duplicate a file descriptor, use file descriptor specified in new_fd.
  • dup3fd
    Duplicate a file descriptor, the caller can force the close-on-exec flag to be set for the new file descriptor by specifying O_CLOEXEC in flags.
  • epoll_create(select or epoll) and epoll
    Creates a new epoll instance.
  • epoll_ctl(select or epoll) and epoll
    Control interface for an epoll file descriptor
  • epoll_wait(select or epoll) and epoll
    Waits for events on the epoll instance referred to by the file descriptor epfd.
  • exit
    Exits the current thread.
  • freealloc
    Deallocate memory.
  • Free queried addrinfo struct
  • fstatfs
    Get file metadata by fd and write into buf.
  • Query addresses for a domain name.
  • getcwdfs
    Get the path of the current directory.
  • Get peer address to which the socket sockfd is connected.
  • Get current thread ID.
  • Get resource limitations
  • Get current address to which the socket sockfd is bound.
  • listennet
    Listen for connections on a socket
  • longjmp implementation
  • lseekfs
    Set the position of the file indicated by fd.
  • lstatfs
    Get the metadata of the symbolic link and write into buf.
  • mallocalloc
    Allocate memory and return the memory address.
  • Convert broken-down time into time since the Epoch.
  • Sleep some nanoseconds
  • pipepipe
    Create a pipe
  • pthread_createmultitask
    Create a new thread with the given entry point and argument.
  • pthread_exitmultitask
    Exits the current thread. The value retval will be returned to the joiner.
  • pthread_joinmultitask
    Waits for the given thread to exit, and stores the return value in retval.
  • pthread_mutex_initmultitask
    Initialize a mutex.
  • pthread_mutex_lockmultitask
    Lock the given mutex.
  • Unlock the given mutex.
  • pthread_selfmultitask
    Returns the pthread struct of current thread.
  • rand
    Returns a 32-bit unsigned pseudo random interger.
  • Returns a 64-bit unsigned pseudo random number.
  • read
    Read data from the file indicated by fd.
  • recvnet
    Receive a message on a socket.
  • recvfromnet
    Receive a message on a socket and get its source address.
  • renamefs
    Rename old to new If new exists, it is first removed.
  • select(select or epoll) and select
    Monitor multiple file descriptors, waiting until one or more of the file descriptors become “ready” for some class of I/O operation
  • sendnet
    Send a message on a socket to the address connected.
  • sendtonet
    Send a message on a socket to the address specified.
  • setjmp implementation
  • Set resource limitations
  • shutdownnet
    Shut down a full-duplex connection.
  • socketnet
    Create an socket for communication.
  • Sets the seed for the random number generator.
  • statfs
    Get the file metadata by path and write into buf.
  • Returns a pointer to the string representation of the given error code.
  • strftimealloc
    Convert date and time to a string.
  • strtodfp_simd
    Convert a string to a double-precision number.
  • strtoffp_simd
    Convert a string to a float number.
  • Return system configuration infomation
  • Write data to the file indicated by fd.
  • Write a vector.