Linux io

作者: clive0x | 来源:发表于2021-07-10 23:18 被阅读0次

Linux进程所有打开IO链接在

_IO_list_all链表中,

_IO_2_1_stderr_  -》 _IO_2_1_stdout_ -》_IO_2_1_stdin_

struct _IO_FILE {

  int _flags;      /* High-order word is _IO_MAGIC; rest is flags. */

#define _IO_file_flags _flags

  /* The following pointers correspond to the C++ streambuf protocol. */

  /* Note:  Tk uses the _IO_read_ptr and _IO_read_end fields directly. */

  char* _IO_read_ptr;  /* Current read pointer */

  char* _IO_read_end;  /* End of get area. */

  char* _IO_read_base;  /* Start of putback+get area. */

  char* _IO_write_base; /* Start of put area. */

  char* _IO_write_ptr;  /* Current put pointer. */

  char* _IO_write_end;  /* End of put area. */

  char* _IO_buf_base;  /* Start of reserve area. */

  char* _IO_buf_end;    /* End of reserve area. */

  /* The following fields are used to support backing up and undo. */

  char *_IO_save_base; /* Pointer to start of non-current get area. */

  char *_IO_backup_base;  /* Pointer to first valid character of backup area */

  char *_IO_save_end; /* Pointer to end of non-current get area. */

  struct _IO_marker *_markers;

  struct _IO_FILE *_chain;

  int _fileno;

#if 0

  int _blksize;

#else

  int _flags2;

#endif

  _IO_off_t _old_offset; /* This used to be _offset but it's too small.  */

#define __HAVE_COLUMN /* temporary */

  /* 1+column number of pbase(); 0 is unknown. */

  unsigned short _cur_column;

  signed char _vtable_offset;

  char _shortbuf[1];

  /*  char* _save_gptr;  char* _save_egptr; */

  _IO_lock_t *_lock;

#ifdef _IO_USE_OLD_IO_FILE

};

typedef struct  _IO_FILE file

_IO_FILE *stdin= (FILE *) &_IO_2_1_stdin_;

相关文章

  • Linux 文件IO 和 标准IO

    [TOC] Linux 文件IO 和 标准IO Linux 文件IO Linux中做文件IO最常用到的5个函数是:...

  • Typora--markdown

    https://typora.io/#linux[https://typora.io/#linux]

  • Linux编程学习笔记 | Linux IO学习[2] - 标准

    在上一篇Linux编程学习笔记 | Linux IO学习[1] - 文件IO中,我总结了Linux下的文件IO。文...

  • 2、Linux IO模型

    下图是Linux处理IO调用的流程图: Linux IO模型分为5种: 阻塞IO 非阻塞IO IO复用 事件驱动I...

  • Epoll

    Linux IO类型 参考1参考2 同步IO Blocking IO 同步IO Nonblocking IO : ...

  • Linux IO模型

    Linux IO模型 网络IO的本质就是socket的读取,socket在linux系统被抽象为流,IO可以理解为...

  • linux五种IO模型

    Linux下主要的IO主要分为:阻塞IO(Blocking IO),非阻塞IO(Non-blocking IO),...

  • 浅析 Linux 文件 IO 读写

    浅析 Linux 文件 IO 读写 Linux的文件IO子系统是Linux中最复杂的一个子系统(没有之一)。读者可...

  • Linux IO学习

    Linux IO模型 linux的io分为两个阶段 等待数据准备好 从内核拷贝数据到用户态 io/阶段等待数据准备...

  • io_uring原理

    简介 io_uring是2019年在linux新增的异步IO接口。 它的出现是为了替代linux的旧的异步IO接口...

网友评论

      本文标题:Linux io

      本文链接:https://www.haomeiwen.com/subject/lpnbdltx.html