|
|
Message-ID: <20260420005546.22057-1-mailto.luca.kellermann@gmail.com>
Date: Mon, 20 Apr 2026 02:43:09 +0200
From: Luca Kellermann <mailto.luca.kellermann@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH] sys/types.h: add reclen_t
POSIX.1-2024 requires both dirent.h and sys/types.h to define this
type.
---
In dirent.h, the __NEED_* macros were already in alphabetical order,
so I kept it that way. For alltypes.h.in and sys/types.h, I wasn't
quite sure where to put reclen_t. But next to *cnt_t seemed
reasonable. Is that OK?
include/alltypes.h.in | 1 +
include/dirent.h | 3 +--
include/sys/types.h | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/alltypes.h.in b/include/alltypes.h.in
index d47aeea9aa8b8cf06a8eb64055d6d4a48cda2557..4d6a7286561025d89f0a64e3bb948ea0860ceb11 100644
--- a/include/alltypes.h.in
+++ b/include/alltypes.h.in
@@ -33,6 +33,7 @@ TYPEDEF long blksize_t;
TYPEDEF _Int64 blkcnt_t;
TYPEDEF unsigned _Int64 fsblkcnt_t;
TYPEDEF unsigned _Int64 fsfilcnt_t;
+TYPEDEF unsigned short reclen_t;
TYPEDEF unsigned wint_t;
TYPEDEF unsigned long wctype_t;
diff --git a/include/dirent.h b/include/dirent.h
index 7fa60e06721718a9a686156a84ebff179e476c56..d403109f7e1ca26a079b087e4b69c17cbec93b1f 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -9,6 +9,7 @@ extern "C" {
#define __NEED_ino_t
#define __NEED_off_t
+#define __NEED_reclen_t
#define __NEED_size_t
#define __NEED_ssize_t
@@ -16,8 +17,6 @@ extern "C" {
#include <bits/dirent.h>
-typedef unsigned short reclen_t;
-
struct posix_dent {
ino_t d_ino;
off_t d_off;
diff --git a/include/sys/types.h b/include/sys/types.h
index 3363374fd3d6f258b6de881f565ad9e941427120..9f89b5800d914913d94a7dfc223945d5041be8a0 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -23,6 +23,7 @@ extern "C" {
#define __NEED_blkcnt_t
#define __NEED_fsblkcnt_t
#define __NEED_fsfilcnt_t
+#define __NEED_reclen_t
#define __NEED_id_t
#define __NEED_key_t
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.