JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 3: Library Interfaces and Headers     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

Library Interfaces and Headers

acct(3HEAD)

acct.h(3HEAD)

aio(3HEAD)

aio.h(3HEAD)

ar(3HEAD)

archives(3HEAD)

archives.h(3HEAD)

ar.h(3HEAD)

assert(3HEAD)

assert.h(3HEAD)

complex(3HEAD)

complex.h(3HEAD)

cpio(3HEAD)

cpio.h(3HEAD)

dirent(3HEAD)

dirent.h(3HEAD)

errno(3HEAD)

errno.h(3HEAD)

fcntl(3HEAD)

fcntl.h(3HEAD)

fenv(3HEAD)

fenv.h(3HEAD)

float(3HEAD)

float.h(3HEAD)

floatingpoint(3HEAD)

floatingpoint.h(3HEAD)

fmtmsg(3HEAD)

fmtmsg.h(3HEAD)

fnmatch(3HEAD)

fnmatch.h(3HEAD)

ftw(3HEAD)

ftw.h(3HEAD)

glob(3HEAD)

glob.h(3HEAD)

grp(3HEAD)

grp.h(3HEAD)

iconv(3HEAD)

iconv.h(3HEAD)

if(3HEAD)

if.h(3HEAD)

in(3HEAD)

inet(3HEAD)

inet.h(3HEAD)

in.h(3HEAD)

inttypes(3HEAD)

inttypes.h(3HEAD)

ipc(3HEAD)

ipc.h(3HEAD)

iso646(3HEAD)

iso646.h(3HEAD)

langinfo(3HEAD)

langinfo.h(3HEAD)

lib300(3LIB)

lib300s(3LIB)

lib4014(3LIB)

lib450(3LIB)

libadm(3LIB)

libaio(3LIB)

libauto_ef(3LIB)

libbsdmalloc(3LIB)

libbsm(3LIB)

libc(3LIB)

libc_db(3LIB)

libcfgadm(3LIB)

libcommputil(3LIB)

libcontract(3LIB)

libcpc(3LIB)

libcrypt(3LIB)

libcurses(3LIB)

libcurses(3LIBUCB)

libdat(3LIB)

libdbm(3LIBUCB)

libdevid(3LIB)

libdevinfo(3LIB)

libdl(3LIB)

libdlpi(3LIB)

libdmi(3LIB)

libdmici(3LIB)

libdmimi(3LIB)

libdoor(3LIB)

libdtrace(3LIB)

libefi(3LIB)

libelf(3LIB)

libexacct(3LIB)

libfmevent(3LIB)

libform(3LIB)

libgen(3HEAD)

libgen(3LIB)

libgen.h(3HEAD)

libgss(3LIB)

libhbaapi(3LIB)

libidnkit(3LIB)

libintl(3LIB)

libkrb5(3LIB)

libkstat(3LIB)

libkvm(3LIB)

libl(3LIB)

liblayout(3LIB)

liblgrp(3LIB)

libm(3LIB)

libmail(3LIB)

libmalloc(3LIB)

libmapmalloc(3LIB)

libmd(3LIB)

libmd5(3LIB)

libmenu(3LIB)

libmlib(3LIB)

libmlib_mt(3LIB)

libmp(3LIB)

libMPAPI(3LIB)

libmpapi(3LIB)

libmtmalloc(3LIB)

libmvec(3LIB)

libnls(3LIB)

libnsl(3LIB)

libnvpair(3LIB)

libpam(3LIB)

libpanel(3LIB)

libpapi(3LIB)

libpctx(3LIB)

libpicl(3LIB)

libpicltree(3LIB)

libpkcs11(3LIB)

libplot(3LIB)

libpool(3LIB)

libposix4(3LIB)

libproject(3LIB)

libpthread(3LIB)

libresolv(3LIB)

librpcsoc(3LIBUCB)

librpcsvc(3LIB)

librsm(3LIB)

librt(3LIB)

librtld_db(3LIB)

libsasl(3LIB)

libscf(3LIB)

libsctp(3LIB)

libsec(3LIB)

libsecdb(3LIB)

libsendfile(3LIB)

libsip(3LIB)

libslp(3LIB)

libsmartcard(3LIB)

libsocket(3LIB)

libssagent(3LIB)

libssasnmp(3LIB)

libsys(3LIB)

libsysevent(3LIB)

libtecla(3LIB)

libtermcap(3LIB)

libtermcap(3LIBUCB)

libtermlib(3LIB)

libthread(3LIB)

libtnfctl(3LIB)

libtsalarm(3LIB)

libtsnet(3LIB)

libtsol(3LIB)

libucb(3LIBUCB)

libumem(3LIB)

libusb(3LIB)

libuuid(3LIB)

libv12n(3LIB)

libvolmgt(3LIB)

libvt0(3LIB)

libw(3LIB)

libwsreg(3LIB)

libxnet(3LIB)

libXtsol(3LIB)

libxtsol(3LIB)

liby(3LIB)

limits(3HEAD)

limits.h(3HEAD)

locale(3HEAD)

locale.h(3HEAD)

math(3HEAD)

math.h(3HEAD)

mman(3HEAD)

mman.h(3HEAD)

monetary(3HEAD)

monetary.h(3HEAD)

mqueue(3HEAD)

mqueue.h(3HEAD)

msg(3HEAD)

msg.h(3HEAD)

ndbm(3HEAD)

ndbm.h(3HEAD)

netdb(3HEAD)

netdb.h(3HEAD)

nl_types(3HEAD)

nl_types.h(3HEAD)

poll(3HEAD)

poll.h(3HEAD)

pthread(3HEAD)

pthread.h(3HEAD)

pwd(3HEAD)

pwd.h(3HEAD)

regex(3HEAD)

regex.h(3HEAD)

resource(3HEAD)

resource.h(3HEAD)

sched(3HEAD)

sched.h(3HEAD)

search(3HEAD)

search.h(3HEAD)

select(3HEAD)

select.h(3HEAD)

sem(3HEAD)

semaphore(3HEAD)

semaphore.h(3HEAD)

sem.h(3HEAD)

setjmp(3HEAD)

setjmp.h(3HEAD)

shm(3HEAD)

shm.h(3HEAD)

siginfo(3HEAD)

siginfo.h(3HEAD)

signal(3HEAD)

signal.h(3HEAD)

socket(3HEAD)

socket.h(3HEAD)

spawn(3HEAD)

spawn.h(3HEAD)

stat(3HEAD)

stat.h(3HEAD)

statvfs(3HEAD)

statvfs.h(3HEAD)

stdbool(3HEAD)

stdbool.h(3HEAD)

stddef(3HEAD)

stddef.h(3HEAD)

stdint(3HEAD)

stdint.h(3HEAD)

stdio(3HEAD)

stdio.h(3HEAD)

stdlib(3HEAD)

stdlib.h(3HEAD)

string(3HEAD)

string.h(3HEAD)

strings(3HEAD)

strings.h(3HEAD)

stropts(3HEAD)

stropts.h(3HEAD)

syslog(3HEAD)

syslog.h(3HEAD)

tar(3HEAD)

tar.h(3HEAD)

tcp(3HEAD)

tcp.h(3HEAD)

termios(3HEAD)

termios.h(3HEAD)

tgmath(3HEAD)

tgmath.h(3HEAD)

time(3HEAD)

timeb(3HEAD)

timeb.h(3HEAD)

time.h(3HEAD)

times(3HEAD)

times.h(3HEAD)

types32(3HEAD)

types32.h(3HEAD)

types(3HEAD)

types.h(3HEAD)

ucontext(3HEAD)

ucontext.h(3HEAD)

uio(3HEAD)

uio.h(3HEAD)

ulimit(3HEAD)

ulimit.h(3HEAD)

un(3HEAD)

un.h(3HEAD)

unistd(3HEAD)

unistd.h(3HEAD)

utime(3HEAD)

utime.h(3HEAD)

utmpx(3HEAD)

utmpx.h(3HEAD)

utsname(3HEAD)

utsname.h(3HEAD)

values(3HEAD)

values.h(3HEAD)

wait(3HEAD)

wait.h(3HEAD)

wchar(3HEAD)

wchar.h(3HEAD)

wctype(3HEAD)

wctype.h(3HEAD)

wordexp(3HEAD)

wordexp.h(3HEAD)

stdint.h

, stdint

- integer types

Synopsis

#include <stdint.h>

Description

The <stdint.h> header declares sets of integer types having specified widths, and defines corresponding sets of macros. It also defines macros that specify limits of integer types corresponding to types defined in other standard headers.

The ``width'' of an integer type is the number of bits used to store its value in a pure binary system; the actual type can use more bits than that (for example, a 28-bit type could be stored in 32 bits of actual storage). An N-bit signed type has values in the range -2N-1 or 1-2N-1 to 2N-1-1, while an N-bit unsigned type has values in the range 0 to 2N-1.

Types are defined in the following categories:

Some of these types may denote the same type.

Corresponding macros specify limits of the declared types and construct suitable constants.

For each type described herein that the implementation provides, the <stdint.h> header declares that typedef name and defines the associated macros. Conversely, for each type described herein that the implementation does not provide, the <stdint.h> header does not declare that typedef name, nor does it define the associated macros. An implementation provides those types described as required, but need not provide any of the others (described as optional).

Integer Types

When typedef names differing only in the absence or presence of the initial u are defined, they denote corresponding signed and unsigned types as described in the ISO/IEC 9899: 1999 standard, Section 6.2.5; an implementation providing one of these corresponding types must also provide the other.

In the following descriptions, the symbol N represents an unsigned decimal integer with no leading zeros (for example, 8 or 24, but not 04 or 048).

Exact-width integer types

The typedef name intN_t designates a signed integer type with width N, no padding bits, and a two's-complement representation. Thus, int8_t denotes a signed integer type with a width of exactly 8 bits.

The typedef name uintN_t designates an unsigned integer type with width N. Thus, uint24_t denotes an unsigned integer type with a width of exactly 24 bits.

The following types are required:

int8_t
int16_t
int32_t
uint8_t
uint16_t
uint32_t

If an implementation provides integer types with width 64 that meet these requirements, then the following types are required:

int64_t
uint64_t

In particular, this is the case if any of the following are true:

  • The implementation supports the _POSIX_V6_ILP32_OFFBIG programming environment and the application is being built in the _POSI X_V6_ILP32_OFFBIG programming environment (see the Shell and Utilities volume of IEEE Std 1003.1-200x, c99, Programming Environments).

  • The implementation supports the _POSIX_V6_LP64_OFF64 programming environment and the application is being built in the _POSIX_ V6_LP64_OFF64 programming environment.

  • The implementation supports the _POSIX_V6_LPBIG_OFFBIG programming environment and the application is being built in the _POSIX_V6_LPBIG_OFFBIG programming environment.

All other types of this form are optional.

Minimum-width integer types

The typedef name int_leastN_t designates a signed integer type with a width of at least N, such that no signed integer type with lesser size has at least the specified width. Thus, int_least32 _t denotes a signed integer type with a width of at least 32 bits.

The typedef name uint_leastN_t designates an unsigned integer type with a width of at least N, such that no unsigned integer type with lesser size has at least the specified width. Thus, uint_ least16_t denotes an unsigned integer type with a width of at least 16 bits.

The following types are required:

int_least8_t
int_least16_t
int_least32_t
int_least64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t

All other types of this form are optional.

Fastest minimum-width integer types

Each of the following types designates an integer type that is usually fastest to operate with among all integer types that have at least the specified width.

The designated type is not guaranteed to be fastest for all purposes; if the implementation has no clear grounds for choosing one type over another, it will simply pick some integer type satisfying the signedness and width requirements.

The typedef name int_fastN_t designates the fastest signed integer type with a width of at least N. The typedef name uint_fastN_ t designates the fastest unsigned integer type with a width of at least N.

The following types are required:

int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t

All other types of this form are optional.

Integer types capable of holding object pointers
intptr_t

Designates a signed integer type with the property that any valid pointer to void can be converted to this type, then converted back to a pointer to void, and the result will compare equal to the original pointer.

uintptr_t

Designates an unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to a pointer to void, and the result will compare equal to the original pointer.

On standard-conforming systems, the intptr_t and uintptr_t types are required; otherwise, they are optional.

Greatest-width integer types
intmax_t

Designates a signed integer type capable of representing any value of any signed integer type.

uintmax_t

Designates an unsigned integer type capable of representing any value of any unsigned integer type.

These types are required.

Applications can test for optional types by using the corresponding limit macro from Limits of Specified-Width Integer Types.

Limits of Specified-Width Integer Types

The following macros specify the minimum and maximum limits of the types declared in the <stdint.h> header. Each macro name corresponds to a similar type name in Integer Types.

Each instance of any defined macro is replaced by a constant expression suitable for use in #if preprocessing directives. This expression has the same type as would an expression that is an object of the corresponding type converted according to the integer promotions. Its implementation-defined value is equal to or greater in magnitude (absolute value) than the corresponding value given below, with the same sign, except where stated to be exactly the given value.

Limits of exact-width integer types
  • Minimum values of exact-width signed integer types:

    {INTN_MIN}

    Exactly -(2N-1)

  • Maximum values of exact-width signed integer types:

    {INTN_MAX}

    Exactly 2N-1 -1

  • Maximum values of exact-width unsigned integer types:

    {UINTN_MAX}

    Exactly 2N -1

Limits of minimum-width integer types
  • Minimum values of minimum-width signed integer types:

    {INT_LEASTN_MIN}

    -(2N-1 -1)

  • Maximum values of minimum-width signed integer types:

    {INT_LEASTN_MAX}

    2N-1 -1

  • Maximum values of minimum-width unsigned integer types:

    {UINT_LEASTN_MAX}

    2N -1

Limits of fastest minimum-width integer types
  • Minimum values of fastest minimum-width signed integer types:

    {INT_FASTN_MIN}

    -(2N-1 -1)

  • Maximum values of fastest minimum-width signed integer types:

    {INT_FASTN_MAX}

    2N-1 -1

  • Maximum values of fastest minimum-width unsigned integer types:

    {UINT_FASTN_MAX}

    2N-1 -1

Limits of integer types capable of holding object pointers
  • Minimum value of pointer-holding signed integer type:

    {INTPTR_MIN}

    -(215 -1)

  • Maximum value of pointer-holding signed integer type:

    {INTPTR_MAX}

    215 -1

  • Minimum value of pointer-holding signed integer type:

    {UINTPTR_MAX}

    216 -1

Limits of greatest-width integer types
  • Minimum value of greatest-width signed integer type:

    {INTMAX_MIN}

    -(263 -1)

  • Maximum value of greatest-width signed integer type:

    {INTMAX_MIN}

    263 -1

  • Maximum value of greatest-width unsigned integer type:

    {UINTMAX_MIN}

    264 -1

Limits of Other Integer Types

The following macros specify the minimum and maximum limits of integer types corresponding to types defined in other standard headers.

Each instance of these macros is replaced by a constant expression suitable for use in #if preprocessing directives. This expression has the same type as would an expression that is an object of the corresponding type converted according to the integer promotions. Its implementation-defined value is equal to or greater in magnitude (absolute value) than the corresponding value given below, with the same sign.

Limits of ptrdiff_t:
{PTRDIFF_MIN}

-65535

{PTRDIFF_MAX}

+65535

Limits of sig_atomic_t:
{SIG_ATOMIC_MIN}

See below.

{SIG_ATOMIC_MAX}

See below.

Limits of size_t:
{SIZE_MAX}

65535

Limits of wchar_t:
{WCHAR_MIN}

See below.

{WCHAR_MAX}

See below.

Limits of wint_t:
{WINT_MIN}

See below.

{WINT_MAX}

See below.

If sig_atomic_t (see the <signal.h> header) is defined as a signed integer type, the value of {SIG_ATOMIC_MIN} is no greater than -127 and the value of {SIG_ATOMIC_MAX} is no less than 127. Otherwise, sig_atomic_t is defined as an unsigned integer type, the value of {SIG_ATOMIC_MIN} is 0, and the value of {SIG_ATOMIC_MAX} is no less than 255.

If wchar_t (see the <stddef.h> header) is defined as a signed integer type, the value of {WCHAR_MIN} is no greater than -127 and the value of {WCHAR_MAX} is no less than 127. Otherwise, wchar_t is defined as an unsigned integer type, and the value of {WCHAR_MIN} is 0 and the value of {WCHAR_MAX} is no less than 255.

If wint_t (see the <wchar.h> header) is defined as a signed integer type, the value of {WINT_MIN} is no greater than -32767 and the value of {WINT_MAX} is no less than 32767. Otherwise, wint_t is defined as an unsigned integer type, and the value of {WINT_MIN} is 0 and the value of {WINT_MAX} is no less than 65535.

Macros for Integer Constant Expressions

The following macros expand to integer constant expressions suitable for initializing objects that have integer types corresponding to types defined in the <stdint.h> header. Each macro name corresponds to a similar type name listed under minimum-width integer types and greatest-width integer types.

Each invocation of one of these macros expands to an integer constant expression suitable for use in #if preprocessing directives. The type of the expression has the same type as would an expression that is an object of the corresponding type converted according to the integer promotions. The value of the expression is that of the argument. The argument in any instance of these macros is a decimal, octal, or hexadecimal constant with a value that does not exceed the limits for the corresponding type.

Macros for minimum-width integer constant expressions

The macro INTN_C(value) expands to an integer constant expression corresponding to the type int_leastN_t. The macro UINTN_C(value) expands to an integer constant expression corresponding to the type uint_leastN_t. For example, if uint_least64_t is a name for the type unsigned long long, then UINT64_C(0x123) might expand to the integer constant 0x123ULL.

Macros for greatest-width integer constant expressions

The following macro expands to an integer constant expression having the value specified by its argument and the type intmax_t:

INTMAX_C(value)

The following macro expands to an integer constant expression having the value specified by its argument and the type uintmax_t:

UINTMAX_C(value)

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Standard

See Also

inttypes.h(3HEAD), signal.h(3HEAD), stddef.h(3HEAD), wchar.h(3HEAD), attributes(5), standards(5)