linux/limits.h should be included by uapi instead of linux/auto_fs.h so as not to cause compile error in userspace. # cat << EOF > ./test1.c > #include <stdio.h> > #include <linux/auto_fs.h> > int main(void) { > return 0; > } > EOF # gcc -Wall -g ./test1.c In file included from ./test1.c:2:0: /usr/include/linux/auto_fs.h:54:12: error: 'NAME_MAX' undeclared here (not in a function) char name[NAME_MAX+1]; ^
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -12,6 +12,7 @@ · 11 unmodified lines | |||
| 12 | #define _UAPI_LINUX_AUTO_FS_H | 12 | #define _UAPI_LINUX_AUTO_FS_H |
| 13 | 13 | ||
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 15 | #include <linux/limits.h> | ||
| 15 | #ifndef __KERNEL__ | 16 | #ifndef __KERNEL__ |
| 16 | #include <sys/ioctl.h> | 17 | #include <sys/ioctl.h> |
| 17 | #endif /* __KERNEL__ */ | 18 | #endif /* __KERNEL__ */ |