diff options
Diffstat (limited to 'libpwdgrp/pwd_grp.c')
-rw-r--r-- | libpwdgrp/pwd_grp.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c index ed8370124..0d8e2bb5c 100644 --- a/libpwdgrp/pwd_grp.c +++ b/libpwdgrp/pwd_grp.c | |||
@@ -288,7 +288,7 @@ static void *convert_to_struct(const char *def, const unsigned char *off, | |||
288 | 288 | ||
289 | /****** getXXnam/id_r */ | 289 | /****** getXXnam/id_r */ |
290 | 290 | ||
291 | static int getXXnam_r(const char *name, uintptr_t db_and_field_pos, char *buffer, size_t buflen, | 291 | static int FAST_FUNC getXXnam_r(const char *name, uintptr_t db_and_field_pos, char *buffer, size_t buflen, |
292 | void *result) | 292 | void *result) |
293 | { | 293 | { |
294 | void *struct_buf = *(void**)result; | 294 | void *struct_buf = *(void**)result; |
@@ -316,18 +316,18 @@ static int getXXnam_r(const char *name, uintptr_t db_and_field_pos, char *buffer | |||
316 | return errno; | 316 | return errno; |
317 | } | 317 | } |
318 | 318 | ||
319 | int getpwnam_r(const char *name, struct passwd *struct_buf, char *buffer, size_t buflen, | 319 | int FAST_FUNC getpwnam_r(const char *name, struct passwd *struct_buf, char *buffer, size_t buflen, |
320 | struct passwd **result) | 320 | struct passwd **result) |
321 | { | 321 | { |
322 | /* Why the "store buffer address in result" trick? | 322 | /* Why the "store buffer address in result" trick? |
323 | * This way, getXXnam_r has the same ABI signature as getpwnam_r, | 323 | * This way, getXXnam_r has the same ABI signature as getpwnam_r, |
324 | * hopefully compiler can optimize tall call better in this case. | 324 | * hopefully compiler can optimize tail call better in this case. |
325 | */ | 325 | */ |
326 | *result = struct_buf; | 326 | *result = struct_buf; |
327 | return getXXnam_r(name, (0 << 2) + 0, buffer, buflen, result); | 327 | return getXXnam_r(name, (0 << 2) + 0, buffer, buflen, result); |
328 | } | 328 | } |
329 | #if ENABLE_USE_BB_SHADOW | 329 | #if ENABLE_USE_BB_SHADOW |
330 | int getspnam_r(const char *name, struct spwd *struct_buf, char *buffer, size_t buflen, | 330 | int FAST_FUNC getspnam_r(const char *name, struct spwd *struct_buf, char *buffer, size_t buflen, |
331 | struct spwd **result) | 331 | struct spwd **result) |
332 | { | 332 | { |
333 | *result = struct_buf; | 333 | *result = struct_buf; |
@@ -337,7 +337,7 @@ int getspnam_r(const char *name, struct spwd *struct_buf, char *buffer, size_t b | |||
337 | 337 | ||
338 | /****** getXXent_r */ | 338 | /****** getXXent_r */ |
339 | 339 | ||
340 | static int getXXent_r(void *struct_buf, char *buffer, size_t buflen, | 340 | static int FAST_FUNC getXXent_r(void *struct_buf, char *buffer, size_t buflen, |
341 | void *result, | 341 | void *result, |
342 | unsigned db_idx) | 342 | unsigned db_idx) |
343 | { | 343 | { |
@@ -374,14 +374,14 @@ static int getXXent_r(void *struct_buf, char *buffer, size_t buflen, | |||
374 | return errno; | 374 | return errno; |
375 | } | 375 | } |
376 | 376 | ||
377 | int getpwent_r(struct passwd *struct_buf, char *buffer, size_t buflen, struct passwd **result) | 377 | int FAST_FUNC getpwent_r(struct passwd *struct_buf, char *buffer, size_t buflen, struct passwd **result) |
378 | { | 378 | { |
379 | return getXXent_r(struct_buf, buffer, buflen, result, 0); | 379 | return getXXent_r(struct_buf, buffer, buflen, result, 0); |
380 | } | 380 | } |
381 | 381 | ||
382 | /****** getXXnam/id */ | 382 | /****** getXXnam/id */ |
383 | 383 | ||
384 | static void *getXXnam(const char *name, unsigned db_and_field_pos) | 384 | static void* FAST_FUNC getXXnam(const char *name, unsigned db_and_field_pos) |
385 | { | 385 | { |
386 | char *buf; | 386 | char *buf; |
387 | void *result; | 387 | void *result; |
@@ -409,39 +409,39 @@ static void *getXXnam(const char *name, unsigned db_and_field_pos) | |||
409 | return result; | 409 | return result; |
410 | } | 410 | } |
411 | 411 | ||
412 | struct passwd *getpwnam(const char *name) | 412 | struct passwd* FAST_FUNC getpwnam(const char *name) |
413 | { | 413 | { |
414 | return getXXnam(name, (0 << 2) + 0); | 414 | return getXXnam(name, (0 << 2) + 0); |
415 | } | 415 | } |
416 | struct group *getgrnam(const char *name) | 416 | struct group* FAST_FUNC getgrnam(const char *name) |
417 | { | 417 | { |
418 | return getXXnam(name, (1 << 2) + 0); | 418 | return getXXnam(name, (1 << 2) + 0); |
419 | } | 419 | } |
420 | struct passwd *getpwuid(uid_t id) | 420 | struct passwd* FAST_FUNC getpwuid(uid_t id) |
421 | { | 421 | { |
422 | return getXXnam(utoa(id), (0 << 2) + 2); | 422 | return getXXnam(utoa(id), (0 << 2) + 2); |
423 | } | 423 | } |
424 | struct group *getgrgid(gid_t id) | 424 | struct group* FAST_FUNC getgrgid(gid_t id) |
425 | { | 425 | { |
426 | return getXXnam(utoa(id), (1 << 2) + 2); | 426 | return getXXnam(utoa(id), (1 << 2) + 2); |
427 | } | 427 | } |
428 | 428 | ||
429 | /****** end/setXXend */ | 429 | /****** end/setXXend */ |
430 | 430 | ||
431 | void endpwent(void) | 431 | void FAST_FUNC endpwent(void) |
432 | { | 432 | { |
433 | if (has_S && S.db[0].fp) { | 433 | if (has_S && S.db[0].fp) { |
434 | fclose(S.db[0].fp); | 434 | fclose(S.db[0].fp); |
435 | S.db[0].fp = NULL; | 435 | S.db[0].fp = NULL; |
436 | } | 436 | } |
437 | } | 437 | } |
438 | void setpwent(void) | 438 | void FAST_FUNC setpwent(void) |
439 | { | 439 | { |
440 | if (has_S && S.db[0].fp) { | 440 | if (has_S && S.db[0].fp) { |
441 | rewind(S.db[0].fp); | 441 | rewind(S.db[0].fp); |
442 | } | 442 | } |
443 | } | 443 | } |
444 | void endgrent(void) | 444 | void FAST_FUNC endgrent(void) |
445 | { | 445 | { |
446 | if (has_S && S.db[1].fp) { | 446 | if (has_S && S.db[1].fp) { |
447 | fclose(S.db[1].fp); | 447 | fclose(S.db[1].fp); |
@@ -491,7 +491,7 @@ static gid_t* FAST_FUNC getgrouplist_internal(int *ngroups_ptr, | |||
491 | return group_list; | 491 | return group_list; |
492 | } | 492 | } |
493 | 493 | ||
494 | int initgroups(const char *user, gid_t gid) | 494 | int FAST_FUNC initgroups(const char *user, gid_t gid) |
495 | { | 495 | { |
496 | int ngroups; | 496 | int ngroups; |
497 | gid_t *group_list = getgrouplist_internal(&ngroups, user, gid); | 497 | gid_t *group_list = getgrouplist_internal(&ngroups, user, gid); |
@@ -501,7 +501,7 @@ int initgroups(const char *user, gid_t gid) | |||
501 | return ngroups; | 501 | return ngroups; |
502 | } | 502 | } |
503 | 503 | ||
504 | int getgrouplist(const char *user, gid_t gid, gid_t *groups, int *ngroups) | 504 | int FAST_FUNC getgrouplist(const char *user, gid_t gid, gid_t *groups, int *ngroups) |
505 | { | 505 | { |
506 | int ngroups_old = *ngroups; | 506 | int ngroups_old = *ngroups; |
507 | gid_t *group_list = getgrouplist_internal(ngroups, user, gid); | 507 | gid_t *group_list = getgrouplist_internal(ngroups, user, gid); |