pike.git / src / modules / _Stdio / file.c

version» Context lines:

pike.git/src/modules/_Stdio/file.c:737:    struct byte_buffer buf = BUFFER_INIT();    int e = 0;       buffer_set_flags(&buf, BUFFER_GROW_EXACT);       while (1) {       THREADS_ALLOW();       while (count) { -  size_t len = count; +  size_t len = MINIMUM(DIRECT_BUFSIZE, count);    ptrdiff_t bytes_read;       /* make space for exactly len bytes plus the terminating null byte. */    /* NOTE: as long as count comes from pike, it was signed, i.e. len+1    * cannot overflow */    if (UNLIKELY(!buffer_ensure_space_nothrow(&buf, len+1))) {    e = ENOMEM;    break;    }   
pike.git/src/modules/_Stdio/file.c:990:    message.msg.msg_flags = 0;   #endif       buffer_set_flags(&buf, BUFFER_GROW_EXACT);       while (1) {       THREADS_ALLOW();       while (count) { -  size_t len = count; +  size_t len = MINIMUM(DIRECT_BUFSIZE, count);       /* make space for exactly len bytes plus the terminating null byte */    /* as long as count comes from pike, it was signed, i.e. len+1 is safe */    if (UNLIKELY(!buffer_ensure_space_nothrow(&buf, len+1))) {    e = ENOMEM;    break;    }      #ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL    message.msg.msg_control = &message.cmsgbuf;