Add parentheses to make blocking mode work.

This commit is contained in:
John Birrell 1997-04-01 22:44:18 +00:00
parent 7966553397
commit e710f8d85b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24518
12 changed files with 36 additions and 12 deletions

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ read(int fd, void *buf, size_t nbytes)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking read syscall: */
while ((ret = _thread_sys_read(fd, buf, nbytes)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ readv(int fd, const struct iovec * iov, int iovcnt)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking readv syscall: */
while ((ret = _thread_sys_readv(fd, iov, iovcnt)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ write(int fd, const void *buf, size_t nbytes)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking write syscall: */
while ((ret = _thread_sys_write(fd, buf, nbytes)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ writev(int fd, const struct iovec * iov, int iovcnt)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking writev syscall: */
while ((ret = _thread_sys_writev(fd, iov, iovcnt)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ read(int fd, void *buf, size_t nbytes)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking read syscall: */
while ((ret = _thread_sys_read(fd, buf, nbytes)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ readv(int fd, const struct iovec * iov, int iovcnt)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking readv syscall: */
while ((ret = _thread_sys_readv(fd, iov, iovcnt)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ write(int fd, const void *buf, size_t nbytes)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking write syscall: */
while ((ret = _thread_sys_write(fd, buf, nbytes)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ writev(int fd, const struct iovec * iov, int iovcnt)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking writev syscall: */
while ((ret = _thread_sys_writev(fd, iov, iovcnt)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ read(int fd, void *buf, size_t nbytes)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking read syscall: */
while ((ret = _thread_sys_read(fd, buf, nbytes)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ readv(int fd, const struct iovec * iov, int iovcnt)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking readv syscall: */
while ((ret = _thread_sys_readv(fd, iov, iovcnt)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ write(int fd, const void *buf, size_t nbytes)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking write syscall: */
while ((ret = _thread_sys_write(fd, buf, nbytes)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;

View File

@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*
*/
#include <sys/types.h>
#include <sys/fcntl.h>
@ -50,7 +52,7 @@ writev(int fd, const struct iovec * iov, int iovcnt)
__FILE__, __LINE__)) == 0) {
/* Perform a non-blocking writev syscall: */
while ((ret = _thread_sys_writev(fd, iov, iovcnt)) < 0) {
if (_thread_fd_table[fd]->flags & O_NONBLOCK == 0 &&
if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
_thread_kern_sig_block(&status);
_thread_run->data.fd.fd = fd;