getlogin.3
来自「操作系统设计与实现源码」· 3 代码 · 共 46 行
3
46 行
.\" @(#)getlogin.3 6.2 (Berkeley) 5/9/86.\".TH GETLOGIN 3 "May 9, 1986".AT 3.SH NAMEgetlogin \- get login name.SH SYNOPSIS.nf.ft B#include <unistd.h>char *getlogin(void).fi.SH DESCRIPTION.B Getloginreturns a pointer to the login name as found in.BR /etc/utmp .It may be used in conjunction with.B getpwnamto locate the correct password file entry when the same user IDis shared by several login names..PPIf.B getloginis called within a process that is not attached to aterminal, or if there is no entry in.B /etc/utmpfor the process's terminal,.B getloginreturns a null pointer.A reasonable procedure for determining the login name is to first call.B getloginand if it fails, to call.BR getpwuid ( getuid ())..SH FILES/etc/utmp.SH "SEE ALSO".BR getpwent (3),.BR utmp (5),.BR ttyslot (3).SH DIAGNOSTICSReturns a null pointer if the name cannot be found..SH BUGSThe return values point to static datawhose content is overwritten by each call.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?