#include <sys/types.h> UNIX

Posted on 2012-03-16 01:08  无忧consume  阅读(423)  评论(0编辑  收藏  举报

NAME

sys/types.h - data types

 SYNOPSIS

 #include <sys/types.h> 

 DESCRIPTION

The <sys/types.h> header includes definitions for at least the following types:
blkcnt_t
Used for file block counts
blksize_t
Used for block sizes
clock_t
Used for system times in clock ticks or CLOCKS_PER_SEC (see <time.h>).
clockid_t
Used for clock ID type in the clock and timer functions.
dev_t
Used for device IDs.
fsblkcnt_t
Used for file system block counts
fsfilcnt_t
Used for file system file counts
gid_t
Used for group IDs.
id_t
Used as a general identifier; can be used to contain at least a pid_tuid_t or a gid_t.
ino_t
Used for file serial numbers.
key_t
Used for interprocess communication.
mode_t
Used for some file attributes.
nlink_t
Used for link counts.
off_t
Used for file sizes.
pid_t
Used for process IDs and process group IDs.
pthread_attr_t
Used to identify a thread attribute object.
pthread_cond_t
Used for condition variables.
pthread_condattr_t
Used to identify a condition attribute object.
pthread_key_t
Used for thread-specific data keys.
pthread_mutex_t
Used for mutexes.
pthread_mutexattr_t
Used to identify a mutex attribute object.
pthread_once_t
Used for dynamic package initialisation.
pthread_rwlock_t
Used for read-write locks.
pthread_rwlockattr_t
Used for read-write lock attributes.
pthread_t
Used to identify a thread.
size_t
Used for sizes of objects.
ssize_t
Used for a count of bytes or an error indication.
suseconds_t
Used for time in microseconds
time_t
Used for time in seconds.
timer_t
Used for timer ID returned by timer_create().
uid_t
Used for user IDs.
useconds_t
Used for time in microseconds.

All of the types are defined as arithmetic types of an appropriate length, with the following exceptions: key_tpthread_attr_tpthread_cond_tpthread_condattr_tpthread_key_tpthread_mutex_t,pthread_mutexattr_tpthread_once_tpthread_rwlock_t and pthread_rwlockattr_t. Additionally, blkcnt_t and off_t are  extended signed integral types, fsblkcnt_t, fsfilcnt_t and ino_t are defined as  extended unsigned integral types, size_t is an unsigned integral type, and blksize_tpid_t and ssize_t are signed integral types. The type ssize_t is capable of storing values at least in the range [-1, SSIZE_MAX].  The typeuseconds_t is an unsigned integral type capable of storing values at least in the range [0, 1,000,000]. The type suseconds_t is a signed integral type capable of storing values at least in the range [-1, 1,000,000].

There are no defined comparison or assignment operators for the types pthread_attr_tpthread_cond_tpthread_condattr_tpthread_mutex_tpthread_mutexattr_tpthread_rwlock_t andpthread_rwlockattr_t.

Copyright © 2024 无忧consume
Powered by .NET 9.0 on Kubernetes