mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 15:50:23 +00:00
libs/libc/pwd: Add getlogin() and getlogin_r().
POSIX specifies getlogin() and getlogin_r(), and NuttX did not have them. NuttX has no login sessions, so the login name is the name of the real user ID in the user database, from getpwuid_r(): "root" when there is no passwd file. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This commit is contained in:
parent
73760338dc
commit
12d5e1c0ba
4 changed files with 121 additions and 2 deletions
|
|
@ -399,6 +399,11 @@ int isatty(int fd);
|
|||
FAR char *ttyname(int fd);
|
||||
int ttyname_r(int fd, FAR char *buf, size_t buflen);
|
||||
|
||||
/* The name of the user */
|
||||
|
||||
FAR char *getlogin(void);
|
||||
int getlogin_r(FAR char *buf, size_t bufsize);
|
||||
|
||||
/* Memory management */
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue