欢迎光临散文网 会员登陆 & 注册

黑马博学谷狂野架构4期

2023-02-08 12:15 作者:olger2000  | 我要投稿

   // 创建Pipe    int p[2];    prepare_pipe(p);    // splice()将文件1字节数据写入Pipe    ssize_t nbytes = splice(fd, &offset, p[1], NULL, 1, 0);    ......    // write()写入任意数据到Pipe    nbytes = write(p[1], data, data_size);    // 判断是否写入成功    if (nbytes < 0) {        perror("write failed");        return EXIT_FAILURE;    }

黑马博学谷狂野架构4期的评论 (共 条)

分享到微博请遵守国家法律