linux c socket读取有关问题,小弟我实在是搞不明白了

linux c socket读取问题,我实在是搞不明白了。

    size_t c_recv_len=0;
    while(1)
    {
        c_recv_len=recv(connfd,ret_buf,1,MSG_WAITALL);
        if(c_recv_len>0)
        {
                char test_str[50]={0};
                sprintf(test_str,"test---recv len:%d",c_recv_len);
                syslog(LOG_INFO|LOG_LOCAL2,test_str);
                break;
        }
        else if(errno!=EAGAIN)
        {
                char test_str[50]={0};
                sprintf(test_str,"test---errno:%d",errno);
                syslog(LOG_INFO|LOG_LOCAL2,test_str);
                break;
        }
        else
        {
                err_log("Rereading");
                usleep(500);
                continue;
        }
    }

日志里面竟然会打印出
test---recv len:-1
逻辑好像没有错误吧。。。那-1怎么可能大于0呢??

------解决方案--------------------
size_t 是无符号数,无符号数没有 -1,和 -1 的二进制内容相同的值是 0xffffffff, 4294967295 这个数是大于 0 的。