summaryrefslogtreecommitdiff
path: root/sysdeps/posix/dirstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/dirstream.h')
-rw-r--r--sysdeps/posix/dirstream.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/sysdeps/posix/dirstream.h b/sysdeps/posix/dirstream.h
index a7a074d357..dadc30e8dd 100644
--- a/sysdeps/posix/dirstream.h
+++ b/sysdeps/posix/dirstream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2013 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,8 +39,15 @@ struct __dirstream
off_t filepos; /* Position of next entry to read. */
- /* Directory block. */
- char data[0] __attribute__ ((aligned (__alignof__ (void*))));
+ int errcode; /* Delayed error code. */
+
+ /* Directory block. We must make sure that this block starts
+ at an address that is aligned adequately enough to store
+ dirent entries. Using the alignment of "void *" is not
+ sufficient because dirents on 32-bit platforms can require
+ 64-bit alignment. We use "long double" here to be consistent
+ with what malloc uses. */
+ char data[0] __attribute__ ((aligned (__alignof__ (long double))));
};
#define _DIR_dirfd(dirp) ((dirp)->fd)