aboutsummaryrefslogtreecommitdiff
path: root/include/pwd_.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-01-02 22:31:07 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-01-02 22:31:07 +0100
commit908b6e5dfdbc81322680ce939e5415161c637bb4 (patch)
treed3a5d43b353963cf0ac8faa79b5839c611e63c40 /include/pwd_.h
parent1da09cfacf1c4789cc74322857a098c2ddb06e31 (diff)
downloadbusybox-w32-908b6e5dfdbc81322680ce939e5415161c637bb4.tar.gz
busybox-w32-908b6e5dfdbc81322680ce939e5415161c637bb4.tar.bz2
busybox-w32-908b6e5dfdbc81322680ce939e5415161c637bb4.zip
libpwdgrp: use FAST_FUNC to make "matching ABI" optimization more likely to succeed
See bb_internal_get*nam_r size reduction: function old new delta bb_internal_getpwent_r 167 176 +9 getXXnam_r 204 206 +2 sulogin_main 326 325 -1 su_main 471 470 -1 read_line_input 3832 3831 -1 print_stat 865 864 -1 prepare_socket_fd 283 282 -1 load_crontab 777 776 -1 fork_job 456 455 -1 do_shm 884 883 -1 do_sem 637 636 -1 do_msg 783 782 -1 complete_username 124 123 -1 bb_internal_getgrouplist 71 70 -1 xgetpwuid 27 25 -2 xgetpwnam 27 25 -2 xgetgrnam 27 25 -2 xgetgrgid 27 25 -2 uid2uname 18 16 -2 login_main 980 978 -2 gid2group 18 16 -2 get_shell_name 54 52 -2 change_identity 50 48 -2 bb_internal_initgroups 50 48 -2 argstr 1261 1259 -2 print_perms 177 174 -3 inetd_main 2077 2074 -3 run_applet_no_and_exit 446 442 -4 fileaction_setowngrp 89 85 -4 deluser_main 312 308 -4 bb_internal_getpwuid 19 15 -4 bb_internal_getpwnam 11 7 -4 bb_internal_getgrnam 14 10 -4 bb_internal_getgrgid 19 15 -4 adduser_main 865 861 -4 passwd_main 989 984 -5 get_passwd 97 92 -5 data_extract_all 887 882 -5 check_user_passwd 490 485 -5 get_groups 81 75 -6 ftpd_main 2178 2171 -7 bb_internal_getspnam_r 42 18 -24 bb_internal_getpwnam_r 39 15 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/41 up/down: 11/-153) Total: -142 bytes text data bss dec hex filename 923167 928 17676 941771 e5ecb busybox_old 923023 928 17676 941627 e5e3b busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/pwd_.h')
-rw-r--r--include/pwd_.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/pwd_.h b/include/pwd_.h
index d086f86e3..32b5b366e 100644
--- a/include/pwd_.h
+++ b/include/pwd_.h
@@ -43,21 +43,21 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
43 * in order to not collide with libc names. */ 43 * in order to not collide with libc names. */
44 44
45/* Rewind the password-file stream. */ 45/* Rewind the password-file stream. */
46extern void setpwent(void); 46void FAST_FUNC setpwent(void);
47 47
48/* Close the password-file stream. */ 48/* Close the password-file stream. */
49extern void endpwent(void); 49void FAST_FUNC endpwent(void);
50 50
51#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS 51#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
52/* Read an entry from the password-file stream, opening it if necessary. */ 52/* Read an entry from the password-file stream, opening it if necessary. */
53extern struct passwd *getpwent(void); 53struct passwd* FAST_FUNC getpwent(void);
54#endif 54#endif
55 55
56/* Search for an entry with a matching user ID. */ 56/* Search for an entry with a matching user ID. */
57extern struct passwd *getpwuid(uid_t __uid); 57struct passwd* FAST_FUNC getpwuid(uid_t __uid);
58 58
59/* Search for an entry with a matching username. */ 59/* Search for an entry with a matching username. */
60extern struct passwd *getpwnam(const char *__name); 60struct passwd* FAST_FUNC getpwnam(const char *__name);
61 61
62/* Reentrant versions of some of the functions above. 62/* Reentrant versions of some of the functions above.
63 63
@@ -67,11 +67,11 @@ extern struct passwd *getpwnam(const char *__name);
67 other reentrant functions so the chances are good this is what the 67 other reentrant functions so the chances are good this is what the
68 POSIX people would choose. */ 68 POSIX people would choose. */
69 69
70extern int getpwent_r(struct passwd *__restrict __resultbuf, 70int FAST_FUNC getpwent_r(struct passwd *__restrict __resultbuf,
71 char *__restrict __buffer, size_t __buflen, 71 char *__restrict __buffer, size_t __buflen,
72 struct passwd **__restrict __result); 72 struct passwd **__restrict __result);
73 73
74extern int getpwnam_r(const char *__restrict __name, 74int FAST_FUNC getpwnam_r(const char *__restrict __name,
75 struct passwd *__restrict __resultbuf, 75 struct passwd *__restrict __resultbuf,
76 char *__restrict __buffer, size_t __buflen, 76 char *__restrict __buffer, size_t __buflen,
77 struct passwd **__restrict __result); 77 struct passwd **__restrict __result);