posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
pwd.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Meta Platforms
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef ZEPHYR_INCLUDE_POSIX_PWD_H_
18#define ZEPHYR_INCLUDE_POSIX_PWD_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <sys/stat.h>
25
27struct passwd {
28 char *pw_name;
29 uid_t pw_uid;
30 gid_t pw_gid;
31 char *pw_dir;
32 char *pw_shell;
33};
34
46int getpwnam_r(const char *nam, struct passwd *pwd, char *buffer, size_t bufsize,
47 struct passwd **result);
48
60int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result);
61
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* ZEPHYR_INCLUDE_POSIX_PWD_H_ */
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
Look up a password entry by user ID (thread-safe).
int getpwnam_r(const char *nam, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
Look up a password entry by name (thread-safe).
POSIX file status types and functions (<sys/stat.h>)
Password database entry.
Definition pwd.h:27
char * pw_name
User's login name.
Definition pwd.h:28
char * pw_shell
Program to use as shell.
Definition pwd.h:32
uid_t pw_uid
Numerical user ID.
Definition pwd.h:29
gid_t pw_gid
Numerical group ID.
Definition pwd.h:30
char * pw_dir
Initial working directory.
Definition pwd.h:31