1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Changed Tue Sep 19 01:49:29 1995, aeb: moved from man2 to man3
.\" added ref to /etc/utmp, added BUGS section, etc.
.\"
.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
.\" Translated Fri Mar 1 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated & Modified Sat Aug 21 1999
.\" by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.TH GETLOGIN 3 "3 September, 1995" "Linux 1.2.13" "Linux Programmer's Manual"
.SH ̾
getlogin, cuserid \- 桼̾
.SH
.B #include <unistd.h>
.sp
.B "char *getlogin(void);"
.sp
.B #include <stdio.h>
.sp
.BI "char *cuserid(char *" string );
.SH
.B getlogin
ϡߤΥץ椷Ƥü˥Ƥ桼̾ʸ
ؤΥݥ֤桼̾Ǥʤ null ݥ
ʸϥƥåΰ֤Ƥꡢδؿ⤦ٸƤ
Ф줿 \fBcuserid\fP ƤӽФ줿ȤˤϾ롣
.PP
.B cuserid
ϸߤΥץμ¸桼 ID б桼̾ʸؤΥݥ
֤ \fIstring\fP null ݥǤʤȤʤ롣
ϡʤȤ \fBL_cuserid\fP ʸݻ뤳ȤǤ롣ʸ
֤롣
դ \fIstring\fP null ݥξϡƥåΰ֤
ʸؤΥݥ֤롣ʸϥƥå˥Ȥ
ꡢδؿ⤦ٸƤӽФ줿 \fBgetlogin\fP ƤӽФ줿
ˤϾ롣
.PP
ޥ \fBL_cuserid\fP integer ǡ桼̾ݻ뤿
ɬפĹ \fBL_cuserid\fP \fBstdio.h\fP
롣
.PP
δؿϡץ¹ԤƤ桼 (\fBcuserid\fP) 丽
ߤΥå˥Ƥ桼 (\fBgetlogin\fP) Τꤹ
( setuid ץǤϡδؿη̤ۤʤ뤳Ȥ⤢)
.PP
ƤŪǤϡ桼ˤϴĶѿ \fBLOGNAME\fP Ĵ
ۤǤ롣LOGNAME ѿϥ桼ͳǤΤ
бǽˤʤ롣
.SH 顼
.TP
.B ENOMEM
passwd ¤ΤƤ꤬ʤ
.SH ե
.nf
\fI/etc/passwd\fP ѥɥǡ١Υե
.fi
\fI/etc/utmp\fP (ޤ \fI/var/adm/utmp\fP뤤ϺǶǤϡ
Ȥˤɤˤ \fIutmp\fP \- Τʾ libc ΥСˤ)
.SH
POSIX.1 System V ˤ \fBcuserid\fP 뤬ϼ¸桼 ID
Ϥʤ¥桼 ID Ѥ롣 \fBcuserid\fP ؿ 1988 ǯǤ POSIX
ˤϴޤޤƤ 1990 ǯǤǤϺ줿
.SH Х
ǰʤ顢 getlogin() ޤΤϤۤȤǤϤʤ̤Υ
ब utmp եƤޤȡưʤȤ⤢롣
̾κǽ 8 ʸ֤ʤȤ¿ޤץ
椷Ƥ tty ˸ߥƤ桼ϡץ¹Ԥ
桼Ǥʤ⤢롣
ƥӤˤ getlogin() Ѥ٤ǤϤʤ
.LP
.\" DO NOT USE cuserid().
cuserid() ԤäƤΤºݤΤȤΤäƤԤï⤤ʤ
\- ܿץǤ cuserid() ϻȤ٤ǤϤʤ
\- ȤɤʥץǤȤ٤ǤϤʤ \-
getpwuid(geteuid()) Ѥ٤Ǥ
(줬տޤƤ뤳ȤʤС)
cuserid() ϡֻȤʤפȡ
.SH Ϣ
.BR geteuid (2),
.BR getuid (2)
|