VSF Documented
pwd.h
Go to the documentation of this file.
1#ifndef __VSF_LINUX_PWD_H__
2#define __VSF_LINUX_PWD_H__
3
5
6#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
7# include "./sys/types.h"
8#else
9# include <sys/types.h>
10#endif
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#if VSF_LINUX_CFG_WRAPPER == ENABLED
17#define getpwuid VSF_LINUX_WRAPPER(getpwuid)
18#define getpwnam VSF_LINUX_WRAPPER(getpwnam)
19#endif
20
21struct passwd {
22 char *pw_name;
23 char *pw_passwd;
26 char *pw_gecos;
27 char *pw_dir;
28 char *pw_shell;
29};
30
31#if VSF_LINUX_APPLET_USE_PWD == ENABLED
32typedef struct vsf_linux_pwd_vplt_t {
34
38# ifndef __VSF_APPLET__
40# endif
41#endif
42
43#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_PWD_LIB__))\
44 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_LINUX_APPLET_USE_PWD == ENABLED
45
46#ifndef VSF_LINUX_APPLET_PWD_VPLT
47# if VSF_LINUX_USE_APPLET == ENABLED
48# define VSF_LINUX_APPLET_PWD_VPLT \
49 ((vsf_linux_pwd_vplt_t *)(VSF_LINUX_APPLET_VPLT->pwd_vplt))
50# else
51# define VSF_LINUX_APPLET_PWD_VPLT \
52 ((vsf_linux_pwd_vplt_t *)vsf_vplt((void *)0))
53# endif
54#endif
55
56#define VSF_LINUX_APPLET_PWD_ENTRY(__NAME) \
57 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_PWD_VPLT, __NAME)
58#define VSF_LINUX_APPLET_PWD_IMP(...) \
59 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_PWD_VPLT, __VA_ARGS__)
60
61VSF_LINUX_APPLET_PWD_IMP(getpwuid, struct passwd *, uid_t uid) {
63 return VSF_LINUX_APPLET_PWD_ENTRY(getpwuid)(uid);
64}
65VSF_LINUX_APPLET_PWD_IMP(getpwnam, struct passwd *, const char *name) {
67 return VSF_LINUX_APPLET_PWD_ENTRY(getpwnam)(name);
68}
69
70#else
71
72struct passwd * getpwuid(uid_t uid);
73struct passwd * getpwnam(const char *name);
74
75#endif
76
77static inline int getpwuid_r(uid_t uid, struct passwd *pwd,
78 char *buffer, size_t bufsize, struct passwd **result)
79{
80 return 0;
81}
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif
unsigned int uid_t
Definition types.h:90
unsigned int gid_t
Definition types.h:91
__VSF_VPLT_DECORATOR__ vsf_linux_pwd_vplt_t vsf_linux_pwd_vplt
Definition vsf_linux.c:4964
#define getpwuid
Definition pwd.h:17
#define getpwnam
Definition pwd.h:18
Definition pwd.h:21
char * pw_name
Definition pwd.h:22
char * pw_gecos
Definition pwd.h:26
char * pw_passwd
Definition pwd.h:23
char * pw_shell
Definition pwd.h:28
uid_t pw_uid
Definition pwd.h:24
gid_t pw_gid
Definition pwd.h:25
char * pw_dir
Definition pwd.h:27
Definition pwd.h:32
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(getpwuid)
vsf_vplt_info_t info
Definition pwd.h:33
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(getpwnam)
Definition vsf_cfg.h:95
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165