From 98d8505c6e797d649220d1fe0593ff023be87ea5 Mon Sep 17 00:00:00 2001 From: carl Date: Mon, 25 Mar 2019 00:07:43 +0800 Subject: [PATCH] arch.h flag fixing --- h/arch.h | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/h/arch.h b/h/arch.h index 9d6e99cd8..fc003de41 100644 --- a/h/arch.h +++ b/h/arch.h @@ -9,9 +9,12 @@ #define ARMAG 0177545 #define AALMAG 0177454 +#define AR_NAME_MAX 14 struct ar_hdr { - char ar_name[14]; + /** null terminated filename. */ + char ar_name[AR_NAME_MAX]; + /** last modification time, defined as seconds since epoch. */ long ar_date; char ar_uid; char ar_gid; @@ -22,4 +25,33 @@ struct ar_hdr { #define AR_TOTAL 26 #define AR_SIZE 22 + +/** ar_mode Read permission bit for the owner of the file. */ +#define AR_IRUSR 0400 +/** ar_mode Write permission bit for the owner of the file. */ +#define AR_IWUSR 0200 +/** ar_mode Execute (for ordinary files) or search (for directories) + * permission bit for the owner of the file. + */ +#define AR_IXUSR 0100 +/** ar_mode Read permission bit for the group owner of the file. */ +#define AR_IRGRP 040 +/** ar_mode Write permission bit for the group owner of the file. */ +#define AR_IWGRP 020 +/** ar_mode Execute or search permission bit for the group owner of the file. */ +#define AR_IXGRP 010 +/** ar_mode Read permission bit for other users. */ +#define AR_IROTH 04 +/** ar_mode Write permission for other users. */ +#define AR_IWOTH 02 +/** ar_mode Execute or search permission bit for other users. */ +#define AR_IXOTH 01 + +/* This is the set-user-ID on execute bit. */ +#define AR_ISUID 04000 +/* This is the set-group-ID on execute bit. */ +#define AR_ISGID 02000 + + + #endif /* __ARCH_H_INCLUDED */