zoukankan      html  css  js  c++  java
  • read函数

           #include <unistd.h>

           ssize_t read(int fd, void *buf, size_t count);

    DESCRIPTION
           read()  attempts  to  read  up  to count bytes from file descriptor fd into the
           buffer starting at buf.

           If count is zero, read() returns zero and has no other results.   If  count  is
           greater than SSIZE_MAX, the result is unspecified.

    RETURN VALUE
           On  success, the number of bytes read is returned (zero indicates end of file;0表示到了文件的末尾),
           and the file position is advanced by this number.  It is not an error  if  this
           number is smaller than the number of bytes requested; this may happen for exam-
           ple because fewer bytes are actually available right now (maybe because we were
           close  to  end-of-file, or because we are reading from a pipe, or from a termi-
           nal), or because read() was interrupted by a signal.  On error, -1 is returned,
           and  errno  is  set appropriately.  In this case it is left unspecified whether
           the file position (if any) changes.

  • 相关阅读:
    Spring-Boot:多种配置注入方式
    Spring-Boot:Profile简单示例
    Spring-Boot:拦截器注解范例
    Docker:镜像的迁移
    YARN的内存和CPU配置
    Spark On YARN内存分配
    Spark配置参数
    linux_密钥
    分布式架构高可用架构篇_04_Keepalived+Nginx实现高可用Web负载均衡
    PythonDay01
  • 原文地址:https://www.cnblogs.com/flying06/p/3873374.html
Copyright © 2011-2022 走看看