Skip to content

Commit 6d921c7

Browse files
committed
posix: sys/stat.h: declare missing types in sys/stat.h
After adopting the `<sys/stat.h>` header from picolibc, there is a possibility that the following types are not defined. ```cpp typedef int dev_t; typedef int ino_t; typedef unsigned short nlink_t; typedef unsigned short uid_t; typedef unsigned short gid_t; typedef unsigned long blksize_t; typedef unsigned long blkcnt_t; ``` Of the above missing types, the oonly ones that are used today in Zephyr are `blksize_t` and `blkcnt_t`. Signed-off-by: Chris Friedt <[email protected]>
1 parent 799ab3c commit 6d921c7

File tree

1 file changed

+35
-0
lines changed
  • include/zephyr/posix/sys

1 file changed

+35
-0
lines changed

include/zephyr/posix/sys/stat.h

+35
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,41 @@ extern "C" {
3939
#include <sys/types.h>
4040
#include <sys/_timespec.h>
4141

42+
#ifndef _DEV_T_DECLARED
43+
typedef int dev_t;
44+
#define _DEV_T_DECLARED
45+
#endif
46+
47+
#ifndef _INO_T_DECLARED
48+
typedef int ino_t;
49+
#define _INO_T_DECLARED
50+
#endif
51+
52+
#ifndef _NLINK_T_DECLARED
53+
typedef unsigned short nlink_t;
54+
#define _NLINK_T_DECLARED
55+
#endif
56+
57+
#ifndef _UID_T_DECLARED
58+
typedef unsigned short uid_t;
59+
#define _UID_T_DECLARED
60+
#endif
61+
62+
#ifndef _GID_T_DECLARED
63+
typedef unsigned short gid_t;
64+
#define _GID_T_DECLARED
65+
#endif
66+
67+
#ifndef _BLKSIZE_T_DECLARED
68+
typedef unsigned long blksize_t;
69+
#define _BLKSIZE_T_DECLARED
70+
#endif
71+
72+
#ifndef _BLKCNT_T_DECLARED
73+
typedef unsigned long blkcnt_t;
74+
#define _BLKCNT_T_DECLARED
75+
#endif
76+
4277
/* dj's stat defines _STAT_H_ */
4378
#ifndef _STAT_H_
4479

0 commit comments

Comments
 (0)