aboutsummaryrefslogtreecommitdiff
path: root/libpwdgrp/pwd_grp.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /libpwdgrp/pwd_grp.c
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
Diffstat (limited to 'libpwdgrp/pwd_grp.c')
-rw-r--r--libpwdgrp/pwd_grp.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
index b535ef5c4..7e7ff4810 100644
--- a/libpwdgrp/pwd_grp.c
+++ b/libpwdgrp/pwd_grp.c
@@ -695,7 +695,8 @@ int putpwent(const struct passwd *__restrict p, FILE *__restrict f)
695 695
696int putgrent(const struct group *__restrict p, FILE *__restrict f) 696int putgrent(const struct group *__restrict p, FILE *__restrict f)
697{ 697{
698 static const char format[] = ",%s"; 698 static const char format[] ALIGN1 = ",%s";
699
699 char **m; 700 char **m;
700 const char *fmt; 701 const char *fmt;
701 int rv = -1; 702 int rv = -1;
@@ -735,18 +736,19 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
735} 736}
736 737
737#if ENABLE_USE_BB_SHADOW 738#if ENABLE_USE_BB_SHADOW
738static const unsigned char _sp_off[] = { 739static const unsigned char _sp_off[] ALIGN1 = {
739 offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */ 740 offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
740 offsetof(struct spwd, sp_min), /* 3 - not a char ptr */ 741 offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
741 offsetof(struct spwd, sp_max), /* 4 - not a char ptr */ 742 offsetof(struct spwd, sp_max), /* 4 - not a char ptr */
742 offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */ 743 offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
743 offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */ 744 offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
744 offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */ 745 offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */
745}; 746};
746 747
747int putspent(const struct spwd *p, FILE *stream) 748int putspent(const struct spwd *p, FILE *stream)
748{ 749{
749 static const char ld_format[] = "%ld:"; 750 static const char ld_format[] ALIGN1 = "%ld:";
751
750 const char *f; 752 const char *f;
751 long x; 753 long x;
752 int i; 754 int i;
@@ -787,14 +789,14 @@ DO_UNLOCK:
787/* Internal uClibc functions. */ 789/* Internal uClibc functions. */
788/**********************************************************************/ 790/**********************************************************************/
789 791
790static const unsigned char pw_off[] = { 792static const unsigned char pw_off[] ALIGN1 = {
791 offsetof(struct passwd, pw_name), /* 0 */ 793 offsetof(struct passwd, pw_name), /* 0 */
792 offsetof(struct passwd, pw_passwd), /* 1 */ 794 offsetof(struct passwd, pw_passwd), /* 1 */
793 offsetof(struct passwd, pw_uid), /* 2 - not a char ptr */ 795 offsetof(struct passwd, pw_uid), /* 2 - not a char ptr */
794 offsetof(struct passwd, pw_gid), /* 3 - not a char ptr */ 796 offsetof(struct passwd, pw_gid), /* 3 - not a char ptr */
795 offsetof(struct passwd, pw_gecos), /* 4 */ 797 offsetof(struct passwd, pw_gecos), /* 4 */
796 offsetof(struct passwd, pw_dir), /* 5 */ 798 offsetof(struct passwd, pw_dir), /* 5 */
797 offsetof(struct passwd, pw_shell) /* 6 */ 799 offsetof(struct passwd, pw_shell) /* 6 */
798}; 800};
799 801
800static int bb__parsepwent(void *data, char *line) 802static int bb__parsepwent(void *data, char *line)
@@ -845,10 +847,10 @@ static int bb__parsepwent(void *data, char *line)
845 847
846/**********************************************************************/ 848/**********************************************************************/
847 849
848static const unsigned char gr_off[] = { 850static const unsigned char gr_off[] ALIGN1 = {
849 offsetof(struct group, gr_name), /* 0 */ 851 offsetof(struct group, gr_name), /* 0 */
850 offsetof(struct group, gr_passwd), /* 1 */ 852 offsetof(struct group, gr_passwd), /* 1 */
851 offsetof(struct group, gr_gid) /* 2 - not a char ptr */ 853 offsetof(struct group, gr_gid) /* 2 - not a char ptr */
852}; 854};
853 855
854static int bb__parsegrent(void *data, char *line) 856static int bb__parsegrent(void *data, char *line)
@@ -943,16 +945,16 @@ static int bb__parsegrent(void *data, char *line)
943/**********************************************************************/ 945/**********************************************************************/
944 946
945#if ENABLE_USE_BB_SHADOW 947#if ENABLE_USE_BB_SHADOW
946static const unsigned char sp_off[] = { 948static const unsigned char sp_off[] ALIGN1 = {
947 offsetof(struct spwd, sp_namp), /* 0 */ 949 offsetof(struct spwd, sp_namp), /* 0 */
948 offsetof(struct spwd, sp_pwdp), /* 1 */ 950 offsetof(struct spwd, sp_pwdp), /* 1 */
949 offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */ 951 offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
950 offsetof(struct spwd, sp_min), /* 3 - not a char ptr */ 952 offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
951 offsetof(struct spwd, sp_max), /* 4 - not a char ptr */ 953 offsetof(struct spwd, sp_max), /* 4 - not a char ptr */
952 offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */ 954 offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
953 offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */ 955 offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
954 offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */ 956 offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */
955 offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */ 957 offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */
956}; 958};
957 959
958static int bb__parsespent(void *data, char * line) 960static int bb__parsespent(void *data, char * line)