Kernel/LibC: Rework dirent structure

dirent now contains statically sized d_name. This allows using
sizeof on the name and dirent properly, which some programs seem
to be using.
This commit is contained in:
2024-05-22 20:17:39 +03:00
parent e77de1804f
commit 0af74fccda
13 changed files with 52 additions and 96 deletions

View File

@@ -10,7 +10,6 @@ __BEGIN_DECLS
#define __need_ino_t
#include <sys/types.h>
struct __DIR;
typedef struct __DIR DIR;
#define DT_UNKNOWN 0
@@ -26,7 +25,7 @@ struct dirent
{
ino_t d_ino; /* File serial number. */
unsigned char d_type; /* File type. One of DT_* definitions. */
char d_name[]; /* Filename string of entry. */
char d_name[256]; /* Filename string of entry. */
};
int alphasort(const struct dirent** d1, const struct dirent** d2);