1 /*
2  * Copyright (c) 2024 Meta Platforms
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef ZEPHYR_INCLUDE_POSIX_PWD_H_
7 #define ZEPHYR_INCLUDE_POSIX_PWD_H_
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #include <zephyr/posix/sys/stat.h>
14 
15 struct passwd {
16 	/* user's login name */
17 	char *pw_name;
18 	/* numerical user ID */
19 	uid_t pw_uid;
20 	/* numerical group ID */
21 	gid_t pw_gid;
22 	/* initial working directory */
23 	char *pw_dir;
24 	/* program to use as shell */
25 	char *pw_shell;
26 };
27 
28 int getpwnam_r(const char *nam, struct passwd *pwd, char *buffer, size_t bufsize,
29 	       struct passwd **result);
30 int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif /* ZEPHYR_INCLUDE_POSIX_PWD_H_ */
37