示例#1
0
文件: utent.c 项目: OPSF/uClinux
struct utmp *getutid(const struct utmp *utmp_entry)
{
    struct utmp *ret = NULL;

    __UCLIBC_MUTEX_LOCK(utmplock);
    ret = __getutid(utmp_entry);
    __UCLIBC_MUTEX_UNLOCK(utmplock);
    return ret;
}
示例#2
0
文件: utent.c 项目: OPSF/uClinux
struct utmp *pututline (const struct utmp *utmp_entry)
{
    __UCLIBC_MUTEX_LOCK(utmplock);
    /* Ignore the return value.  That way, if they've already positioned
       the file pointer where they want it, everything will work out. */
    lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);

    if (__getutid(utmp_entry) != NULL)
	lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
    else
	lseek(static_fd, (off_t) 0, SEEK_END);
    if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp))
	utmp_entry = NULL;

    __UCLIBC_MUTEX_UNLOCK(utmplock);
    return (struct utmp *)utmp_entry;
}
示例#3
0
struct utmpx *
getutxid (const struct utmpx *id)
{
  return (struct utmpx *) __getutid ((const struct utmp *) id);
}