Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

memset_s(3) [osx man page]

MEMSET_S(3)						   BSD Library Functions Manual 					       MEMSET_S(3)

memset_s -- copy a value to all bytes of a memory buffer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#define __STDC_WANT_LIB_EXT1__ 1 #include <string.h> errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n); DESCRIPTION
The memset_s() function copies the value c (converted to an unsigned char) into each of the first n bytes of the memory buffer whose starting address is given by s. It is a runtime-consrtaints violation if s is a null pointer, or if either of smax or n is larger than RSIZE_MAX, or if smax is smaller than n. If there is a runtime-constraints violation, and if s is not a null pointer, and if smax is not larger than RSIZE_MAX, then, before reporting the runtime-constraints violation, memset_s() copies smax bytes to the destination. In contrast to the memset(3) function, calls to memset_s() will never be ``optimised away'' by a compiler. This property is required by the following sentences in section K. of ISO/IEC 9899:2011 (``ISO C11''): Unlike memset(), any call to the memset_s() function shall be evaluated strictly according to the rules of the abstract machine as described in ( That is, any call to the memset_s() function shall assume that the memory indicated by s and n may be accessi- ble in the future and thus must contain the values indicated by c. RETURN VALUES
The memset_s() function returns zero for success, or a non-zero error code if there was a runtime-constraints violation. ERRORS
memset_s() returns the following error codes. It does not store the error code in the global errno variable: [EINVAL] The s argument was a null pointer. [E2BIG] One or both of smax or n was larger than RSIZE_MAX. [EOVERFLOW] n was larger than smax. SEE ALSO
memset(3). STANDARDS
The memset_s() function conforms to ISO/IEC 9899:2011 (``ISO C11''), except that the set_constraint_handler_s() interface is not supported. BSD
February 21, 2012 BSD

Check Out this Related Man Page

ATOL(3) 						   BSD Library Functions Manual 						   ATOL(3)

atol, atoll -- convert ASCII string to long or long long integer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> long atol(const char *nptr); long long atoll(const char *nptr); DESCRIPTION
The atol() function converts the initial portion of the string pointed to by nptr to long integer representation. It is equivalent to: strtol(nptr, (char **)NULL, 10); The atoll() function converts the initial portion of the string pointed to by nptr to long long integer representation. It is equivalent to: strtoll(nptr, (char **)NULL, 10); COMPATIBILITY
The FreeBSD implementations of the atol() and atoll() functions are thin wrappers around strtol() and strtoll() respectively, so these func- tions will affect the value of errno in the same way that the strtol() and strtoll() functions are able to. This behavior of atol() and atoll() is not required by ISO/IEC 9899:1990 (``ISO C90'') or ISO/IEC 9899:1999 (``ISO C99''), but it is allowed by all of ISO/IEC 9899:1990 (``ISO C90''), ISO/IEC 9899:1999 (``ISO C99'') and IEEE Std 1003.1-2001 (``POSIX.1''). ERRORS
The functions atol() and atoll() may affect the value of errno on an error. SEE ALSO
atof(3), atoi(3), strtod(3), strtol(3), strtoul(3) STANDARDS
The atol() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The atoll() function conforms to ISO/IEC 9899:1999 (``ISO C99''). BSD
May 14, 2013 BSD
Man Page