NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Functions

int32_t NvOsSnprintfS32 (char *dst, size_t max_count, NvS32 val)
 This function generates a formatted string with a signed integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfU32 (char *dst, size_t max_count, NvU32 val)
 This function generates a formatted string with a unsigned integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfU64 (char *dst, size_t max_count, NvU64 val)
 This function generates a formatted string with an unsigned 64-bit integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStr (char *dst, size_t max_count, const char *src)
 This function generates a formatted string with a string and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrS32 (char *dst, size_t max_count, const char *src, NvS32 val)
 This function generates a formatted string with a string and a signed integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrU32 (char *dst, size_t max_count, const char *src, NvU32 val)
 This function generates a formatted string with a string and unsigned integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrU64 (char *dst, size_t max_count, const char *src, NvU64 val)
 This function generates a formatted string with a string and unsigned 64-bit integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrFloat (char *dst, size_t max_count, const char *src, NvF32 val)
 This function generates a formatted string with a string and a float and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrPtr (char *dst, size_t max_count, const char *src, const void *ptr)
 This function generates a formatted string with a string and a pointer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrHexU32 (char *dst, size_t max_count, const char *src, NvU32 val)
 This function generates a formatted string with a string and an unsigned integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrHexRawBytes (char *dst, size_t max_count, const char *src, NvU32 val)
 This function generates a formatted string with a string and an unsigned integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrHexU64 (char *dst, size_t max_count, const char *src, NvU64 val)
 This function generates a formatted string with a string and an unsigned 64bit integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrWith2S32 (char *dst, size_t max_count, const char *src, NvS32 val0, NvS32 val1)
 This function generates a formatted string with a string and two signed integers and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
int32_t NvOsSnprintfStrWith2U32 (char *dst, size_t max_count, const char *src, NvU32 val0, NvU32 val1)
 This function generates a formatted string with a string and two unsigned integers and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More...
 
long int NvUStrtol (const char *s, char **endptr, int base)
 This function converts a string to integer. More...
 
uint32_t NvUStrtoui (const char *s, char **endptr, int32_t base)
 This function convert to unsigned int from string pointer. More...
 
unsigned long int NvUStrtoul (const char *s, char **endptr, int base)
 This function convert to unsigned long int from string pointer. More...
 
unsigned long long int NvUStrtoull (const char *s, char **endptr, int base)
 This function convert to unsigned long long int from string pointer. More...
 
size_t NvOsStrnlen (const char *s, size_t size)
 This function counts the length of given string, and its length is counted up to given size parameter. More...
 
void NvOsStrncpy (char *dest, const char *src, size_t size)
 This function copy to dest string parameter from src string parameter, And the maximum copying length is limited by size parameter. More...
 
NvError NvOsStrncpySafe (char *dest, size_t destsz, const char *src, size_t count)
 This function copies the source string to the destination string up to the maximum length specified by count, ensuring the resulting string is NULL-terminated. It also checks for overlapping between the two buffers, source and destination. More...
 
NvError NvOsStrncatSafe (char *dest, size_t destsz, const char *src, size_t count)
 This function appends the source string to the destination string up to the maximum length specified by count, ensuring the resulting string is NULL-terminated. It also checks for overlapping between the two buffers, source and destination. More...
 
NvError NvOsStrErrorSafe (int errnum, char *buf, size_t buflen)
 The function converts an error number to an error string and stores the string inside the buffer specified buf, using strerror_r(). More...
 

Function Documentation

◆ NvOsSnprintfS32()

int32_t NvOsSnprintfS32 ( char *  dst,
size_t  max_count,
NvS32  val 
)

This function generates a formatted string with a signed integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStr()

int32_t NvOsSnprintfStr ( char *  dst,
size_t  max_count,
const char *  src 
)

This function generates a formatted string with a string and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrFloat()

int32_t NvOsSnprintfStrFloat ( char *  dst,
size_t  max_count,
const char *  src,
NvF32  val 
)

This function generates a formatted string with a string and a float and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src><val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrHexRawBytes()

int32_t NvOsSnprintfStrHexRawBytes ( char *  dst,
size_t  max_count,
const char *  src,
NvU32  val 
)

This function generates a formatted string with a string and an unsigned integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src><val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array in hex format.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrHexU32()

int32_t NvOsSnprintfStrHexU32 ( char *  dst,
size_t  max_count,
const char *  src,
NvU32  val 
)

This function generates a formatted string with a string and an unsigned integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src>0x<val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array in hex format.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrHexU64()

int32_t NvOsSnprintfStrHexU64 ( char *  dst,
size_t  max_count,
const char *  src,
NvU64  val 
)

This function generates a formatted string with a string and an unsigned 64bit integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src>0x<val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array in hex format.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrPtr()

int32_t NvOsSnprintfStrPtr ( char *  dst,
size_t  max_count,
const char *  src,
const void *  ptr 
)

This function generates a formatted string with a string and a pointer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src><ptr>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]ptrA pointer value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrS32()

int32_t NvOsSnprintfStrS32 ( char *  dst,
size_t  max_count,
const char *  src,
NvS32  val 
)

This function generates a formatted string with a string and a signed integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src><val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrU32()

int32_t NvOsSnprintfStrU32 ( char *  dst,
size_t  max_count,
const char *  src,
NvU32  val 
)

This function generates a formatted string with a string and unsigned integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src><val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrU64()

int32_t NvOsSnprintfStrU64 ( char *  dst,
size_t  max_count,
const char *  src,
NvU64  val 
)

This function generates a formatted string with a string and unsigned 64-bit integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src><val>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrWith2S32()

int32_t NvOsSnprintfStrWith2S32 ( char *  dst,
size_t  max_count,
const char *  src,
NvS32  val0,
NvS32  val1 
)

This function generates a formatted string with a string and two signed integers and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src> <val0> <val1>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]val0The 1st value to be stored into the output array as string.
[in]val1The 2nd value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfStrWith2U32()

int32_t NvOsSnprintfStrWith2U32 ( char *  dst,
size_t  max_count,
const char *  src,
NvU32  val0,
NvU32  val1 
)

This function generates a formatted string with a string and two unsigned integers and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

The format of the generated string: "<src> <val0> <val1>"

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]srcA string to be stored into the output array. It should be NULL terminated.
[in]val0The 1st value to be stored into the output array as string.
[in]val1The 2nd value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer or when a source buffer overlaps a destination buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfU32()

int32_t NvOsSnprintfU32 ( char *  dst,
size_t  max_count,
NvU32  val 
)

This function generates a formatted string with a unsigned integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsSnprintfU64()

int32_t NvOsSnprintfU64 ( char *  dst,
size_t  max_count,
NvU64  val 
)

This function generates a formatted string with an unsigned 64-bit integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written.

Parameters
[out]dstA pointer to the array to store the formatted string. This buffer should have room for at least max_count characters.
[in]max_countThe maximum number of characters to store in the output array, including a terminating null character.
[in]valA value to be stored into the output array as string.
Returns
The number of characters that would have been written into the array, not counting the terminating null character. If the return value is equal to or greater than max_count, a part of the formatted string has not been written into the destination. A negative value is returned when an error occurs while writing the buffer.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsStrErrorSafe()

NvError NvOsStrErrorSafe ( int  errnum,
char *  buf,
size_t  buflen 
)

The function converts an error number to an error string and stores the string inside the buffer specified buf, using strerror_r().

Parameters
[in]errnumerror code
[out]bufDestination buffer pointer
[in]buf_lenDestination buffer size
Returns
NvSuccess Success
NvError_BadParameter Invalid error number
NvError_InvalidSize Insufficient size of supplied error buffer
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsStrncatSafe()

NvError NvOsStrncatSafe ( char *  dest,
size_t  destsz,
const char *  src,
size_t  count 
)

This function appends the source string to the destination string up to the maximum length specified by count, ensuring the resulting string is NULL-terminated. It also checks for overlapping between the two buffers, source and destination.

Parameters
[out]destDestination buffer pointer
[in]destszDestination buffer size
[in]srcSource buffer pointer
[in]countThe maximum number of characters to be appended
Returns
NvSuccess
NvError_BadValue Overlapping input buffers
NvError_InvalidSize Possible buffer overflow/truncation
NvError_BadParameter Input paramters are NULL
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsStrncpy()

void NvOsStrncpy ( char *  dest,
const char *  src,
size_t  size 
)

This function copy to dest string parameter from src string parameter, And the maximum copying length is limited by size parameter.

Parameters
[out]destDestination string pointer, passed to dst parameter to strncpy() in QNX libc
[in]srcSource string pointer, passed to src parameter to strncpy() in QNX libc
[in]sizeMaximum copying length as bytes, passed to n parameter to strncpy() in QNX libc
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsStrncpySafe()

NvError NvOsStrncpySafe ( char *  dest,
size_t  destsz,
const char *  src,
size_t  count 
)

This function copies the source string to the destination string up to the maximum length specified by count, ensuring the resulting string is NULL-terminated. It also checks for overlapping between the two buffers, source and destination.

Parameters
[out]destDestination buffer pointer
[in]destszDestination buffer size
[in]srcSource buffer pointer
[in]countThe maximum number of characters to be copied
Returns
NvSuccess Success
NvError_BadValue Overlapping input buffers
NvError_InvalidSize Possible buffer overflow/truncation
NvError_BadParameter input parameters are NULL
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsStrnlen()

size_t NvOsStrnlen ( const char *  s,
size_t  size 
)

This function counts the length of given string, and its length is counted up to given size parameter.

Parameters
[in]sString pointer, to count length, passed to s parameter to strnlen() in QNX libc
[in]sizeMaximum count length as bytes, passed to n parameter to strnlen() in QNX libc
Returns
N/A
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvUStrtol()

long int NvUStrtol ( const char *  s,
char **  endptr,
int  base 
)

This function converts a string to integer.

Parameters
[in]sString to parse as integer, passed to ptr parameter of strtol() in QNX libc
[out]endptrNULL, or string pointer which wasn't parsed as integer in s parameter, passed to endptr parameter of strtol() in QNX libc
[out]baseThe base of the number being parsed. Valid range = [0,2-36]
Returns
Return value of strtol() in QNX libc
0 Error if s parameter is NULL or base is out of range.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvUStrtoui()

uint32_t NvUStrtoui ( const char *  s,
char **  endptr,
int32_t  base 
)

This function convert to unsigned int from string pointer.

Parameters
[in]sString pointer to convert unsigned int, passed to s parameter of strtoul() in QNX libc
[out]endptrfollowed to/passed to endptr parameter of strtoul() in QNX libc
[in]basefollowed to/passed to base parameter of strtoul() in QNX libc
Returns
0 if s is NULL
Followed to return value of strtoul() in QNX libc
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvUStrtoul()

unsigned long int NvUStrtoul ( const char *  s,
char **  endptr,
int  base 
)

This function convert to unsigned long int from string pointer.

Parameters
[in]sString pointer to convert unsigned long int, passed to s parameter of strtoul() in QNX libc
[out]endptrfollowed to/passed to endptr parameter of strtoul() in QNX libc
[in]basefollowed to/passed to base parameter of strtoul() in QNX libc
Returns
0 if s is NULL
Followed to return value of strtoul() in QNX libc
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvUStrtoull()

unsigned long long int NvUStrtoull ( const char *  s,
char **  endptr,
int  base 
)

This function convert to unsigned long long int from string pointer.

Parameters
[in]sString pointer to convert unsigned long long int, passed to s parameter of strtoull() in QNX libc
[out]endptrfollowed to/passed to endptr parameter of strtoull() in QNX libc
[in]basefollowed to/passed to base parameter of strtoull() in QNX libc
Returns
0 if s is NULL
Followed to return value of strtoull() in QNX libc
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: Yes
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA