mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 23:11:13 +01:00
Attempt to improve application portability by marking `struct ar_hdr'
as `packed'. The C standard leaves the alignment of individual members of a C struct upto the implementation, so pedantically speaking portable code cannot assume that the layout of a `struct ar_hdr' in memory will match its layout in a file. Using a __packed attribute declaration forces file and memory layouts for this structure to match. Submitted by: ru
This commit is contained in:
parent
80ca751b22
commit
9e1ea8f2fe
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164244
@ -39,11 +39,15 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ar.h 8.2 (Berkeley) 1/21/94
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _AR_H_
|
||||
#define _AR_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Pre-4BSD archives had these magic numbers in them. */
|
||||
#define OARMAG1 0177555
|
||||
#define OARMAG2 0177545
|
||||
@ -62,6 +66,6 @@ struct ar_hdr {
|
||||
char ar_size[10]; /* size in bytes */
|
||||
#define ARFMAG "`\n"
|
||||
char ar_fmag[2]; /* consistency check */
|
||||
};
|
||||
} __packed;
|
||||
|
||||
#endif /* !_AR_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user