#include <errno.h> 포함.
printf("errno = %d\n", errno);
해당 errno 의 값 확인은
asm-generic/errno.h
asm-generic/errno-base.h
에서 확인할 수 있다.
#include<stdio.h>
#include<string.h>
#include<errno.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<sys/types.h>
int main()
{
int fd;
int temp_errno;
extern int errno;
fd = open("/woojinnesdfasdttest",O_RDWR);
perror("open");
printf("fd : %d\nerrno : %d\n",fd,errno);
return 0;
}
/usr/include/asm/errno.h
참고 :
http://blog.naver.com/endfirst/20018919109
http://blog.naver.com/lucisky/80024165984

Comments List
WOW, 여보. 당신이 가진 좋은 블로그. 그 친구가 예전의 그것을 보관 정말 놀랍습니다.