免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3281 | 回复: 1
打印 上一主题 下一主题

[C] mkfifo失败,看错误代码看不了,什么原因。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-01-16 21:48 |只看该作者 |倒序浏览
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <fcntl.h>
  5. #include <limits.h>
  6. #include <sys/types.h>
  7. #include <sys/stat.h>
  8. #include <unistd.h>
  9. #include <errno.h>

  10. #define FIFO_NAME "/home/hello/tmp/my_fifo"

  11. int main()
  12. {
  13.     int pipe_fd;
  14.     //printf("EACCESS:%d",EACCESS);
  15.     //printf("EEXIST:%d",EEXIST);
  16.     //printf("ENAMETOOLONG:%d",ENAMETOOLONG);
  17.     //printf("ENOENT:%d",ENOENT);
  18.     //printf("ENOSPC:%d",ENOSPC);
  19.     //printf("ENOTDIR:%d",ENOTDIR);
  20.     //printf("EROFS:%d",EROFS);
  21.    
  22.     //if the pipe file do not exist
  23.     if (access(FIFO_NAME, F_OK) == -1)
  24.     {
  25.         //creat FIFO pipe file
  26.         int ret = mkfifo(FIFO_NAME, 0777);
  27.         if(ret == -1)
  28.         {
  29.                                 puts("创建管道失败");
  30.                                 printf("errno:%d\n",errno);
  31.                 }
  32.     }
复制代码
编译失败  错误: ‘EACCESS’在此作用域中尚未声明

论坛徽章:
0
2 [报告]
发表于 2014-01-16 22:03 |只看该作者
  1. /usr/src/linux-headers-3.2.0-57/arch/s390/include/asm/errno.h
  2. /usr/src/linux-headers-3.2.0-57/arch/alpha/include/asm/errno.h
  3. /usr/src/linux-headers-3.2.0-57/arch/avr32/include/asm/errno.h
  4. /usr/src/linux-headers-3.2.0-57/arch/score/include/asm/errno.h
  5. /usr/src/linux-headers-3.2.0-57/arch/xtensa/include/asm/errno.h
  6. /usr/src/linux-headers-3.2.0-57/arch/frv/include/asm/errno.h
  7. /usr/src/linux-headers-3.2.0-57/arch/arm/mach-bcmring/include/csp/errno.h
  8. /usr/src/linux-headers-3.2.0-57/arch/h8300/include/asm/errno.h
  9. /usr/src/linux-headers-3.2.0-57/arch/m32r/include/asm/errno.h
  10. /usr/src/linux-headers-3.2.0-57/arch/microblaze/include/asm/errno.h
  11. /usr/src/linux-headers-3.2.0-57/arch/x86/include/asm/errno.h
  12. /usr/src/linux-headers-3.2.0-57/arch/m68k/include/asm/errno.h
  13. /usr/src/linux-headers-3.2.0-57/arch/ia64/include/asm/errno.h
  14. /usr/src/linux-headers-3.2.0-57/arch/cris/include/asm/errno.h
  15. /usr/src/linux-headers-3.2.0-57/arch/powerpc/include/asm/errno.h
  16. /usr/src/linux-headers-3.2.0-57/arch/mn10300/include/asm/errno.h
  17. /usr/src/linux-headers-3.2.0-57/arch/sh/include/asm/errno.h
  18. /usr/src/linux-headers-3.2.0-57/arch/parisc/include/asm/errno.h
  19. /usr/src/linux-headers-3.2.0-57/arch/sparc/include/asm/errno.h
  20. /usr/src/linux-headers-3.2.0-57/arch/mips/include/asm/errno.h
  21. /usr/src/linux-headers-3.2.0-57/include/linux/errno.h
  22. /usr/src/linux-headers-3.2.0-57/include/asm-generic/errno.h
  23. /usr/src/linux-headers-3.2.0-30/arch/s390/include/asm/errno.h
  24. /usr/src/linux-headers-3.2.0-30/arch/alpha/include/asm/errno.h
  25. /usr/src/linux-headers-3.2.0-30/arch/avr32/include/asm/errno.h
  26. /usr/src/linux-headers-3.2.0-30/arch/score/include/asm/errno.h
  27. /usr/src/linux-headers-3.2.0-30/arch/xtensa/include/asm/errno.h
  28. /usr/src/linux-headers-3.2.0-30/arch/frv/include/asm/errno.h
  29. /usr/src/linux-headers-3.2.0-30/arch/arm/mach-bcmring/include/csp/errno.h
  30. /usr/src/linux-headers-3.2.0-30/arch/h8300/include/asm/errno.h
  31. /usr/src/linux-headers-3.2.0-30/arch/m32r/include/asm/errno.h
  32. /usr/src/linux-headers-3.2.0-30/arch/microblaze/include/asm/errno.h
  33. /usr/src/linux-headers-3.2.0-30/arch/x86/include/asm/errno.h
  34. /usr/src/linux-headers-3.2.0-30/arch/m68k/include/asm/errno.h
  35. /usr/src/linux-headers-3.2.0-30/arch/ia64/include/asm/errno.h
  36. /usr/src/linux-headers-3.2.0-30/arch/cris/include/asm/errno.h
  37. /usr/src/linux-headers-3.2.0-30/arch/powerpc/include/asm/errno.h
  38. /usr/src/linux-headers-3.2.0-30/arch/mn10300/include/asm/errno.h
  39. /usr/src/linux-headers-3.2.0-30/arch/sh/include/asm/errno.h
  40. /usr/src/linux-headers-3.2.0-30/arch/parisc/include/asm/errno.h
  41. /usr/src/linux-headers-3.2.0-30/arch/sparc/include/asm/errno.h
  42. /usr/src/linux-headers-3.2.0-30/arch/mips/include/asm/errno.h
  43. /usr/src/linux-headers-3.2.0-30/include/linux/errno.h
  44. /usr/src/linux-headers-3.2.0-30/include/asm-generic/errno.h
  45. /usr/src/linux-headers-3.2.0-30-generic/include/linux/errno.h
  46. /usr/src/linux-headers-3.2.0-57-generic/include/linux/errno.h
  47. /usr/lib/syslinux/com32/include/errno.h
  48. /usr/include/errno.h
  49. /usr/include/linux/errno.h
  50. /usr/include/x86_64-linux-gnu/asm/errno.h
  51. /usr/include/x86_64-linux-gnu/sys/errno.h
  52. /usr/include/x86_64-linux-gnu/bits/errno.h
  53. /usr/include/asm-generic/errno.h
复制代码
挑了几个看了下头文件,好像没有定义的啊。?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP