Linux API/linux
‘F_SETPIPE_SZ’ undeclared
구차니
2022. 10. 20. 10:50
커널이 5.4.0 이라 그런가
해당 선언을 해주어야 에러가 사라진다.
#define _GNU_SOURCE |
[링크 : https://stackoverflow.com/questions/25411892/f-setpipe-sz-undeclared]
Defining _GNU_SOURCE has nothing to do with license and everything to do with writing (non-)portable code. If you define _GNU_SOURCE, you will get:
In particular, the things from _GNU_SOURCE that you should never use are #2 and #4 above. |
[링크 : https://stackoverflow.com/questions/5582211/what-does-define-gnu-source-imply]
호환성 지정 매크로
[링크 : https://m.blog.naver.com/netiz21/150015716721]
#include <fcntl.h> 대신
#include <linux/fcntl.h> 하면 _GNU_SOURCE를 해주지 않아도 되긴 한데
다른데서 경고가 뜨니 알아서 써야 할 듯.
/usr/include/linux/fcntl.h:28:#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) /usr/include/linux/fcntl.h:29:#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) |