标签:int com erro argv image reading sage s函数 apu
1 #include "apue.h" 2 #include <fcntl.h> 3 4 5 int main(int argc,char **argv) 6 { 7 if(argc != 2) 8 err_quit("usage:a.out <pathname>"); 9 if(access(argv[1],R_OK) < 0) 10 err_ret("access error for %s",argv[1]); 11 else 12 printf("read access OK\n"); 13 if(open(argv[1],O_RDONLY)<0) 14 err_ret("open error for %s\r\n",argv[1]); 15 else 16 printf("open for reading OK\r\n"); 17 18 exit(0); 19 20 21 return 0; 22 } 23 ~
标签:int com erro argv image reading sage s函数 apu
原文地址:http://www.cnblogs.com/zzb-Dream-90Time/p/6963387.html