![]() |
Samsung Internal API reference
2.0
|
Files | |
| file | error.h |
| file | mman.h |
| file | phys.h |
Data Structures | |
| struct | cpu_set_t |
| struct | tm |
| struct | __uuid_t |
| wrapper for uuid type. More... | |
Macros | |
| #define | assert(expr) __assert__(expr, __FILE__, __LINE__) |
| Abort the program if assertion is false. More... | |
| #define | alloca _alloca |
| Allocate memory that is automatically freed. More... | |
| #define | EPERM 1 /* Operation not permitted */ |
| #define | ENOENT 2 /* No such file or directory */ |
| #define | ESRCH 3 /* No such process */ |
| #define | EINTR 4 /* Interrupted system call */ |
| #define | EIO 5 /* I/O error */ |
| #define | ENXIO 6 /* No such device or address */ |
| #define | E2BIG 7 /* Argument list too long */ |
| #define | ENOEXEC 8 /* Exec format error */ |
| #define | EBADF 9 /* Bad file number */ |
| #define | ECHILD 10 /* No child processes */ |
| #define | EAGAIN 11 /* Try again */ |
| #define | ENOMEM 12 /* Out of memory */ |
| #define | EACCES 13 /* Permission denied */ |
| #define | EFAULT 14 /* Bad address */ |
| #define | ENOTBLK 15 /* Block device required */ |
| #define | EBUSY 16 /* Device or resource busy */ |
| #define | EEXIST 17 /* File exists */ |
| #define | EXDEV 18 /* Cross-device link */ |
| #define | ENODEV 19 /* No such device */ |
| #define | ENOTDIR 20 /* Not a directory */ |
| #define | EISDIR 21 /* Is a directory */ |
| #define | EINVAL 22 /* Invalid argument */ |
| #define | ENFILE 23 /* File table overflow */ |
| #define | EMFILE 24 /* Too many open files */ |
| #define | ENOTTY 25 /* Not a typewriter */ |
| #define | ETXTBSY 26 /* Text file busy */ |
| #define | EFBIG 27 /* File too large */ |
| #define | ENOSPC 28 /* No space left on device */ |
| #define | ESPIPE 29 /* Illegal seek */ |
| #define | EROFS 30 /* Read-only file system */ |
| #define | EMLINK 31 /* Too many links */ |
| #define | EPIPE 32 /* Broken pipe */ |
| #define | EDOM 33 /* Math argument out of domain of func */ |
| #define | ERANGE 34 /* Math result not representable */ |
| #define | EDEADLK 35 /* Resource deadlock would occur */ |
| #define | ENAMETOOLONG 36 /* File name too long */ |
| #define | ENOLCK 37 /* No record locks available */ |
| #define | ENOSYS 38 /* Function not implemented */ |
| #define | ENOTEMPTY 39 /* Directory not empty */ |
| #define | ELOOP 40 /* Too many symbolic links encountered */ |
| #define | EWOULDBLOCK EAGAIN /* Operation would block */ |
| #define | ENOMSG 42 /* No message of desired type */ |
| #define | EIDRM 43 /* Identifier removed */ |
| #define | ECHRNG 44 /* Channel number out of range */ |
| #define | EL2NSYNC 45 /* Level 2 not synchronized */ |
| #define | EL3HLT 46 /* Level 3 halted */ |
| #define | EL3RST 47 /* Level 3 reset */ |
| #define | ELNRNG 48 /* Link number out of range */ |
| #define | EUNATCH 49 /* Protocol driver not attached */ |
| #define | ENOCSI 50 /* No CSI structure available */ |
| #define | EL2HLT 51 /* Level 2 halted */ |
| #define | EBADE 52 /* Invalid exchange */ |
| #define | EBADR 53 /* Invalid request descriptor */ |
| #define | EXFULL 54 /* Exchange full */ |
| #define | ENOANO 55 /* No anode */ |
| #define | EBADRQC 56 /* Invalid request code */ |
| #define | EBADSLT 57 /* Invalid slot */ |
| #define | EDEADLOCK EDEADLK |
| #define | EBFONT 59 /* Bad font file format */ |
| #define | ENOSTR 60 /* Device not a stream */ |
| #define | ENODATA 61 /* No data available */ |
| #define | ETIME 62 /* Timer expired */ |
| #define | ENOSR 63 /* Out of streams resources */ |
| #define | ENONET 64 /* Machine is not on the network */ |
| #define | ENOPKG 65 /* Package not installed */ |
| #define | EREMOTE 66 /* Object is remote */ |
| #define | ENOLINK 67 /* Link has been severed */ |
| #define | EADV 68 /* Advertise error */ |
| #define | ESRMNT 69 /* Srmount error */ |
| #define | ECOMM 70 /* Communication error on send */ |
| #define | EPROTO 71 /* Protocol error */ |
| #define | EMULTIHOP 72 /* Multihop attempted */ |
| #define | EDOTDOT 73 /* RFS specific error */ |
| #define | EBADMSG 74 /* Not a data message */ |
| #define | EOVERFLOW 75 /* Value too large for defined data type */ |
| #define | ENOTUNIQ 76 /* Name not unique on network */ |
| #define | EBADFD 77 /* File descriptor in bad state */ |
| #define | EREMCHG 78 /* Remote address changed */ |
| #define | ELIBACC 79 /* Can not access a needed shared library */ |
| #define | ELIBBAD 80 /* Accessing a corrupted shared library */ |
| #define | ELIBSCN 81 /* .lib section in a.out corrupted */ |
| #define | ELIBMAX 82 /* Attempting to link in too many shared libraries */ |
| #define | ELIBEXEC 83 /* Cannot exec a shared library directly */ |
| #define | EILSEQ 84 /* Illegal byte sequence */ |
| #define | ERESTART 85 /* Interrupted system call should be restarted */ |
| #define | ESTRPIPE 86 /* Streams pipe error */ |
| #define | EUSERS 87 /* Too many users */ |
| #define | ENOTSOCK 88 /* Socket operation on non-socket */ |
| #define | EDESTADDRREQ 89 /* Destination address required */ |
| #define | EMSGSIZE 90 /* Message too long */ |
| #define | EPROTOTYPE 91 /* Protocol wrong type for socket */ |
| #define | ENOPROTOOPT 92 /* Protocol not available */ |
| #define | EPROTONOSUPPORT 93 /* Protocol not supported */ |
| #define | ESOCKTNOSUPPORT 94 /* Socket type not supported */ |
| #define | EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ |
| #define | EPFNOSUPPORT 96 /* Protocol family not supported */ |
| #define | EAFNOSUPPORT 97 /* Address family not supported by protocol */ |
| #define | EADDRINUSE 98 /* Address already in use */ |
| #define | EADDRNOTAVAIL 99 /* Cannot assign requested address */ |
| #define | ENETDOWN 100 /* Network is down */ |
| #define | ENETUNREACH 101 /* Network is unreachable */ |
| #define | ENETRESET 102 /* Network dropped connection because of reset */ |
| #define | ECONNABORTED 103 /* Software caused connection abort */ |
| #define | ECONNRESET 104 /* Connection reset by peer */ |
| #define | ENOBUFS 105 /* No buffer space available */ |
| #define | EISCONN 106 /* Transport endpoint is already connected */ |
| #define | ENOTCONN 107 /* Transport endpoint is not connected */ |
| #define | ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ |
| #define | ETOOMANYREFS 109 /* Too many references: cannot splice */ |
| #define | ETIMEDOUT 110 /* Connection timed out */ |
| #define | ECONNREFUSED 111 /* Connection refused */ |
| #define | EHOSTDOWN 112 /* Host is down */ |
| #define | EHOSTUNREACH 113 /* No route to host */ |
| #define | EALREADY 114 /* Operation already in progress */ |
| #define | EINPROGRESS 115 /* Operation now in progress */ |
| #define | ESTALE 116 /* Stale file handle */ |
| #define | EUCLEAN 117 /* Structure needs cleaning */ |
| #define | ENOTNAM 118 /* Not a XENIX named type file */ |
| #define | ENAVAIL 119 /* No XENIX semaphores available */ |
| #define | EISNAM 120 /* Is a named type file */ |
| #define | EREMOTEIO 121 /* Remote I/O error */ |
| #define | EDQUOT 122 /* Quota exceeded */ |
| #define | ECANCELED 125 /* Operation canceled */ |
| #define | ENOKEY 126 /* Required key not available */ |
| #define | EKEYREJECTED 127 /* Key was rejected by service */ |
| #define | ENOTRECOVERABLE 131 /* State not recoverable */ |
| #define | errno (*get_errno_addr()) |
| #define | PRId16 __16_PREFIX "d" |
| #define | PRId32 "d" |
| #define | PRId64 __64_PREFIX "d" |
| #define | PRIu16 __16_PREFIX "u" |
| #define | PRIu32 "u" |
| #define | PRIu64 __64_PREFIX "u" |
| #define | PRIx16 __16_PREFIX "x" |
| #define | PRIx32 "x" |
| #define | PRIx64 __64_PREFIX "x" |
| #define | SCNd16 __16_PREFIX "d" |
| #define | SCNd32 "d" |
| #define | SCNd64 __64_PREFIX "d" |
| #define | SCNu16 __16_PREFIX "u" |
| #define | SCNu32 "u" |
| #define | SCNu64 __64_PREFIX "u" |
| #define | SCNx16 __16_PREFIX "x" |
| #define | SCNx32 "x" |
| #define | SCNx64 __64_PREFIX "x" |
| #define | CHAR_BIT 8 |
| #define | SCHAR_MAX (127) |
| #define | SCHAR_MIN (-128) |
| #define | UCHAR_MAX (255) |
| #define | USHRT_MAX (0xFFFFU) |
| #define | SHRT_MAX (32767) |
| #define | SHRT_MIN (-32768) |
| #define | INT_MAX ((int)(~0U>>1)) |
| #define | INT_MIN (-INT_MAX - 1) |
| #define | LONG_MAX ((long)(~0UL>>1)) |
| #define | LONG_MIN (-LONG_MAX - 1) |
| #define | UINT_MAX (~0U) |
| #define | ULONG_MAX (~0UL) |
| #define | ULLONG_MAX (~0ULL) |
| #define | LLONG_MAX ((long long)(~0ULL>>1)) |
| #define | LLONG_MIN ((long long)(-LLONG_MAX - 1)) |
| #define | _POSIX_THREAD_KEYS_MAX 12 |
| #define | PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX |
| #define | _POSIX_THREAD_THREADS_MAX 64 |
| #define | _POSIX_THREADS 1 |
| #define | M_CACHE_PAGES 1 |
| #define | AUTO_BUFFER_SIZE 1024 |
| #define | BIT_PER_CPU (1) |
| #define | MAX_CPUS (32) |
| #define | BITS_TO_CPU_MASK(bits) (((bits) + BITS_PER_LONG - 1) / BITS_PER_LONG) |
| #define | BITMAP_ELT(cpu) ((cpu) / BITS_PER_LONG) |
| #define | __CPUMASK(cpu) (1L << ((cpu) % BITS_PER_LONG)) |
| #define | DECLARE_BITMAP(name, bits) unsigned long name[BITS_TO_CPU_MASK(bits)] |
| #define | CPU_ZERO(cpusetp) |
| #define | CPU_SET(cpu, cpusetp) |
| #define | CPU_CLR(cpu, cpusetp) |
| #define | CPU_ISSET(cpu, cpusetp) |
| #define | EOF (-1) |
| #define | MAP_ANONYMOUS (1 << 0) |
| #define | MAP_POPULATE (1 << 1) |
| #define | MAP_FIXED (1 << 2) |
| #define | MAP_PRIVATE (1 << 3) |
| #define | MAP_SHARED (1 << 4) |
| #define | MAP_STACK (1 << 5) |
| #define | MAP_GROWSDOWN (1 << 6) |
| #define | PROT_NONE 0 |
| #define | PROT_READ 1 |
| #define | PROT_WRITE 2 |
| #define | PROT_EXEC 4 |
| #define | PGOFF_SHIFT 12 |
| #define | MAP_PHYS_NON_SECURE (1 << 29) |
| #define | MAP_PHYS_NON_CACHED (1 << 28) |
| #define | MAP_FAILED ((void *)-1) |
| #define | NUM_SECONDS_IN_MIN (60) |
| #define | NUM_MILLIS_IN_SEC (1000) |
| #define | NUM_NANOS_IN_USEC (1000) |
| #define | NUM_NANOS_IN_MILLI (1000000L) |
| #define | NUM_NANOS_IN_SEC (1000000000ULL) |
| #define | TEMP_FAILURE_RETRY(expression) |
| Recall function if it was interrupted by signal. More... | |
| #define | UUID_STRING_LEN 37 |
| #define | uuid_unparse_lower(uu, out) uuid_unparse((uu), (out)) |
| #define | uuid_generate_time(x) uuid_generate(x) |
Typedefs | |
| typedef int | errno_t |
| typedef intptr_t | ssize_t |
| typedef int | pid_t |
| typedef int | uid_t |
| typedef int | gid_t |
| typedef long long | time_t |
| typedef int64_t | off_t |
| typedef unsigned int | mode_t |
| typedef struct __uuid_t | __uuid_t |
| typedef __uuid_t | uuid_t |
| typedef void(* | constraint_handler_t) (const char *restrict msg, void *restrict ptr, errno_t error) |
Enumerations | |
| enum | { _SC_OPEN_MAX, _SC_PAGESIZE, _SC_PHYS_PAGES, _SC_AVPHYS_PAGES, _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, _SC_THREADS, _SC_THREAD_KEYS_MAX, _SC_THREAD_THREADS_MAX, _SC_THREAD_STACK_MIN } |
| sysconf system resources' names. More... | |
Functions | |
| static int | isspace (int c) |
| Check for white-space characters. These are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). More... | |
| static int | isascii (int c) |
Check whether c is a 7-bit unsigned char value that fits into the ASCII character set. More... | |
| static int | isupper (int c) |
| Check for an uppercase letter. More... | |
| static int | islower (int c) |
| Check for an lowercase letter. More... | |
| static int | isalpha (int c) |
| Check for an alphabetic character; it is equivalent to (isupper(c) || islower(c)) More... | |
| static int | isdigit (int c) |
| Check for a digit (0 through 9) More... | |
| static int | isalnum (int c) |
| Check for an alphanumeric character; it is equivalent to (isalpha(c) || isdigit(c)). More... | |
| static int | isblank (int c) |
| Check for a blank character; that is, a space or a tab. More... | |
| static int | isxdigit (int c) |
| Check for hexadecimal digits, that is, one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F. More... | |
| static int | isprint (int c) |
| Check for any printable character including space. More... | |
| static int | isgraph (int c) |
| Check for any printable character except space. More... | |
| static int | ispunct (int c) |
| Check for any printable character which is not a space or an alphanumeric character. More... | |
| static int | iscntrl (int c) |
| Check for a control character. More... | |
| static int | toupper (int c) |
| Convert lowercase letter to uppercase. More... | |
| static int | tolower (int c) |
| Convert uppercase letter to lowercase. More... | |
| int * | get_errno_addr (void) |
| This function should NOT be used directly, use 'errno' instead. More... | |
| int | open (const char *pathname, int flags,...) |
| Open a device by specifying its namespace path. Device driver operations should be previously registered with the namespace framework. More... | |
| int | printf_no_alloc (const char *fmt,...) |
| Prints to ringbuffer. If resulting string exceeds AUTO_BUFFER_SIZE, cuts it off to AUTO_BUFFER_SIZE. More... | |
| int | sched_yield (void) |
| Causes the calling thread to relinquish the CPU. The thread is moved to the end of the queue for its static priority and a new thread gets to run. More... | |
| int | sched_setaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *mask) |
Sets the CPU affinity mask of the process whose ID is pid to the value specified by mask. If pid is zero, then the calling process is used. More... | |
| int | sched_getaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *mask) |
Writes the affinity mask of the process whose ID is pid into the cpu_set_t structure pointed to by mask. More... | |
| int | printf (const char *fmt,...) |
| Format and print string. More... | |
| int | fprintf (FILE *_restrict_ stream, const char *_restrict_ fmt,...) |
| The fprintf() is equivalent to the printf(), but uses a custom file handle. More... | |
| int | vfprintf (FILE *_restrict_ stream, const char *_restrict_ fmt, va_list ap) |
| The vfprintf() is equivalent to the fprintf(), but uses an argument list. More... | |
| int | fflush (FILE *stream) |
| Flush a stream. More... | |
| int | sprintf (char *s, const char *fmt,...) |
| format and string and save it to `s'. More... | |
| int | printf_s (const char *_restrict_ fmt,...) |
| format and print string. More... | |
| int | vsprintf_s (char *_restrict_ s, rsize_t n, const char *_restrict_ format, va_list arg) |
| Write formatted data from variable length argument list to string. More... | |
| int | vsnprintf_s (char *_restrict_ s, rsize_t n, const char *_restrict_ format, va_list arg) |
| Write formatted data from variable argument list to sized buffer. More... | |
| int | sprintf_s (char *_restrict_ s, rsize_t n, const char *_restrict_ format,...) |
| format string and save it to `s'. More... | |
| int | snprintf_s (char *_restrict_ s, rsize_t n, const char *_restrict_ format,...) |
| Format string and save it to `s'. More... | |
| int | sscanf_s (const char *_restrict_ s, const char *_restrict_ format,...) |
| Reads data safely from buf and stores them according to parameter fmt into the locations given by the additional arguments. More... | |
| int | vsscanf_s (const char *_restrict_ s, const char *_restrict_ format, va_list arg) |
| vsscanf unformat a buffer into a list of arguments. More... | |
| int | snprintf (char *s, size_t count, const char *fmt,...) |
| format and string and save it to `s'. More... | |
| int | vsprintf (char *buffer, const char *format, va_list args) |
| Write formatted data from variable argument list to string. More... | |
| int | vsnprintf (char *buffer, size_t size, const char *format, va_list args) |
| Write formatted data from variable argument list to sized buffer. More... | |
| int | sscanf (const char *buf, const char *fmt,...) |
| Reads data from buf and stores them according to parameter fmt into the locations given by the additional arguments. More... | |
| int | asprintf (char **strp, const char *fmt,...) |
| print to allocated string. More... | |
| int | vasprintf (char **strp, const char *fmt, va_list args) |
| print to allocated string. More... | |
| int | vasprintf_s (char **strp, const char *fmt, va_list args) |
| Print to allocated string in secure mode. More... | |
| int | putchar (int ch) |
| writes a character to log. More... | |
| int | puts (const char *s) |
| writes the string s and a trailing newline to log(dmesg). More... | |
| int | vsscanf (const char *buffer, const char *fmt, va_list args) |
| vsscanf unformat a buffer into a list of arguments. More... | |
| errno_t | memcpy_s (void *restrict dest, rsize_t dest_max, const void *restrict src, rsize_t n) |
Check arguments and copy src sized memory area to dest. Memory must not be overlapped. To copy overlapped area use memmove_s() function. More... | |
| errno_t | memmove_s (void *dest, rsize_t dest_max, const void *src, rsize_t n) |
Check arguments and copy src sized memory area to dest. Memory may be overlapped. More... | |
| errno_t | memset_s (void *block, rsize_t block_max, int c, rsize_t n) |
Check arguments and fill n bytes of block sized memory with c constant value. More... | |
| size_t | strnlen_s (const char *s, size_t s_max) |
Check arguments and calculate the length of the s fixed-size string, excluding the terminating null byte ('\0'). More... | |
| errno_t | strcpy_s (char *restrict dest, rsize_t dest_max, const char *restrict src) |
Check arguments and copy the src string, including the terminating null byte ('\0'), to the dest sized buffer. If n is bigger than size of src then the remaining characters (after '\0') are unspecified. More... | |
| errno_t | strncpy_s (char *restrict dest, rsize_t dest_max, const char *restrict src, rsize_t n) |
Check arguments and copy at most n bytes of the src string, including the terminating null byte ('\0') to the dest sized buffer. More... | |
| errno_t | strcat_s (char *restrict dest, rsize_t dest_max, const char *restrict src) |
Check arguments and append the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and add a terminating null byte. More... | |
| errno_t | strncat_s (char *restrict dest, rsize_t dest_max, const char *restrict src, rsize_t n) |
Check arguments and append at most n bytes of src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest and then adds a terminating null byte. More... | |
| errno_t | strerror_s (char *buf, rsize_t bufmax, errno_t errnum) |
Check arguments and return a pointer to a buf string that describes the errnum error code. More... | |
| void * | memcpy (void *dest, const void *src, size_t n) |
Copy memory area from src to dst. The memory must not overlap. To copy overlapped area use memmove() function. More... | |
| void * | memmove (void *dest, const void *src, size_t n) |
Copy memory area from src to dest. The memory may overlap. More... | |
| int | memcmp (const void *s1, const void *s2, size_t n) |
Compare fist n bytes of memory pointed by s1 and s2. More... | |
| void * | memset (void *block, int c, size_t size) |
Fill size bytes with a constant value. More... | |
| size_t | strlen (const char *s) |
Calculate the length of the string s, excluding the terminating null byte ('\0'). More... | |
| size_t | strnlen (const char *s, size_t n) |
Calculate the length of the fixed-size string s, excluding the terminating null byte ('\0'). More... | |
| char * | strcpy (char *dest, const char *src) |
Copy the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest. More... | |
| char * | strncpy (char *dest, const char *src, size_t n) |
Copy at most n bytes of the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest. More... | |
| char * | strdup (const char *s) |
Return a pointer to a new string which is a duplicate of the string s. Memory for the new string is obtained with malloc(). More... | |
| char * | strstr (const char *text, const char *pattern) |
Find the first occurrence of the substring pattern in the string text. The terminating null bytes ('\0') are not compared. More... | |
| char * | strncat (char *dest, const char *src, size_t n) |
Append the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte. More... | |
| size_t | strlcat (char *dest, const char *src, size_t n) |
Append the NUL-terminated string src to the end of dest string, overwriting the terminating null byte ('\0') at the end of dest, and guarantee to NUL-terminate the result. More... | |
| char * | strcat (char *dest, const char *src) |
Append the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte. More... | |
| int | strcmp (const char *s1, const char *s2) |
Compare the two strings s1 and s2. More... | |
| int | strncmp (const char *s1, const char *s2, size_t n) |
Compare at most n bytes of two strings s1 and s2. More... | |
| char * | strrchr (const char *s, int c) |
Find last occurence of character c in string s. More... | |
| const char * | strerror (int errnum) |
Return a pointer to a string that describes the error code passed in the argument errnum. More... | |
| void * | memchr (const void *s, int c, size_t n) |
| Find a character in an area of memory. More... | |
| void * | memrchr (const void *s, int c, size_t n) |
| Find a character in an area of memory. More... | |
| char * | strchr (const char *s, int c) |
Find first occurence of character c in string s. More... | |
| char * | strchrnul (const char *s, int c) |
Find first occurence of character c in string s. More... | |
| size_t | strspn (const char *s, const char *accept) |
| Calculate the length (in bytes) of the initial segment of s which consists entirely of bytes in accept. More... | |
| size_t | strcspn (const char *s, const char *reject) |
| Calculate the length of the initial segment of s which consists entirely of bytes not in reject. More... | |
| char * | strtok (char *str, const char *delim) |
| Function breaks a string into a sequence of zero or more nonempty tokens. More... | |
| char * | strtok_r (char *_restrict_ s, const char *_restrict_ sep, char **_restrict_ p) |
| Function breaks a string into a sequence of zero or more nonempty tokens. More... | |
| int | strerror_r (int errnum, char *buf, size_t buflen) |
Returns the error string in the user-supplied buf of length buflen. XSI-compliant version. More... | |
| int | ioctl (int fd, int request, unsigned long data) |
| Manipulates the underlying device parameters of special files. More... | |
| void * | mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) |
| int | munmap (void *addr, size_t length) |
| int | mprotect (void *addr, size_t len, int prot) |
| int | nanosleep (const struct timespec *req, struct timespec *rem) |
nanosleep() suspends the execution of the calling thread until either at least the time specified in *req has elapsed, or the delivery of a signal that triggers the invocation of a handler in the calling thread or that terminates the process. If the call is interrupted by a signal handler, nanosleep() returns -1, sets errno to EINTR, and writes the remaining time into the structure pointed to by rem unless rem is NULL. The value of *req can then be used to call nanosleep() again and complete the specified pause. More... | |
| int | clock_gettime (clockid_t clk_id, struct timespec *ts) |
The function retrieves the time of the specified clock clk_id. This function is non-blocking, except CLOCK_REE case. In this case function can sleep and can be interrupted with -1 result and EINTR errno. More... | |
| time_t | time (time_t *time) |
| Get the current calendar time as a value of type time_t. More... | |
| unsigned int | arm_timer_get_frequency (void) |
| The function retrieves the frequency of ARM timer. More... | |
| void | timeadd (const struct timespec *a, const struct timespec *b, struct timespec *res) |
| The function adds two dates. More... | |
| void | timesub (const struct timespec *a, const struct timespec *b, struct timespec *res) |
| The function subtracts two dates. More... | |
| int64_t | timespec_to_ms (const struct timespec *a) |
| The function converts time from timespec format to milliseconds. More... | |
| uint64_t | timespec_to_nsec (const struct timespec *a) |
| The function converts time from timespec format to nanoseconds. More... | |
| void | ms_to_timespec (int64_t t, struct timespec *a) |
| The function converts time in milliseconds to to timespec format. More... | |
| void | _exit (int status) |
| Terminate the calling process "immediately". Any open file descriptors belonging to the process are closed; process's parent is sent a SIGCHLD signal. More... | |
| int | profil (unsigned short *buf, size_t bufsiz, size_t offset, unsigned int scale) |
Provide a means to find out in what areas your program spends most of its time. The argument buf points to bufsiz bytes of core. Every virtual 10 milliseconds, the user's program counter (PC) is examined: offset is subtracted and the result is multiplied by scale and divided by 65536. If the resulting value is less than bufsiz, then the corresponding entry in buf is incremented. If buf is NULL, profiling is disabled. More... | |
| pid_t | getpid (void) |
| Return the process ID of the calling process. More... | |
| pid_t | gettid (void) |
| Return the thread ID of the calling thread. More... | |
| int | getcpu (void) |
| Return the number of CPU on which current thread is performed. More... | |
| int | getcluster (void) |
| Return the cluster id on which current thread is performed. More... | |
| int | rename (const char *pathname, const char *new_pathname) |
| Rename file. More... | |
| int | unlink (const char *pathname) |
| Remove a link to a file. More... | |
| int | ftruncate (int fd, int size) |
Cause file referenced by fd to be truncated to a size of precisely length bytes. More... | |
| int | rmdir (char *dir_name) |
| Remove a directory at file system. More... | |
| int | close (int fd) |
Deallocate the file descriptor indicated by fd. To deallocate means to make the file descriptor available for return by subsequent calls to open() or other functions that allocate file descriptors. All outstanding record locks owned by the process on the file associated with the file descriptor shall be removed (that is, unlocked). More... | |
| ssize_t | read (int fd, void *buf, size_t count) |
Attempt to read count bytes from the file associated with the open file descriptor, fd, into the buffer pointed to by buf. More... | |
| ssize_t | write (int fd, const void *buf, size_t count) |
Attempt to write count bytes from buffer pointed to by buf to the file associated with the open file descriptor, fd. More... | |
| int | fstat (int fd, struct stat *buf) |
Get status of a file with a descriptor fd. More... | |
| int | stat (const char *pathname, struct stat *buf) |
Get status of a file pathname. More... | |
| int | fsync (int fd) |
| Synchronize a file's in-core state with storage device. More... | |
| int | lseek (int fd, int offset, int whence) |
| Reposition read/write file offset. More... | |
| long | sysconf (int name) |
| Get configuration information at run time. More... | |
| void | uuid_unparse (const uuid_t *uu, char *out) |
| Convert binary representation of UUID to string. More... | |
| void | uuid_unparse_upper (const uuid_t *uu, char *out) |
| Convert binary representation of UUID to string. More... | |
| int | uuid_parse (const char *in, uuid_t *uu) |
| Convert an input UUID string into binary representation. More... | |
| void | uuid_generate (uuid_t *out) |
The uuid_generate function creates a new universally unique identifier (UUID). More... | |
| int | uuid_is_null (const uuid_t *uu) |
| Check if UUID is null. More... | |
| void | uuid_clear (uuid_t *uu) |
| set value to zero UUID. More... | |
| int | uuid_compare (const uuid_t *uu1, const uuid_t *uu2) |
Compare the two supplied uuid variables uu1 and uu2 to each other. More... | |
| constraint_handler_t | set_constraint_handler_s (constraint_handler_t handler) |
Set the handler to be handler. More... | |
| void | invoke_constraint_handler_s (const char *msg, const char *file, const char *function, uint32_t line, errno_t error) |
Print msg if constraint was caused. More... | |
| void | abort_handler_s (const char *restrict msg, void *restrict ptr, errno_t error) |
| Abort system if constraint was caused. More... | |
| void | ignore_handler_s (const char *restrict msg, void *restrict ptr, errno_t error) |
| Returns to the caller without performing any actions. More... | |
| void | exit (int status) |
Cause normal process termination and return the value of status & 0377 to the parent. More... | |
| static __inline__ int | abs (int j) |
Compute the absolute value of the integer argument __n. More... | |
| void | abort (void) |
| Cause abnormal process termination. | |
| long | strtol (const char *nptr, char **endptr, int base) |
Convert the initial part of the string in nptr to a long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. More... | |
| unsigned long | strtoul (const char *cp, char **endp, int base) |
Convert the initial part of the string in nptr to a unsigned long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. More... | |
| double | strtod (const char *nptr, char **endptr) |
the initial portion of the string pointed to by nptr to double. More... | |
| long long | strtoll (const char *nptr, char **endptr, int base) |
Convert the initial part of the string in nptr to a long long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. More... | |
| unsigned long long | strtoull (const char *cp, char **endp, int base) |
Convert the initial part of the string in nptr to a unsigned long long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. More... | |
| float | strtof (const char *nptr, char **endptr) |
the initial portion of the string pointed to by nptr to float. More... | |
| long double | strtold (const char *nptr, char **endptr) |
the initial portion of the string pointed to by nptr to long double. More... | |
| int | atexit (void(*func)(void)) |
| Register the given function to be called at normal process termination. More... | |
| void * | malloc (size_t size) |
Allocate size bytes and return a pointer to the allocated memory. More... | |
| void | free (void *ptr) |
Free the memory space pointer to by ptr. More... | |
| void * | calloc (size_t nmemb, size_t size) |
Allocate memory for an array of nmemb elements of size bytes each and return a pointer to the allocated memory. More... | |
| void * | realloc (void *ptr, size_t size) |
Change the size of the memory block pointed to by ptr to size bytes. More... | |
| void | qsort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) |
| Sort an array. More... | |
| void | qsort_r (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *, void *), void *arg) |
| Sort an array. More... | |
| int | atoi (const char *nptr) |
| Convert a string to an integer. More... | |
| double | atof (const char *nptr) |
| Convert a string to a double. More... | |
| char * | getenv (const char *name) |
| get an environment variable function stub More... | |
| int | unsetenv (const char *name) |
| delete environment variable function stub More... | |
| int | setenv (const char *name, const char *value, int overwrite) |
| change or add environment variable function stub More... | |
Variables | |
| FILE * | stdin |
| Standard input stream (stub). More... | |
| FILE * | stdout |
| Standard output stream. | |
| FILE * | stderr |
| Standard error stream. | |
| struct cpu_set_t |
| struct tm |
| struct __uuid_t |
| #define __CPUMASK | ( | cpu | ) | (1L << ((cpu) % BITS_PER_LONG)) |
#include <sched.h>
The value of cpu mask
| #define _POSIX_THREAD_KEYS_MAX 12 |
#include <limits.h>
The number of data keys per process.
POSIX requires to support at least 128 keys (Linux supports up to 1024), but we can't affort such luxury
| #define _POSIX_THREAD_THREADS_MAX 64 |
#include <limits.h>
The number of threads per process.
| #define _POSIX_THREADS 1 |
#include <limits.h>
Threads are supported.
| #define alloca _alloca |
#include <alloca.h>
Allocate memory that is automatically freed.
| [in] | size | of requested memory |
| #define assert | ( | expr | ) | __assert__(expr, __FILE__, __LINE__) |
#include <assert.h>
Abort the program if assertion is false.
| [in] | expr | expression to check |
expr == true - do nothingexpr != true - in debug mode terminates application | #define AUTO_BUFFER_SIZE 1024 |
#include <print_no_alloc.h>
Buffer size.
| #define BIT_PER_CPU (1) |
#include <sched.h>
The number cpu bits
| #define BITMAP_ELT | ( | cpu | ) | ((cpu) / BITS_PER_LONG) |
#include <sched.h>
The bit map element
| #define BITS_TO_CPU_MASK | ( | bits | ) | (((bits) + BITS_PER_LONG - 1) / BITS_PER_LONG) |
#include <sched.h>
The number bits of cpu mask
| #define CHAR_BIT 8 |
#include <limits.h>
Number of bits in a type char
| #define CPU_CLR | ( | cpu, | |
| cpusetp | |||
| ) |
#include <sched.h>
The macros for clear cpu
| #define CPU_ISSET | ( | cpu, | |
| cpusetp | |||
| ) |
#include <sched.h>
The macros for check is spu is set
| #define CPU_SET | ( | cpu, | |
| cpusetp | |||
| ) |
#include <sched.h>
The macros for set cpu to cpusetp
| #define CPU_ZERO | ( | cpusetp | ) |
| #define DECLARE_BITMAP | ( | name, | |
| bits | |||
| ) | unsigned long name[BITS_TO_CPU_MASK(bits)] |
#include <sched.h>
The short type of bitmap
| #define E2BIG 7 /* Argument list too long */ |
#include <core/error.h>
Argument list too long.
| #define EACCES 13 /* Permission denied */ |
#include <core/error.h>
Permission denied.
| #define EADDRINUSE 98 /* Address already in use */ |
#include <core/error.h>
Address already in use.
| #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ |
#include <core/error.h>
Cannot assign requested address.
| #define EADV 68 /* Advertise error */ |
#include <core/error.h>
Advertise error.
| #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ |
#include <core/error.h>
Address family not supported by protocol.
| #define EAGAIN 11 /* Try again */ |
#include <core/error.h>
Try again.
| #define EALREADY 114 /* Operation already in progress */ |
#include <core/error.h>
Operation already in progress.
| #define EBADE 52 /* Invalid exchange */ |
#include <core/error.h>
Invalid exchange.
| #define EBADF 9 /* Bad file number */ |
#include <core/error.h>
Bad file number.
| #define EBADFD 77 /* File descriptor in bad state */ |
#include <core/error.h>
File descriptor in bad state.
| #define EBADMSG 74 /* Not a data message */ |
#include <core/error.h>
Not a data message.
| #define EBADR 53 /* Invalid request descriptor */ |
#include <core/error.h>
Invalid request descriptor.
| #define EBADRQC 56 /* Invalid request code */ |
#include <core/error.h>
Invalid request code.
| #define EBADSLT 57 /* Invalid slot */ |
#include <core/error.h>
Invalid slot.
| #define EBFONT 59 /* Bad font file format */ |
#include <core/error.h>
Bad font file format.
| #define EBUSY 16 /* Device or resource busy */ |
#include <core/error.h>
Device or resource busy.
| #define ECANCELED 125 /* Operation canceled */ |
#include <core/error.h>
Operation canceled.
| #define ECHILD 10 /* No child processes */ |
#include <core/error.h>
No child processes.
| #define ECHRNG 44 /* Channel number out of range */ |
#include <core/error.h>
Channel number out of range.
| #define ECOMM 70 /* Communication error on send */ |
#include <core/error.h>
Communication error on send.
| #define ECONNABORTED 103 /* Software caused connection abort */ |
#include <core/error.h>
Software caused connection abort.
| #define ECONNREFUSED 111 /* Connection refused */ |
#include <core/error.h>
Connection refused.
| #define ECONNRESET 104 /* Connection reset by peer */ |
#include <core/error.h>
Connection reset by peer.
| #define EDEADLK 35 /* Resource deadlock would occur */ |
#include <core/error.h>
Resource deadlock would occur.
| #define EDEADLOCK EDEADLK |
#include <core/error.h>
Resource deadlock would occur.
| #define EDESTADDRREQ 89 /* Destination address required */ |
#include <core/error.h>
Destination address required.
| #define EDOM 33 /* Math argument out of domain of func */ |
#include <core/error.h>
Math argument out of domain of func.
| #define EDOTDOT 73 /* RFS specific error */ |
#include <core/error.h>
RFS specific error.
| #define EDQUOT 122 /* Quota exceeded */ |
#include <core/error.h>
Quota exceeded.
| #define EEXIST 17 /* File exists */ |
#include <core/error.h>
File exists.
| #define EFAULT 14 /* Bad address */ |
#include <core/error.h>
Bad address.
| #define EFBIG 27 /* File too large */ |
#include <core/error.h>
File too large.
| #define EHOSTDOWN 112 /* Host is down */ |
#include <core/error.h>
Host is down.
| #define EHOSTUNREACH 113 /* No route to host */ |
#include <core/error.h>
No route to host.
| #define EIDRM 43 /* Identifier removed */ |
#include <core/error.h>
Identifier removed.
| #define EILSEQ 84 /* Illegal byte sequence */ |
#include <core/error.h>
Illegal byte sequence.
| #define EINPROGRESS 115 /* Operation now in progress */ |
#include <core/error.h>
Operation now in progress.
| #define EINTR 4 /* Interrupted system call */ |
#include <core/error.h>
Interrupted system call.
| #define EINVAL 22 /* Invalid argument */ |
#include <core/error.h>
Invalid argument.
| #define EIO 5 /* I/O error */ |
#include <core/error.h>
I/O error.
| #define EISCONN 106 /* Transport endpoint is already connected */ |
#include <core/error.h>
Transport endpoint is already connected.
| #define EISDIR 21 /* Is a directory */ |
#include <core/error.h>
Is a directory.
| #define EISNAM 120 /* Is a named type file */ |
#include <core/error.h>
Is a named type file.
| #define EKEYREJECTED 127 /* Key was rejected by service */ |
#include <core/error.h>
Key was rejected by service.
| #define EL2HLT 51 /* Level 2 halted */ |
#include <core/error.h>
Level 2 halted.
| #define EL2NSYNC 45 /* Level 2 not synchronized */ |
#include <core/error.h>
Level 2 not synchronized.
| #define EL3HLT 46 /* Level 3 halted */ |
#include <core/error.h>
Level 3 halted.
| #define EL3RST 47 /* Level 3 reset */ |
#include <core/error.h>
Level 3 reset.
| #define ELIBACC 79 /* Can not access a needed shared library */ |
#include <core/error.h>
Can not access a needed shared library.
| #define ELIBBAD 80 /* Accessing a corrupted shared library */ |
#include <core/error.h>
Accessing a corrupted shared library.
| #define ELIBEXEC 83 /* Cannot exec a shared library directly */ |
#include <core/error.h>
Cannot exec a shared library directly.
| #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ |
#include <core/error.h>
Attempting to link in too many shared libraries.
| #define ELIBSCN 81 /* .lib section in a.out corrupted */ |
#include <core/error.h>
.lib section in a.out corrupted.
| #define ELNRNG 48 /* Link number out of range */ |
#include <core/error.h>
Link number out of range.
| #define ELOOP 40 /* Too many symbolic links encountered */ |
#include <core/error.h>
Too many symbolic links encountered.
| #define EMFILE 24 /* Too many open files */ |
#include <core/error.h>
Too many open files.
| #define EMLINK 31 /* Too many links */ |
#include <core/error.h>
Too many links.
| #define EMSGSIZE 90 /* Message too long */ |
#include <core/error.h>
Message too long.
| #define EMULTIHOP 72 /* Multihop attempted */ |
#include <core/error.h>
Multihop attempted.
| #define ENAMETOOLONG 36 /* File name too long */ |
#include <core/error.h>
File name too long.
| #define ENAVAIL 119 /* No XENIX semaphores available */ |
#include <core/error.h>
No XENIX semaphores available.
| #define ENETDOWN 100 /* Network is down */ |
#include <core/error.h>
Network is down.
| #define ENETRESET 102 /* Network dropped connection because of reset */ |
#include <core/error.h>
Network dropped connection because of reset.
| #define ENETUNREACH 101 /* Network is unreachable */ |
#include <core/error.h>
Network is unreachable.
| #define ENFILE 23 /* File table overflow */ |
#include <core/error.h>
File table overflow.
| #define ENOANO 55 /* No anode */ |
#include <core/error.h>
No anode.
| #define ENOBUFS 105 /* No buffer space available */ |
#include <core/error.h>
No buffer space available.
| #define ENOCSI 50 /* No CSI structure available */ |
#include <core/error.h>
No CSI structure available.
| #define ENODATA 61 /* No data available */ |
#include <core/error.h>
No data available.
| #define ENODEV 19 /* No such device */ |
#include <core/error.h>
No such device.
| #define ENOENT 2 /* No such file or directory */ |
#include <core/error.h>
No such file or directory.
| #define ENOEXEC 8 /* Exec format error */ |
#include <core/error.h>
Exec format error.
| #define ENOKEY 126 /* Required key not available */ |
#include <core/error.h>
Required key not available.
| #define ENOLCK 37 /* No record locks available */ |
#include <core/error.h>
No record locks available.
| #define ENOLINK 67 /* Link has been severed */ |
#include <core/error.h>
Link has been severed.
| #define ENOMEM 12 /* Out of memory */ |
#include <core/error.h>
Out of memory.
| #define ENOMSG 42 /* No message of desired type */ |
#include <core/error.h>
No message of desired type.
| #define ENONET 64 /* Machine is not on the network */ |
#include <core/error.h>
Machine is not on the network.
| #define ENOPKG 65 /* Package not installed */ |
#include <core/error.h>
Package not installed.
| #define ENOPROTOOPT 92 /* Protocol not available */ |
#include <core/error.h>
Protocol not available.
| #define ENOSPC 28 /* No space left on device */ |
#include <core/error.h>
No space left on device.
| #define ENOSR 63 /* Out of streams resources */ |
#include <core/error.h>
Out of streams resources.
| #define ENOSTR 60 /* Device not a stream */ |
#include <core/error.h>
Device not a stream.
| #define ENOSYS 38 /* Function not implemented */ |
#include <core/error.h>
Function not implemented.
| #define ENOTBLK 15 /* Block device required */ |
#include <core/error.h>
Block device required.
| #define ENOTCONN 107 /* Transport endpoint is not connected */ |
#include <core/error.h>
Transport endpoint is not connected.
| #define ENOTDIR 20 /* Not a directory */ |
#include <core/error.h>
Not a directory.
| #define ENOTEMPTY 39 /* Directory not empty */ |
#include <core/error.h>
Directory not empty.
| #define ENOTNAM 118 /* Not a XENIX named type file */ |
#include <core/error.h>
Not a XENIX named type file.
| #define ENOTRECOVERABLE 131 /* State not recoverable */ |
#include <core/error.h>
State not recoverable.
| #define ENOTSOCK 88 /* Socket operation on non-socket */ |
#include <core/error.h>
Socket operation on non-socket.
| #define ENOTTY 25 /* Not a typewriter */ |
#include <core/error.h>
Not a typewriter.
| #define ENOTUNIQ 76 /* Name not unique on network */ |
#include <core/error.h>
Name not unique on network.
| #define ENXIO 6 /* No such device or address */ |
#include <core/error.h>
No such device or address.
| #define EOF (-1) |
#include <stdio.h>
EOF - symbol signifying End Of File.
| #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ |
#include <core/error.h>
Operation not supported on transport endpoint.
| #define EOVERFLOW 75 /* Value too large for defined data type */ |
#include <core/error.h>
Value too large for defined data type.
| #define EPERM 1 /* Operation not permitted */ |
#include <core/error.h>
Operation not permitted.
| #define EPFNOSUPPORT 96 /* Protocol family not supported */ |
#include <core/error.h>
Protocol family not supported.
| #define EPIPE 32 /* Broken pipe */ |
#include <core/error.h>
Broken pipe.
| #define EPROTO 71 /* Protocol error */ |
#include <core/error.h>
Protocol error.
| #define EPROTONOSUPPORT 93 /* Protocol not supported */ |
#include <core/error.h>
Protocol not supported.
| #define EPROTOTYPE 91 /* Protocol wrong type for socket */ |
#include <core/error.h>
Protocol wrong type for socket.
| #define ERANGE 34 /* Math result not representable */ |
#include <core/error.h>
Math result not representable.
| #define EREMCHG 78 /* Remote address changed */ |
#include <core/error.h>
Remote address changed.
| #define EREMOTE 66 /* Object is remote */ |
#include <core/error.h>
Object is remote.
| #define EREMOTEIO 121 /* Remote I/O error */ |
#include <core/error.h>
Remote I/O error.
| #define ERESTART 85 /* Interrupted system call should be restarted */ |
#include <core/error.h>
Interrupted system call should be restarted.
| #define EROFS 30 /* Read-only file system */ |
#include <core/error.h>
Read-only file system.
| #define errno (*get_errno_addr()) |
#include <errno.h>
number of last error
Contains numeric code of last error, list of possible error codes is specified in POSIX.1-2001 or in core/error.h file.
| #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ |
#include <core/error.h>
Cannot send after transport endpoint shutdown.
| #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ |
#include <core/error.h>
Socket type not supported.
| #define ESPIPE 29 /* Illegal seek */ |
#include <core/error.h>
Illegal seek.
| #define ESRCH 3 /* No such process */ |
#include <core/error.h>
No such process.
| #define ESRMNT 69 /* Srmount error */ |
#include <core/error.h>
Srmount error.
| #define ESTALE 116 /* Stale file handle */ |
#include <core/error.h>
Stale file handle.
| #define ESTRPIPE 86 /* Streams pipe error */ |
#include <core/error.h>
Streams pipe error.
| #define ETIME 62 /* Timer expired */ |
#include <core/error.h>
Timer expired.
| #define ETIMEDOUT 110 /* Connection timed out */ |
#include <core/error.h>
Connection timed out.
| #define ETOOMANYREFS 109 /* Too many references: cannot splice */ |
#include <core/error.h>
Too many references: cannot splice.
| #define ETXTBSY 26 /* Text file busy */ |
#include <core/error.h>
Text file busy.
| #define EUCLEAN 117 /* Structure needs cleaning */ |
#include <core/error.h>
Structure needs cleaning.
| #define EUNATCH 49 /* Protocol driver not attached */ |
#include <core/error.h>
Protocol driver not attached.
| #define EUSERS 87 /* Too many users */ |
#include <core/error.h>
Too many users.
| #define EWOULDBLOCK EAGAIN /* Operation would block */ |
#include <core/error.h>
Operation would block.
| #define EXDEV 18 /* Cross-device link */ |
#include <core/error.h>
Cross-device link.
| #define EXFULL 54 /* Exchange full */ |
#include <core/error.h>
Exchange full.
| #define INT_MAX ((int)(~0U>>1)) |
#include <limits.h>
Maximum value for an object of type int. Minimum Acceptable Value: 2 147 483 647
| #define INT_MIN (-INT_MAX - 1) |
#include <limits.h>
Minimum value for an object of type int. Maximum Acceptable Value: -2 147 483 647
| #define LLONG_MAX ((long long)(~0ULL>>1)) |
#include <limits.h>
Maximum value for an object of type long long. Minimum Acceptable Value: +9223372036854775807
| #define LLONG_MIN ((long long)(-LLONG_MAX - 1)) |
#include <limits.h>
Minimum value for an object of type long long. Maximum Acceptable Value: -9223372036854775807
| #define LONG_MAX ((long)(~0UL>>1)) |
#include <limits.h>
Maximum value for an object of type long. Minimum Acceptable Value: +2 147 483 647
| #define LONG_MIN (-LONG_MAX - 1) |
#include <limits.h>
Minimum value for an object of type long. Maximum Acceptable Value: -2 147 483 647
| #define M_CACHE_PAGES 1 |
#include <malloc.h>
For setting number of pages that not to be munmapped to reuse them quickly again.
| #define MAP_ANONYMOUS (1 << 0) |
#include <core/mman.h>
The mapping is not backed by any file; its contents are initialized to zero.
| #define MAP_FAILED ((void *)-1) |
#include <sys/mman.h>
Error return value from mmap().
| #define MAP_FIXED (1 << 2) |
#include <core/mman.h>
Don't interpret addr as a hint: place the mapping at exactly that address. addr must be a multiple of the page size.
| #define MAP_GROWSDOWN (1 << 6) |
#include <core/mman.h>
This flag may be used with MAP_STACK. It indicates to the kernel virtual memory system that the mapping should extend downward in memory. mmap() calls will return the highest address on the stack.
| #define MAP_PHYS_NON_CACHED (1 << 28) |
#include <driver/mem/phys.h>
Memory will be mapped as non-cached.
| #define MAP_PHYS_NON_SECURE (1 << 29) |
#include <driver/mem/phys.h>
Non-secure memory region will be mapped.
| #define MAP_POPULATE (1 << 1) |
#include <core/mman.h>
Populate (prefault) page tables for a mapping.
| #define MAP_PRIVATE (1 << 3) |
#include <core/mman.h>
Create a private copy-on-write mapping. Updates to the mapping are not visible to other processes mapping the same file, and are not carried through to the underlying file.
| #define MAP_SHARED (1 << 4) |
#include <core/mman.h>
Share this mapping. Updates to the mapping are visible to other processes that map this file, and are carried through to the underlying file.
| #define MAP_STACK (1 << 5) |
#include <core/mman.h>
Allocate the mapping at an address suitable for a process or thread stack. Use for SafeStack mechanism.
| #define MAX_CPUS (32) |
#include <sched.h>
The maximum cpu number
| #define NUM_MILLIS_IN_SEC (1000) |
#include <time.h>
The number millisecond in second
| #define NUM_NANOS_IN_MILLI (1000000L) |
#include <time.h>
The number nanosecond in millisecond
| #define NUM_NANOS_IN_SEC (1000000000ULL) |
#include <time.h>
The number nanosecond in second
| #define NUM_NANOS_IN_USEC (1000) |
#include <time.h>
The number nanosecond in microsecond
| #define NUM_SECONDS_IN_MIN (60) |
#include <time.h>
The number second in minute
| #define PGOFF_SHIFT 12 |
#include <core/mman.h>
Offset shift.
| #define PRId16 __16_PREFIX "d" |
#include <inttypes.h>
Macro to be used in a format string to print the value of type int16_t
| #define PRId32 "d" |
#include <inttypes.h>
Macro to be used in a format string to print the value of type int32_t
| #define PRId64 __64_PREFIX "d" |
#include <inttypes.h>
Macro to be used in a format string to print the value of type int64_t
| #define PRIu16 __16_PREFIX "u" |
#include <inttypes.h>
Macro to be used in a format string to print the value of type uint16_t
| #define PRIu32 "u" |
#include <inttypes.h>
Macro to be used in a format string to print the value of type uint32_t
| #define PRIu64 __64_PREFIX "u" |
#include <inttypes.h>
Macro to be used in a format string to print the value of type uint64_t
| #define PRIx16 __16_PREFIX "x" |
#include <inttypes.h>
Macro to be used in a format string to scan the 16-bit value in hex
| #define PRIx32 "x" |
#include <inttypes.h>
Macro to be used in a format string to print the 32-bit value in hex
| #define PRIx64 __64_PREFIX "x" |
#include <inttypes.h>
Macro to be used in a format string to print the 64-bit value in hex
| #define PROT_EXEC 4 |
#include <core/mman.h>
Pages may be executed.
| #define PROT_NONE 0 |
#include <core/mman.h>
Pages may not be accessed.
| #define PROT_READ 1 |
#include <core/mman.h>
Pages may be read.
| #define PROT_WRITE 2 |
#include <core/mman.h>
Pages may be written.
| #define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX |
#include <limits.h>
Maximum number of data keys that can be created by a process. Minimum Acceptable Value: _POSIX_THREAD_KEYS_MAX
| #define SCHAR_MAX (127) |
#include <limits.h>
Maximum value for an object of type signed char. Minimum Acceptable Value: 127
| #define SCHAR_MIN (-128) |
#include <limits.h>
Minumum value for an object of type signed char. Maximum Acceptable Value: -128
| #define SCNd16 __16_PREFIX "d" |
#include <inttypes.h>
Macro to be used in a format string to scan the value of type int16_t
| #define SCNd32 "d" |
#include <inttypes.h>
Macro to be used in a format string to scan the value of type int32_t
| #define SCNd64 __64_PREFIX "d" |
#include <inttypes.h>
Macro to be used in a format string to scan the value of type int64_t
| #define SCNu16 __16_PREFIX "u" |
#include <inttypes.h>
Macro to be used in a format string to scan the value of type uint16_t
| #define SCNu32 "u" |
#include <inttypes.h>
Macro to be used in a format string to scan the value of type uint32_t
| #define SCNu64 __64_PREFIX "u" |
#include <inttypes.h>
Macro to be used in a format string to scan the value of type uint64_t
| #define SCNx16 __16_PREFIX "x" |
#include <inttypes.h>
Macro to be used in a format string to scan the 16-bit value in hex
| #define SCNx32 "x" |
#include <inttypes.h>
Macro to be used in a format string to scan the 32-bit value in hex
| #define SCNx64 __64_PREFIX "x" |
#include <inttypes.h>
Macro to be used in a format string to scan the 64-bit value in hex
| #define SHRT_MAX (32767) |
#include <limits.h>
Maximum value for an object of type signed short int. Minimum Acceptable Value: 32767
| #define SHRT_MIN (-32768) |
#include <limits.h>
Minimum value for an object of type signed short int. Maximum Acceptable Value: -32768
| #define TEMP_FAILURE_RETRY | ( | expression | ) |
#include <unistd.h>
Recall function if it was interrupted by signal.
| [in] | expression | macro argument. |
| #define UCHAR_MAX (255) |
#include <limits.h>
Maximum value for an object of type unsigned char. Minimum Acceptable Value: 255
| #define UINT_MAX (~0U) |
#include <limits.h>
Maximum value for an object of type unsigned. Minimum Acceptable Value: 4 294 967 295
| #define ULLONG_MAX (~0ULL) |
#include <limits.h>
Maximum value for an object of type unsigned long long. Minimum Acceptable Value: 18446744073709551615
| #define ULONG_MAX (~0UL) |
#include <limits.h>
Maximum value for an object of type unsigned long. Minimum Acceptable Value: 4 294 967 295
| #define USHRT_MAX (0xFFFFU) |
#include <limits.h>
Maximum value for an object of type unsigned short. Minimum Acceptable Value: 65 535
| #define uuid_generate_time | ( | x | ) | uuid_generate(x) |
#include <uuid/uuid.h>
The uuid_generate function creates a new universally unique identifier (UUID). based on secure timer value.
| #define UUID_STRING_LEN 37 |
#include <uuid/uuid.h>
Length of string representation of UUID in format (with terminating '\0'): xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
| #define uuid_unparse_lower | ( | uu, | |
| out | |||
| ) | uuid_unparse((uu), (out)) |
#include <uuid/uuid.h>
Convert binary representation of UUID to string in lowercase format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
#include <uuid/uuid.h>
Provide UUID type as the structure.
| constraint_handler_t |
#include <stdlib.h>
Used for runtime-constraint handler description.
#include <errno.h>
Used for error description in safe C functions (*_s). See Annex K of C11 standard.
#include <sys/types.h>
Used for groups IDs.
#include <sys/types.h>
Used for some file attributes.
#include <sys/types.h>
Used for file sizes.
#include <sys/types.h>
Used for process IDs.
#include <sys/types.h>
Used for a count of bytes or an error indication.
#include <sys/types.h>
Used for time in seconds.
#include <sys/types.h>
Used for user IDs.
#include <uuid/uuid.h>
Provide UUID type for users.
| anonymous enum |
#include <unistd.h>
sysconf system resources' names.
| void _exit | ( | int | status | ) |
#include <unistd.h>
Terminate the calling process "immediately". Any open file descriptors belonging to the process are closed; process's parent is sent a SIGCHLD signal.
Cause process termination without calling of functions registered with atexit() and return the value of status & 0377 to the parent.
| [in] | status | value to return to parent process. |
| [in] | status | function argument. |
| void abort_handler_s | ( | const char *restrict | msg, |
| void *restrict | ptr, | ||
| errno_t | error | ||
| ) |
#include <stdlib.h>
Abort system if constraint was caused.
| [in] | msg | pointer to the error message. |
| [in] | ptr | pointer to an implementation-defined object or a NULL. |
| [in] | error | positive value of type errno_t. |
|
static |
#include <stdlib.h>
Compute the absolute value of the integer argument __n.
| [in] | j | function argument. |
| unsigned int arm_timer_get_frequency | ( | void | ) |
#include <time.h>
The function retrieves the frequency of ARM timer.
| frequency | of ARM timer in HZ. |
| int asprintf | ( | char ** | strp, |
| const char * | fmt, | ||
| ... | |||
| ) |
#include <stdio.h>
print to allocated string.
| [out] | strp | Pointer to newly allocated string or NULL(if the function failed). |
| [in] | fmt | Format string. |
| [in,out] | ... | Variable arguments for printing. |
The functions asprintf() and vasprintf() are analogs of sprintf() and vsprintf(), except that they allocate a string large enough to hold the output including the terminating null byte, and return a pointer to it via the first argument. This pointer should be passed to free() to release the allocated storage when it is no longer needed.
These functions are TEEGRIS extensions, not in C or POSIX. They are also available under *BSD and GNU/Linux. The GNU/Linux implementation leaves strp in undefined state in case of error.
| >=0 | number of bytes printed if succeed |
| -1 | if failed, and set strp to NULL |
| int atexit | ( | void(*)(void) | func | ) |
#include <stdlib.h>
Register the given function to be called at normal process termination.
| [in] | func | pointer to the function. |
| double atof | ( | const char * | nptr | ) |
#include <stdlib.h>
Convert a string to a double.
| [in] | nptr | pointer to the string |
| Converted | value |
| int atoi | ( | const char * | nptr | ) |
#include <stdlib.h>
Convert a string to an integer.
| [in] | nptr | pointer to the string |
| Converted | value |
| void* calloc | ( | size_t | nmemb, |
| size_t | size | ||
| ) |
#include <stdlib.h>
Allocate memory for an array of nmemb elements of size bytes each and return a pointer to the allocated memory.
| [in] | nmemb | function argument. |
| [in] | size | function argument. |
| int clock_gettime | ( | clockid_t | clk_id, |
| struct timespec * | ts | ||
| ) |
#include <time.h>
The function retrieves the time of the specified clock clk_id. This function is non-blocking, except CLOCK_REE case. In this case function can sleep and can be interrupted with -1 result and EINTR errno.
| [in] | clk_id | Specified clock. |
| [out] | ts | timespec structs argument. |
| 0 | on success. |
| -1 | on failure. errno variable is set appropriately. |
| int close | ( | int | fd | ) |
#include <unistd.h>
Deallocate the file descriptor indicated by fd. To deallocate means to make the file descriptor available for return by subsequent calls to open() or other functions that allocate file descriptors. All outstanding record locks owned by the process on the file associated with the file descriptor shall be removed (that is, unlocked).
| [in] | fd | file descriptor. |
| 0 | on success. |
| -1 | on error. errno is set appropriately. |
| void exit | ( | int | status | ) |
#include <stdlib.h>
Cause normal process termination and return the value of status & 0377 to the parent.
| [in] | status | function argument. |
| int fflush | ( | FILE * | stream | ) |
#include <stdio.h>
Flush a stream.
| [in] | stream | A writeable file handle. |
| =0 | if succeed. |
| EOF | if error occurred. |
| int fprintf | ( | FILE *_restrict_ | stream, |
| const char *_restrict_ | fmt, | ||
| ... | |||
| ) |
#include <stdio.h>
The fprintf() is equivalent to the printf(), but uses a custom file handle.
| [in] | stream | A writeable file handle. |
| [in] | fmt | Format specification of output string. |
| [in,out] | ... | Arguments used for printing. |
| >=0 | number of characters printed if succeed. |
| -1 | if error occurred. |
Example:
| void free | ( | void * | ptr | ) |
| int fstat | ( | int | fd, |
| struct stat * | buf | ||
| ) |
| int fsync | ( | int | fd | ) |
| int ftruncate | ( | int | fd, |
| int | size | ||
| ) |
| int* get_errno_addr | ( | void | ) |
| int getcluster | ( | void | ) |
#include <unistd.h>
Return the cluster id on which current thread is performed.
| int getcpu | ( | void | ) |
#include <unistd.h>
Return the number of CPU on which current thread is performed.
| char* getenv | ( | const char * | name | ) |
#include <stdlib.h>
get an environment variable function stub
| [in] | name | environment variable name |
| NULL |
| pid_t getpid | ( | void | ) |
| pid_t gettid | ( | void | ) |
| void ignore_handler_s | ( | const char *restrict | msg, |
| void *restrict | ptr, | ||
| errno_t | error | ||
| ) |
#include <stdlib.h>
Returns to the caller without performing any actions.
| [in] | msg | pointer to the error message. |
| [in] | ptr | pointer to an implementation-defined object or a NULL. |
| [in] | error | positive value of type errno_t. |
| void invoke_constraint_handler_s | ( | const char * | msg, |
| const char * | file, | ||
| const char * | function, | ||
| uint32_t | line, | ||
| errno_t | error | ||
| ) |
#include <stdlib.h>
Print msg if constraint was caused.
| [in] | msg | pointer to the error message. |
| [in] | file | name of file where constraint was caused. |
| [in] | function | name of function where constraint was caused. |
| [in] | line | number of line where constraint was caused. |
| [in] | error | positive value of type errno_t. |
| int ioctl | ( | int | fd, |
| int | request, | ||
| unsigned long | data | ||
| ) |
#include <sys/ioctl.h>
Manipulates the underlying device parameters of special files.
| [in] | fd | Open file descriptor. |
| [in] | request | Device-dependent request code. |
| [in,out] | data | Optional data associated with request. |
Performs a variety of control functions on a device opened by open() system call. The request argument and an optional third argument (of varying type) are device driver implementation-defined. Example:
|
static |
#include <ctype.h>
Check for an alphanumeric character; it is equivalent to (isalpha(c) || isdigit(c)).
| [in] | c | symbol for checking |
c is an alphanumeric character;
|
static |
#include <ctype.h>
Check for an alphabetic character; it is equivalent to (isupper(c) || islower(c))
| [in] | c | symbol for checking |
c is an alphabetic character;
|
static |
#include <ctype.h>
Check whether c is a 7-bit unsigned char value that fits into the ASCII character set.
| [in] | c | symbol for checking |
c is a 7-bit US-ASCII character code between 0 and octal 0177 inclusive;
|
static |
#include <ctype.h>
Check for a blank character; that is, a space or a tab.
| [in] | c | symbol for checking |
c is a blank character;
|
static |
#include <ctype.h>
Check for a control character.
| [in] | c | symbol for checking |
c is a control character;
|
static |
#include <ctype.h>
Check for a digit (0 through 9)
| [in] | c | symbol for checking |
c is a decimal digit character;
|
static |
#include <ctype.h>
Check for any printable character except space.
| [in] | c | symbol for checking |
c is a character with a visible representation;
|
static |
#include <ctype.h>
Check for an lowercase letter.
| [in] | c | symbol for checking |
|
static |
#include <ctype.h>
Check for any printable character including space.
| [in] | c | symbol for checking |
c is a printable character;
|
static |
#include <ctype.h>
Check for any printable character which is not a space or an alphanumeric character.
| [in] | c | symbol for checking |
c is a punctuation character;
|
static |
#include <ctype.h>
Check for white-space characters. These are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
| [in] | c | symbol for checking |
c is a white-space character;
|
static |
#include <ctype.h>
Check for an uppercase letter.
| [in] | c | symbol for checking |
c is an uppercase letter;
|
static |
#include <ctype.h>
Check for hexadecimal digits, that is, one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F.
| [in] | c | symbol for checking |
c is a hexadecimal digit character;| int lseek | ( | int | fd, |
| int | offset, | ||
| int | whence | ||
| ) |
#include <unistd.h>
Reposition read/write file offset.
Available modes:
offset bytes.offset bytes.offset bytes.| [in] | fd | File descriptor. |
| [in] | offset | New offset value. |
| [in] | whence | Mode of operation. |
| void* malloc | ( | size_t | size | ) |
#include <stdlib.h>
Allocate size bytes and return a pointer to the allocated memory.
| [in] | size | - size of memory to be allocated. |
| void* memchr | ( | const void * | s, |
| int | c, | ||
| size_t | n | ||
| ) |
#include <string.h>
Find a character in an area of memory.
| [in] | s | pointer to the memory area. |
| [in] | c | the byte to search for. |
| [in] | n | the size of the area. |
c, or NULL. | int memcmp | ( | const void * | s1, |
| const void * | s2, | ||
| size_t | n | ||
| ) |
#include <string.h>
Compare fist n bytes of memory pointed by s1 and s2.
| [in] | s1 | fist memory region to compare. |
| [in] | s2 | second memory region to compare. |
| [in] | n | number of bytes to compare. |
| 0 | memory regions have the same values. |
| <0 | region s1 has lower value than s2. |
| >0 | region s1 has greater value than s2. |
| void* memcpy | ( | void * | dest, |
| const void * | src, | ||
| size_t | n | ||
| ) |
| errno_t memcpy_s | ( | void *restrict | dest, |
| rsize_t | dest_max, | ||
| const void *restrict | src, | ||
| rsize_t | n | ||
| ) |
#include <string.h>
Check arguments and copy src sized memory area to dest. Memory must not be overlapped. To copy overlapped area use memmove_s() function.
| [out] | dest | destination area. |
| [in] | dest_max | max number of bytes to modify in the dest. |
| [in] | src | source area. |
| [in] | n | number of bytes to copy. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| void* memmove | ( | void * | dest, |
| const void * | src, | ||
| size_t | n | ||
| ) |
#include <string.h>
Copy memory area from src to dest. The memory may overlap.
| [out] | dest | destination area. |
| [in] | src | source area. |
| [in] | n | number of bytes to copy. |
dest area. | errno_t memmove_s | ( | void * | dest, |
| rsize_t | dest_max, | ||
| const void * | src, | ||
| rsize_t | n | ||
| ) |
#include <string.h>
Check arguments and copy src sized memory area to dest. Memory may be overlapped.
| [out] | dest | destination area. |
| [in] | dest_max | max number of bytes to modify in the dest. |
| [in] | src | source area. |
| [in] | n | number of bytes to copy. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| void* memrchr | ( | const void * | s, |
| int | c, | ||
| size_t | n | ||
| ) |
#include <string.h>
Find a character in an area of memory.
| [in] | s | pointer to the memory area. |
| [in] | c | the byte to search for. |
| [in] | n | the size of the area. |
c, or NULL. | void* memset | ( | void * | block, |
| int | c, | ||
| size_t | size | ||
| ) |
#include <string.h>
Fill size bytes with a constant value.
| [out] | block | address of memory region to be filled. |
| [in] | c | value to fill. |
| [in] | size | number of bytes to fill. |
block area. | errno_t memset_s | ( | void * | block, |
| rsize_t | block_max, | ||
| int | c, | ||
| rsize_t | n | ||
| ) |
#include <string.h>
Check arguments and fill n bytes of block sized memory with c constant value.
| [out] | block | address of memory region to be filled. |
| [in] | block_max | max number of bytes for copy to block. |
| [in] | c | value to fill. |
| [in] | n | number of bytes to fill. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| void* mmap | ( | void * | addr, |
| size_t | len, | ||
| int | prot, | ||
| int | flags, | ||
| int | fd, | ||
| off_t | offset | ||
| ) |
#include <sys/mman.h>
The mmap() function establishes a mapping between a process' address space and a file or shared memory object.
| [in] | addr | starting address. |
| [in] | len | specify the length of the mapping. |
| [in] | prot | Describes the desired memory protection of the mapping Protection flags are defined in core/mman.h header. Possible values:
|
| [in] | flags | Provides other information about the handling of the mapped data. All flags except MAP_PHYS_NON_SECURE and MAP_PHYS_NON_CACHED are defined in core/mman.h header. Possible values:
|
| [in] | fd | file descriptor. |
| [in] | offset | offset. |
Example:
| int mprotect | ( | void * | addr, |
| size_t | len, | ||
| int | prot | ||
| ) |
#include <sys/mman.h>
Changes permission of memory region.
| [in] | addr | address where memory was previously mapped. |
| [in] | len | size of the memory area. |
| [in] | prot | new protection flags. |
| 0 | no error. |
| -1 | on failure. errno variable is set appropriately.
|
| void ms_to_timespec | ( | int64_t | t, |
| struct timespec * | a | ||
| ) |
#include <time.h>
The function converts time in milliseconds to to timespec format.
| [in] | t | time in milliseconds. |
| [out] | a | Pointer to timespec structure to save result. |
| int munmap | ( | void * | addr, |
| size_t | length | ||
| ) |
#include <sys/mman.h>
Tries to unmap memory area at addr of length bytes previously allocated and mmaped by mmap() system call.
| [in] | addr | address where memory was previously mapped. |
| [in] | length | size of the memory area. |
| 0 | no error. |
| -1 | on failure. errno variable is set appropriately. |
Example:
| int nanosleep | ( | const struct timespec * | req, |
| struct timespec * | rem | ||
| ) |
#include <time.h>
nanosleep() suspends the execution of the calling thread until either at least the time specified in *req has elapsed, or the delivery of a signal that triggers the invocation of a handler in the calling thread or that terminates the process. If the call is interrupted by a signal handler, nanosleep() returns -1, sets errno to EINTR, and writes the remaining time into the structure pointed to by rem unless rem is NULL. The value of *req can then be used to call nanosleep() again and complete the specified pause.
| [in] | req | Pointer to requested time. |
| [in] | rem | Pointer to remained time. |
| 0 | on success. |
| -1 | on failure. errno variable is set appropriately. |
Example:
| int open | ( | const char * | pathname, |
| int | flags, | ||
| ... | |||
| ) |
#include <fcntl.h>
Open a device by specifying its namespace path. Device driver operations should be previously registered with the namespace framework.
| [in] | pathname | namespace path for specific device |
| [in] | flags | file access mode |
| [in] | ... | (optional) file mode |
| >0 | a descriptor associated with the device. |
| -1 | on error and sets errno to appropriated value: |
Example:
| int printf | ( | const char * | fmt, |
| ... | |||
| ) |
#include <stdio.h>
Format and print string.
| [in] | fmt | Format specification of output string. |
| [in,out] | ... | Arguments used for printing. |
| >=0 | number of characters printed if succeed. |
| -1 | if error occurred. |
Example:
| int printf_no_alloc | ( | const char * | fmt, |
| ... | |||
| ) |
#include <print_no_alloc.h>
Prints to ringbuffer. If resulting string exceeds AUTO_BUFFER_SIZE, cuts it off to AUTO_BUFFER_SIZE.
| [in] | fmt | Format specification of output string. |
| [in,out] | ... | Arguments used for printing. |
| >=0 | number of characters printed if succeed. |
| -1 | if error occurred. |
Example:
| int printf_s | ( | const char *_restrict_ | fmt, |
| ... | |||
| ) |
#include <stdio.h>
format and print string.
| [in] | fmt | Format specification of output string. |
| [in] | ... | Arguments used for printing. |
| >=0 | number of characters printed if succeed. |
| -1 | if error occurred. |
| int profil | ( | unsigned short * | buf, |
| size_t | bufsiz, | ||
| size_t | offset, | ||
| unsigned int | scale | ||
| ) |
#include <unistd.h>
Provide a means to find out in what areas your program spends most of its time. The argument buf points to bufsiz bytes of core. Every virtual 10 milliseconds, the user's program counter (PC) is examined: offset is subtracted and the result is multiplied by scale and divided by 65536. If the resulting value is less than bufsiz, then the corresponding entry in buf is incremented. If buf is NULL, profiling is disabled.
| [in] | buf | function argument. |
| [in] | bufsiz | function argument. |
| [in] | offset | function argument. |
| [in] | scale | function argument. |
| int putchar | ( | int | ch | ) |
| int puts | ( | const char * | s | ) |
| void qsort | ( | void * | base, |
| size_t | nmemb, | ||
| size_t | size, | ||
| int(*)(const void *, const void *) | compar | ||
| ) |
#include <stdlib.h>
Sort an array.
| [in,out] | base | pointer to start of the array. |
| [in] | nmemb | number or elements in array. |
| [in] | size | size of each element in array. |
| [in] | compar | comparison function. |
| void qsort_r | ( | void * | base, |
| size_t | nmemb, | ||
| size_t | size, | ||
| int(*)(const void *, const void *, void *) | compar, | ||
| void * | arg | ||
| ) |
#include <stdlib.h>
Sort an array.
| [in,out] | base | pointer to start of the array. |
| [in] | nmemb | number or elements in array. |
| [in] | size | size of each element in array. |
| [in] | compar | comparison function. |
| [in] | arg | argument, which passed directly as 3-rd parameter to compar. |
| ssize_t read | ( | int | fd, |
| void * | buf, | ||
| size_t | count | ||
| ) |
#include <unistd.h>
Attempt to read count bytes from the file associated with the open file descriptor, fd, into the buffer pointed to by buf.
| [in] | fd | File descriptor. |
| [out] | buf | Pointer to buffer to write. |
| [in] | count | Number of bytes to read. |
| void* realloc | ( | void * | ptr, |
| size_t | size | ||
| ) |
#include <stdlib.h>
Change the size of the memory block pointed to by ptr to size bytes.
ptr is NULL, then the call is equivalent to malloc(size), for all values of size; if size is equal to zero, and ptr is not NULL, then the call is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to malloc(), calloc() or realloc(). If the area pointed to was moved, a free(ptr) is done. If realloc() fails, the original block is left untouched; it is not freed or moved. | [in] | ptr | function argument. |
| [in] | size | function argument. |
| address | pointer to the newly allocated memory, which is properly aligned for any built-in type and may be different from ptr. |
| NULL | if the request fails.
|
| int rename | ( | const char * | pathname, |
| const char * | new_pathname | ||
| ) |
| int rmdir | ( | char * | dir_name | ) |
#include <sched.h>
Writes the affinity mask of the process whose ID is pid into the cpu_set_t structure pointed to by mask.
| [in] | pid | process ID. |
| [in] | cpusetsize | size (in bytes) of mask. |
| [in,out] | mask | pointer to CPU affinity mask. |
| 0 | function completed work with success. |
| -1 | function completed work with error and errno is set appropriately. |
#include <sched.h>
Sets the CPU affinity mask of the process whose ID is pid to the value specified by mask. If pid is zero, then the calling process is used.
| [in] | pid | process ID. |
| [in] | cpusetsize | the length (in bytes) of the data pointed to by mask. |
| [in,out] | mask | pointer to CPU affinity mask. |
| 0 | function completed work with success. |
| -1 | function completed work with error and errno is set appropriately. |
| int sched_yield | ( | void | ) |
#include <sched.h>
Causes the calling thread to relinquish the CPU. The thread is moved to the end of the queue for its static priority and a new thread gets to run.
| 0 | function completed work with success. |
| -1 | function completed work with error and errno is set appropriately. |
| constraint_handler_t set_constraint_handler_s | ( | constraint_handler_t | handler | ) |
#include <stdlib.h>
Set the handler to be handler.
| [in] | handler | runtime-constraint handler. |
| int setenv | ( | const char * | name, |
| const char * | value, | ||
| int | overwrite | ||
| ) |
#include <stdlib.h>
change or add environment variable function stub
| [in] | name | environment variable name |
| [in] | value | new value for environment variable |
| [in] | overwrite | replace variable's value to new if name exists |
| 0 |
| int snprintf | ( | char * | s, |
| size_t | count, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
#include <stdio.h>
format and string and save it to `s'.
| [out] | s | Pointer to an array of char elements where the resulting string will be stored. |
| [in] | count | size of s in bytes. |
| [in] | fmt | Format specification of output string. |
| [in,out] | ... | Arguments used for printing. |
| number | of characters printed. |
| number | of characters printed if succeed. |
| -1 | if error occurred. |
Example:
| int snprintf_s | ( | char *_restrict_ | s, |
| rsize_t | n, | ||
| const char *_restrict_ | format, | ||
| ... | |||
| ) |
#include <stdio.h>
Format string and save it to `s'.
| [out] | s | Pointer to an array of char elements where the resulting string will be stored. |
| [in] | n | Size of s in bytes. |
| [in] | format | Format specification of output string. |
| [in] | ... | Arguments used for printing. |
| number | Number of characters printed if succeed. |
| -1 | if error occurred. |
| int sprintf | ( | char * | s, |
| const char * | fmt, | ||
| ... | |||
| ) |
#include <stdio.h>
format and string and save it to `s'.
| [out] | s | Pointer to an array of char elements where the resulting string will be stored. |
| [in] | fmt | Format specification of output string. |
| [in,out] | ... | Arguments used for printing. |
| number | of characters printed if succeed. |
| -1 | if error occurred. |
Example:
| int sprintf_s | ( | char *_restrict_ | s, |
| rsize_t | n, | ||
| const char *_restrict_ | format, | ||
| ... | |||
| ) |
#include <stdio.h>
format string and save it to `s'.
| [out] | s | Pointer to an array of char elements where the resulting string will be stored. |
| [in] | n | Size of s in bytes. |
| [in] | format | Format specification of output string. |
| [in] | ... | Arguments used for printing. |
| number | of characters printed if succeed. |
| -1 | if encoding error occurred. |
| 0 | if constrain violation occurred. |
| int sscanf | ( | const char * | buf, |
| const char * | fmt, | ||
| ... | |||
| ) |
#include <stdio.h>
Reads data from buf and stores them according to parameter fmt into the locations given by the additional arguments.
| [in] | buf | Pointer to C string that the function processes as its source to retrieve the data. |
| [in] | fmt | Pointer to C string that contains a format string that follows the same specifications as format in scanf. |
| number | of items read, This count can match the expected number of items or be less (even zero) in the case of a matching failure. |
| EOF | in case of an input failure before any data could be successfully interpreted. |
Example:
| int sscanf_s | ( | const char *_restrict_ | s, |
| const char *_restrict_ | format, | ||
| ... | |||
| ) |
#include <stdio.h>
Reads data safely from buf and stores them according to parameter fmt into the locations given by the additional arguments.
| [in] | s | Pointer to C string that the function processes as its source to retrieve the data. |
| [in] | format | Pointer to C string that contains a format string that follows the same specifications as format in scanf. |
| number | of items read, this count can match the expected number of items or be less (even zero) in the case of a matching failure. |
| EOF | in case of an input failure before any data could be successfully interpreted. |
| char* strcat | ( | char * | dest, |
| const char * | src | ||
| ) |
#include <string.h>
Append the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte.
| [in,out] | dest | Pointer to string to append. |
| [in] | src | Pointer to source string. |
dest.Example:
| errno_t strcat_s | ( | char *restrict | dest, |
| rsize_t | dest_max, | ||
| const char *restrict | src | ||
| ) |
#include <string.h>
Check arguments and append the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and add a terminating null byte.
| [in,out] | dest | Pointer to string to append. |
| [in] | dest_max | max number of bytes to modify in the dest. |
| [in] | src | Pointer to source string. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| char* strchr | ( | const char * | s, |
| int | c | ||
| ) |
#include <string.h>
Find first occurence of character c in string s.
| [in] | s | Pointer to string to search in. |
| [in] | c | character to seach. |
NULL if not found.Example:
| char* strchrnul | ( | const char * | s, |
| int | c | ||
| ) |
#include <string.h>
Find first occurence of character c in string s.
| [in] | s | Pointer to string to search in. |
| [in] | c | character to seach. |
| int strcmp | ( | const char * | s1, |
| const char * | s2 | ||
| ) |
#include <string.h>
Compare the two strings s1 and s2.
| [in] | s1 | Pointer to first string to compare. |
| [in] | s2 | Pointer to second string to compare. |
| 0 | strings are equal. |
| <0 | string s1 has lower value than s2. |
| >0 | string s1 has greater value than s2. |
Example:
| char* strcpy | ( | char * | dest, |
| const char * | src | ||
| ) |
#include <string.h>
Copy the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest.
| [out] | dest | pointer to destination string. |
| [in] | src | pointer to source string. |
dest.Example:
| errno_t strcpy_s | ( | char *restrict | dest, |
| rsize_t | dest_max, | ||
| const char *restrict | src | ||
| ) |
#include <string.h>
Check arguments and copy the src string, including the terminating null byte ('\0'), to the dest sized buffer. If n is bigger than size of src then the remaining characters (after '\0') are unspecified.
| [out] | dest | pointer to destination string. |
| [in] | dest_max | max number of bytes to modify in the dest. |
| [in] | src | pointer to source string. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| size_t strcspn | ( | const char * | s, |
| const char * | reject | ||
| ) |
#include <string.h>
Calculate the length of the initial segment of s which consists entirely of bytes not in reject.
| [in] | s | Pointer to string to search in. |
| [in] | reject | String containing the characters not to match. |
| char* strdup | ( | const char * | s | ) |
| const char* strerror | ( | int | errnum | ) |
#include <string.h>
Return a pointer to a string that describes the error code passed in the argument errnum.
| [in] | errnum | error code. |
| int strerror_r | ( | int | errnum, |
| char * | buf, | ||
| size_t | buflen | ||
| ) |
#include <string.h>
Returns the error string in the user-supplied buf of length buflen. XSI-compliant version.
| [in] | errnum | Error code. |
| [in] | buf | Pointer to the buffer. |
| [in] | buflen | Buffer length. |
| 0 | on success. |
| -1 | on error and errno is set. |
#include <string.h>
Check arguments and return a pointer to a buf string that describes the errnum error code.
| [in] | buf | pointer to a user-provided buffer. |
| [in] | bufmax | max size of a user-provided buffer. |
| [in] | errnum | error code. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| size_t strlcat | ( | char * | dest, |
| const char * | src, | ||
| size_t | n | ||
| ) |
#include <string.h>
Append the NUL-terminated string src to the end of dest string, overwriting the terminating null byte ('\0') at the end of dest, and guarantee to NUL-terminate the result.
| [in,out] | dest | Pointer to string to append. |
| [in] | src | Pointer to source string. |
| [in] | n | Maximal number of bytes to copy if string does not have \0 terminator. |
Example:
| size_t strlen | ( | const char * | s | ) |
| char* strncat | ( | char * | dest, |
| const char * | src, | ||
| size_t | n | ||
| ) |
#include <string.h>
Append the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte.
| [in,out] | dest | Pointer to string to append. |
| [in] | src | Pointer to source string. |
| [in] | n | maximal number of bytes to copy if string does not have \0 terminator. |
dest.Example:
| errno_t strncat_s | ( | char *restrict | dest, |
| rsize_t | dest_max, | ||
| const char *restrict | src, | ||
| rsize_t | n | ||
| ) |
#include <string.h>
Check arguments and append at most n bytes of src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest and then adds a terminating null byte.
| [in,out] | dest | Pointer to string to append. |
| [in] | dest_max | max number of bytes to modify in the dest. |
| [in] | src | Pointer to source string. |
| [in] | n | maximal number of bytes to copy if string does not have \0 terminator. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| int strncmp | ( | const char * | s1, |
| const char * | s2, | ||
| size_t | n | ||
| ) |
#include <string.h>
Compare at most n bytes of two strings s1 and s2.
| [in] | s1 | Pointer to first string to compare. |
| [in] | s2 | Pointer to second string to compare. |
| [in] | n | maximal number of bytes to compare if string does not have \0 terminator. |
| 0 | strings are equal. |
| <0 | string s1 has lower value than s2. |
| >0 | string s1 has greater value than s2. |
Example:
| char* strncpy | ( | char * | dest, |
| const char * | src, | ||
| size_t | n | ||
| ) |
#include <string.h>
Copy at most n bytes of the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest.
| [out] | dest | pointer to destination string. |
| [in] | src | pointer to source string. |
| [in] | n | maximal number of bytes to copy if string does not have \0 terminator. |
dest.Example:
| errno_t strncpy_s | ( | char *restrict | dest, |
| rsize_t | dest_max, | ||
| const char *restrict | src, | ||
| rsize_t | n | ||
| ) |
#include <string.h>
Check arguments and copy at most n bytes of the src string, including the terminating null byte ('\0') to the dest sized buffer.
| [out] | dest | pointer to destination string. |
| [in] | dest_max | max number of bytes to modify in the dest. |
| [in] | src | pointer to source string. |
| [in] | n | maximal number of bytes to copy if string does not have \0 terminator. |
| 0 | function completed work with success. |
| !=0 | function completed work with error. |
| size_t strnlen | ( | const char * | s, |
| size_t | n | ||
| ) |
#include <string.h>
Calculate the length of the fixed-size string s, excluding the terminating null byte ('\0').
| [in] | s | Pointer to string. |
| [in] | n | maximal number of bytes to scan. |
n if string is nonger than n.Example:
| size_t strnlen_s | ( | const char * | s, |
| size_t | s_max | ||
| ) |
#include <string.h>
Check arguments and calculate the length of the s fixed-size string, excluding the terminating null byte ('\0').
| [in] | s | pointer to string. |
| [in] | s_max | maximal number of bytes to scan. |
| 0 | s is a null pointer. |
| !=0 | number of symbols that precede the terminating null character. |
| char* strrchr | ( | const char * | s, |
| int | c | ||
| ) |
#include <string.h>
Find last occurence of character c in string s.
| [in] | s | Pointer to string to search in. |
| [in] | c | character to seach. |
NULL if not found.Example:
| size_t strspn | ( | const char * | s, |
| const char * | accept | ||
| ) |
#include <string.h>
Calculate the length (in bytes) of the initial segment of s which consists entirely of bytes in accept.
| [in] | s | Pointer to string to search in. |
| [in] | accept | String containing the characters to match. |
| char* strstr | ( | const char * | text, |
| const char * | pattern | ||
| ) |
#include <string.h>
Find the first occurrence of the substring pattern in the string text. The terminating null bytes ('\0') are not compared.
| [in] | text | Pointer to buffer with text for scan. |
| [in] | pattern | Pointer to pattern to find in text. |
NULL if substring is not found.Example:
| double strtod | ( | const char * | nptr, |
| char ** | endptr | ||
| ) |
#include <stdlib.h>
the initial portion of the string pointed to by nptr to double.
| [in] | nptr | The start of the string. |
| [in] | endptr | A pointer to the end of the parsed string will be placed here. |
| float strtof | ( | const char * | nptr, |
| char ** | endptr | ||
| ) |
#include <stdlib.h>
the initial portion of the string pointed to by nptr to float.
| [in] | nptr | The start of the string. |
| [in] | endptr | A pointer to the end of the parsed string will be placed here. |
| char* strtok | ( | char * | str, |
| const char * | delim | ||
| ) |
#include <string.h>
Function breaks a string into a sequence of zero or more nonempty tokens.
This function is MT-unsafe, i.e. it's not safe to call in a multithreaded programs
| [in] | str | The string to be parsed. |
| [in] | delim | The argument specifies a set of bytes that delimit the tokens in the parsed string. |
| char* strtok_r | ( | char *_restrict_ | s, |
| const char *_restrict_ | sep, | ||
| char **_restrict_ | p | ||
| ) |
#include <string.h>
Function breaks a string into a sequence of zero or more nonempty tokens.
| [in] | s | The string to be parsed. |
| [in] | sep | The argument specifies a set of bytes that delimit the tokens in the parsed string. |
| [out] | p | used internally by strtok_r() in order to maintain context between successive calls that parse the same string. |
| long strtol | ( | const char * | nptr, |
| char ** | endptr, | ||
| int | base | ||
| ) |
#include <stdlib.h>
Convert the initial part of the string in nptr to a long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.
base is zero or 16, the string may then include a "0x" prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is '0', in which case it is taken as 8 (octal). The remainder of the string is converted to a long int value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter 'A' in either uppercase or lowercase represents 10, 'B' represents 11, and so forth, with 'Z' representing 35.) | [in] | nptr | The start of the string |
| [in] | endptr | A pointer to the end of the parsed string will be placed here |
| [in] | base | The number base to use |
| long double strtold | ( | const char * | nptr, |
| char ** | endptr | ||
| ) |
#include <stdlib.h>
the initial portion of the string pointed to by nptr to long double.
| [in] | nptr | The start of the string. |
| [in] | endptr | A pointer to the end of the parsed string will be placed here. |
| long long strtoll | ( | const char * | nptr, |
| char ** | endptr, | ||
| int | base | ||
| ) |
#include <stdlib.h>
Convert the initial part of the string in nptr to a long long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.
base is zero or 16, the string may then include a "0x" prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is '0', in which case it is taken as 8 (octal). The remainder of the string is converted to a long int value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter 'A' in either uppercase or lowercase represents 10, 'B' represents 11, and so forth, with 'Z' representing 35.) | [in] | nptr | The start of the string |
| [in] | endptr | A pointer to the end of the parsed string will be placed here |
| [in] | base | The number base to use |
| unsigned long strtoul | ( | const char * | cp, |
| char ** | endp, | ||
| int | base | ||
| ) |
#include <stdlib.h>
Convert the initial part of the string in nptr to a unsigned long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.
base is zero or 16, the string may then include a "0x" prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is '0', in which case it is taken as 8 (octal). The remainder of the string is converted to a long int value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter 'A' in either uppercase or lowercase represents 10, 'B' represents 11, and so forth, with 'Z' representing 35.) | [in] | cp | The start of the string. |
| [in] | endp | A pointer to the end of the parsed string will be placed here. |
| [in] | base | The number base to use. |
| unsigned long long strtoull | ( | const char * | cp, |
| char ** | endp, | ||
| int | base | ||
| ) |
#include <stdlib.h>
Convert the initial part of the string in nptr to a unsigned long long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.
base is zero or 16, the string may then include a "0x" prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is '0', in which case it is taken as 8 (octal). The remainder of the string is converted to a long int value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter 'A' in either uppercase or lowercase represents 10, 'B' represents 11, and so forth, with 'Z' representing 35.) | [in] | cp | The start of the string. |
| [in] | endp | A pointer to the end of the parsed string will be placed here. |
| [in] | base | The number base to use. |
| long sysconf | ( | int | name | ) |
#include <unistd.h>
Get configuration information at run time.
Allows an application to test at compile or run time whether certain options are supported, or what the value is of certain configurable constants or limits.
| [in] | name | System resource to find out. |
| void timeadd | ( | const struct timespec * | a, |
| const struct timespec * | b, | ||
| struct timespec * | res | ||
| ) |
#include <time.h>
The function adds two dates.
| [in] | a | Pointer to parameter to add. |
| [in] | b | Pointer to parameter to add. |
| [out] | res | Pointer to parameter to save result. |
| int64_t timespec_to_ms | ( | const struct timespec * | a | ) |
#include <time.h>
The function converts time from timespec format to milliseconds.
| [in] | a | Pointer to timespec structure. |
| time | in milliseconds. |
| uint64_t timespec_to_nsec | ( | const struct timespec * | a | ) |
#include <time.h>
The function converts time from timespec format to nanoseconds.
| [in] | a | Pointer to timespec structure. |
| time | in nanoseconds. |
| void timesub | ( | const struct timespec * | a, |
| const struct timespec * | b, | ||
| struct timespec * | res | ||
| ) |
#include <time.h>
The function subtracts two dates.
| [in] | a | Pointer to parameter to subtract. |
| [in] | b | Pointer to parameter to subtract. |
| [out] | res | Pointer to parameter to save result. |
|
static |
#include <ctype.h>
Convert uppercase letter to lowercase.
| [in] | c | symbol for converting |
c if the conversion was not possible.
|
static |
#include <ctype.h>
Convert lowercase letter to uppercase.
| [in] | c | symbol for converting |
c if the conversion was not possible. | int unlink | ( | const char * | pathname | ) |
| int unsetenv | ( | const char * | name | ) |
#include <stdlib.h>
delete environment variable function stub
| [in] | name | environment variable name |
| 0 |
| void uuid_clear | ( | uuid_t * | uu | ) |
#include <uuid/uuid.h>
Compare the two supplied uuid variables uu1 and uu2 to each other.
| [in] | uu1 | first value to compare. |
| [in] | uu2 | second value to compare. |
| 0 | - values are the same. |
| <0 | uu2 value is lexigraphically greater than uu1. |
| >0 | uu2 value is lexigraphically less than uu1. |
| void uuid_generate | ( | uuid_t * | out | ) |
#include <uuid/uuid.h>
The uuid_generate function creates a new universally unique identifier (UUID).
| [out] | out | generated value. |
| int uuid_is_null | ( | const uuid_t * | uu | ) |
#include <uuid/uuid.h>
Check if UUID is null.
| [in] | uu | value to check. |
| 0 | UUID is not NULL. |
| 1 | otherwise. |
| int uuid_parse | ( | const char * | in, |
| uuid_t * | uu | ||
| ) |
#include <uuid/uuid.h>
Convert an input UUID string into binary representation.
Function converts the UUID string given by in into the binary representation. The input UUID is a string of the form 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb (in printf(3) format "%08x-%04x-%04x-%04x-%012x", 36 bytes plus the trailing '\0').
| [in] | in | string value to convert. |
| [out] | uu | binary UUID representation. |
| 0 | upon successfully parsing the input string. |
| -1 | on failure. |
| void uuid_unparse | ( | const uuid_t * | uu, |
| char * | out | ||
| ) |
#include <uuid/uuid.h>
Convert binary representation of UUID to string.
| [in] | uu | value to convert. |
| [out] | out | textual representation in lowercase format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| void uuid_unparse_upper | ( | const uuid_t * | uu, |
| char * | out | ||
| ) |
#include <uuid/uuid.h>
Convert binary representation of UUID to string.
| [in] | uu | value to convert. |
| [out] | out | textual representation in uppercase format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. |
| int vasprintf | ( | char ** | strp, |
| const char * | fmt, | ||
| va_list | args | ||
| ) |
#include <stdio.h>
print to allocated string.
| [in,out] | args | arguments for printing. |
| [out] | strp | Pointer to newly allocated string or NULL(if the function failed). |
| [in] | fmt | Format string. |
| [in,out] | ... | Variable arguments for printing. |
The functions asprintf() and vasprintf() are analogs of sprintf() and vsprintf(), except that they allocate a string large enough to hold the output including the terminating null byte, and return a pointer to it via the first argument. This pointer should be passed to free() to release the allocated storage when it is no longer needed.
These functions are TEEGRIS extensions, not in C or POSIX. They are also available under *BSD and GNU/Linux. The GNU/Linux implementation leaves strp in undefined state in case of error.
| >=0 | number of bytes printed if succeed |
| -1 | if failed, and set strp to NULL |
| int vasprintf_s | ( | char ** | strp, |
| const char * | fmt, | ||
| va_list | args | ||
| ) |
#include <stdio.h>
Print to allocated string in secure mode.
| [out] | strp | Pointer to newly allocated string or NULL(if the function failed). |
| [in] | fmt | Format string. |
| [in,out] | args | arguments for printing. |
| >=0 | number of bytes printed if succeed |
| -1 | if failed, and set strp to NULL |
| int vfprintf | ( | FILE *_restrict_ | stream, |
| const char *_restrict_ | fmt, | ||
| va_list | ap | ||
| ) |
#include <stdio.h>
The vfprintf() is equivalent to the fprintf(), but uses an argument list.
| [in] | stream | A writeable file handle. |
| [in] | fmt | Format specification of output string. |
| [in] | ap | Value identifying a variable arguments list initialized with va_start. va_list is a special type. |
| >=0 | number of characters printed if succeed. |
| -1 | if error occurred. |
| int vsnprintf | ( | char * | buffer, |
| size_t | size, | ||
| const char * | format, | ||
| va_list | args | ||
| ) |
#include <stdio.h>
Write formatted data from variable argument list to sized buffer.
| [out] | buffer | Pointer to a buffer where the resulting C-string is stored. |
| [in] | size | size of the buffer. |
| [in] | format | C string that contains a format string. |
| [in,out] | args | A value identifying a variable arguments list initialized with va_start. va_list is a special type. |
Example:
| int vsnprintf_s | ( | char *_restrict_ | s, |
| rsize_t | n, | ||
| const char *_restrict_ | format, | ||
| va_list | arg | ||
| ) |
#include <stdio.h>
Write formatted data from variable argument list to sized buffer.
| [out] | s | Pointer to a buffer where the resulting C-string is stored. |
| [in] | n | size of the buffer. |
| [in] | format | C string that contains a format string. |
| [in] | arg | A value identifying a variable length arguments list initialized with va_start. va_list is a special type. |
| int vsprintf | ( | char * | buffer, |
| const char * | format, | ||
| va_list | args | ||
| ) |
#include <stdio.h>
Write formatted data from variable argument list to string.
| [out] | buffer | Pointer to a buffer where the resulting C-string is stored. |
| [in] | format | C string that contains a format string. |
| [in,out] | args | A value identifying a variable arguments list initialized with va_start. va_list is a special type. |
| number | of characters printed if succeed. |
| -1 | if error occurred. |
Example:
| int vsprintf_s | ( | char *_restrict_ | s, |
| rsize_t | n, | ||
| const char *_restrict_ | format, | ||
| va_list | arg | ||
| ) |
#include <stdio.h>
Write formatted data from variable length argument list to string.
| [out] | s | Pointer to a buffer where the resulting C-string is stored. |
| [in] | n | buffer size in characters. |
| [in] | format | C string that contains a format string. |
| [in] | arg | A value identifying a variable arguments list initialized. with va_start. va_list is a special type. |
| number | of characters printed if succeed. |
| 0 | if constrain violation occurred. |
| -1 | if encoding error occurred. |
| int vsscanf | ( | const char * | buffer, |
| const char * | fmt, | ||
| va_list | args | ||
| ) |
#include <stdio.h>
vsscanf unformat a buffer into a list of arguments.
| [in] | buffer | input buffer. |
| [in] | fmt | format of buffer. |
| [in] | args | value identifying a variable arguments list initialized with va_start. va_list is a special type. |
| >=0 | On success, the function returns the number of items in the argument list successfully filled. This count can match the expected number of items or be less -even zero- in the case of a matching failure. |
| EOF | In the case of an input failure before any data could be successfully interpreted. |
| int vsscanf_s | ( | const char *_restrict_ | s, |
| const char *_restrict_ | format, | ||
| va_list | arg | ||
| ) |
#include <stdio.h>
vsscanf unformat a buffer into a list of arguments.
| [in] | s | Input buffer. |
| [in] | format | Format of buffer. |
| [in] | arg | Value identifying a variable arguments list initialized with va_start. va_list is a special type. |
| >=0 | On success, the function returns the number of items in the argument list successfully filled. This count can match the expected number of items or be less -even zero- in the case of a matching failure. |
| EOF | In the case of an input failure before any data could be successfully interpreted. |
| ssize_t write | ( | int | fd, |
| const void * | buf, | ||
| size_t | count | ||
| ) |
#include <unistd.h>
Attempt to write count bytes from buffer pointed to by buf to the file associated with the open file descriptor, fd.
| [in] | fd | File descriptor. |
| [in] | buf | Pointer to buffer from to read. |
| [in] | count | Number of bytes to write. |
| FILE* stdin |