Skip to Content
LINUX系統程式設計 第二版
book

LINUX系統程式設計 第二版

by Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from LINUX系統程式設計 第二版
檔案 I/O
|
61
select (0, NULL, NULL, NULL, &tv);
當然,Linux 也會為高解析度的休眠機制提供介面。我們將在第 11 章探討這些介面。
pselect()
select()
系統呼叫,是4.2BSD 首先推出的,廣受歡迎,但是 POSIX 卻在 POSIX
1003.1g-2000 以及之後的 POSIX 1003.1-2001 定義自己的解決方案
pselect()
#define _XOPEN_SOURCE 600
#include <sys/select.h>
int pselect (int n,
fd_set *readfds,
fd_set *writefds,
fd_set *exceptfds,
const struct timespec *timeout,
const sigset_t *sigmask);
/* 下面如同 select() */
FD_CLR(int fd, fd_set *set);
FD_ISSET(int fd, fd_set *set);
FD_SET(int fd, fd_set *set);
FD_ZERO(fd_set *set);
pselect()
select()
之間有三點不同:
pselect()
為它的
timeout
參數使用的是
timespec
結構而不是
timeval
結構。
timespec
結構採用的是 seconds(秒)和 nanoseconds(奈秒,即十億分之一秒)的設定值,而
不是 seconds ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

優雅的SciPy|Python科學研究的美學

優雅的SciPy|Python科學研究的美學

Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9789862769812