Is O_LARGEFILE needed just to write a large file?

霸气de小男生 提交于 2019-11-27 23:02:05

O_LARGEFILE should never be used directly by applications. It's to be used internally by the 64-bit-offset-compatible version of open in libc when it makes the syscall to the kernel (Linux, or possibly another kernel with this 64-bit-offset-mode-is-a-second-class-citizen nonsense). Just make sure to always include -D_FILE_OFFSET_BITS=64 in your CFLAGS and you'll never have to worry about anything.

codymanix

IIRC if you do

#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64

before all other includes you do not need to pass this flag.

additionally see

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!