volatile and job and EINTR

Generally speaking, the [b]volatile[/b] keyword is intended to [b]prevent the compiler from applying any optimizations [/b]on the code that assume values of variables cannot change "on their own."

In C, and consequently C++, the volatile keyword was intended to

allow access to memory mapped devices
allow uses of variables between setjmp and longjmp
allow uses of sig_atomic_t variables in signal handlers.

-------------------------------------------------------------------

Background processes are those whose process group ID differs from the terminal's; such processes are immune to keyboard-generated signals. Only foreground processes are allowed to read from or write to the terminal. Background processes which attempt to read from (write to) the terminal are sent a SIGTTIN (SIGTTOU) signal by the terminal driver, which, unless caught, suspends the process.

A job may also be referred to using a prefix of the name used to start it,

[url]http://web.mit.edu/gnu/doc/html/features_5.html[/url]
--------------------------------------------------------------------
EINTR means "This call did not succeed because it was interrupted. However, if you try again, it will probably work."

In other words, EINTR is not a fatal error -- it just means you should retry whatever you were attempting.

(Edit: According to my man-page, fork() never should return EINTR, although it may return EAGAIN under certain cases)

[url]http://cboard.cprogramming.com/c-programming/124120-errno-%3D%3D-eintr-means-what-thank-u.html[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值