OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libutil/] [login.c] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#include <errno.h>
2
#include <limits.h>
3
#include <string.h>
4
#include <unistd.h>
5
#include <stdlib.h>
6
#include <utmp.h>
7
 
8
/* Write the given entry into utmp and wtmp.  */
9
void login (const struct utmp *entry)
10
{
11
    struct utmp copy = *entry;
12
 
13
    utmpname(_PATH_UTMP);
14
    setutent();
15
#if _HAVE_UT_TYPE - 0 
16
    copy.ut_type = USER_PROCESS;
17
#endif  
18
#if _HAVE_UT_PID - 0
19
    copy.ut_pid = getpid();
20
#endif
21
    strncpy (copy.ut_line, entry->ut_line, UT_LINESIZE);
22
    pututline(entry);
23
    endutent();
24
}
25
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.