1 Star 0 Fork 5.1K

hzcc / docs

forked from OpenHarmony / docs 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
select-h.md 7.52 KB
Copy Edit Raw Blame History
wenjun authored 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

select.h

Overview

Related Modules:

IO

Description:

Provides functions and structures related to I/O multiplexing.

These functions can be used to implement I/O multiplexing.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

fd_set

Defines a file descriptor set.

Macros

Macro Name and Value

Description

FD_SETSIZE   1024

Defines the size of fd_set, that is, the maximum number of monitored files.

FD_ZERO(s)   do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0)

Clears all elements in the file descriptor set.

FD_SET(d, s)   ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long)))))

Adds a file descriptor to a set.

FD_CLR(d, s)   ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long)))))

Removes a file descriptor from a set.

FD_ISSET(d, s)   !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))

Checks whether a file descriptor is in a set.

Typedefs

Typedef Name

Description

fd_mask

typedef unsigned long 

Defines fd_set as the alias of the element type.

Functions

Function Name

Description

select (int nfds, fd_set *__restrict readfds, fd_set *__restrict writefds, fd_set *__restrict exceptfds, struct timeval *__restrict timeout)

int 

Monitors the I/O events of multiple file descriptors.

1
https://gitee.com/hwang_zc/docs.git
git@gitee.com:hwang_zc/docs.git
hwang_zc
docs
docs
master

Search