⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jerry.c

📁 用五个实例来解释linux下的c编程
💻 C
字号:
/* jerry.c v3.0 */#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/wait.h>#include <fcntl.h>#include <stdlib.h>#include <stdio.h>#define FIFO "message.fifo"#define MSG "from TOM: "int main(){  int fifo;  char buf[BUFSIZ];  ssize_t s;  /* Open file for read. */  fifo = open(FIFO, O_RDONLY);  if(fifo < 0) {    perror("open");  }  write(STDOUT_FILENO, MSG, sizeof(MSG)-1);  /* Read message. */  do {    s = read(fifo, &buf, BUFSIZ);    write(STDOUT_FILENO, &buf, s);  } while (s>0);  /* Close file. */  close(fifo);    exit(EXIT_SUCCESS);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -