Ticket #3207: 0001-Add-a-stub-implementation-for-utmpx.h.patch

File 0001-Add-a-stub-implementation-for-utmpx.h.patch, 3.1 KB (added by vibhavp, 6 years ago)
  • new file headers/posix/sys/utmpx.h

    From 4d583fd750a0c5742c9aad3ecc257f23cbb0176f Mon Sep 17 00:00:00 2001
    From: Vibhav Pant <vibhavp@ubuntu.com>
    Date: Mon, 10 Dec 2012 22:01:00 +0530
    Subject: [PATCH] Add a stub implementation for utmpx.h
    
    ---
     headers/posix/sys/utmpx.h            |   49 ++++++++++++++++++++++++++++++++++
     src/system/libroot/posix/sys/utmpx.c |   46 +++++++++++++++++++++++++++++++
     2 files changed, 95 insertions(+)
     create mode 100644 headers/posix/sys/utmpx.h
     create mode 100644 src/system/libroot/posix/sys/utmpx.c
    
    diff --git a/headers/posix/sys/utmpx.h b/headers/posix/sys/utmpx.h
    new file mode 100644
    index 0000000..971d954
    - +  
     1/*
     2 * Copyright 2012 Haiku, Inc. All Rights Reserved.
     3 * Distributed under the terms of the MIT License.
     4*/
     5
     6// As of now, Haiku doesnt have multiuser support, this header provides a stub implementation
     7
     8#ifndef _SYS_UTMPX_H
     9#define _SYS_UTMPX_H
     10
     11#include <sys/types.h>
     12#include <sys/time.h>
     13
     14
     15// Symbolic constants for ut_type
     16#define EMPTY         0x01         // No valid user accounting information.
     17#define BOOT_TIME     0x02         // Identifies time of system boot.
     18#define OLD_TIME      0x03         // Identifies time when system clock changed.
     19#define NEW_TIME      0x04         // Identifies time after system clock changed.
     20#define USER_PROCESS  0x05         // Identifies a process.
     21#define INIT_PROCESS  0x06         // Identifies a process spawned by the init process.
     22#define LOGIN_PROCESS 0x07         // Identifies the session leader of a logged-in user
     23#define DEAD_PROCESS  0x08         // Identifies a session leader who has exited.
     24
     25struct utmpx
     26{
     27    char *ut_user;                // User login name
     28    char *ut_it;                  // Unspecified initialization process identifier.
     29    char *ut_line;                // Device name
     30    pid_t ut_id;                  // Process ID
     31    short ut_type;                // Type of entry
     32    struct timeval ut_tv;         // Time entry was made
     33}
     34#ifdef __cplusplus
     35    extern "C" {
     36#endif
     37
     38extern void endutxent(void);
     39extern struct utmpx *getutxent(void);
     40extern struct utmpx *getutxid(const struct utmpx *);
     41extern struct utmpx *getutxline(const struct utmpx *);
     42extern struct utmpx *pututxline(const struct utmpx *);
     43extern void setutxent(void);
     44
     45#ifdef __cplusplus
     46    }
     47#endif
     48
     49#endif // _SYS_UTMPX_H
  • new file src/system/libroot/posix/sys/utmpx.c

    diff --git a/src/system/libroot/posix/sys/utmpx.c b/src/system/libroot/posix/sys/utmpx.c
    new file mode 100644
    index 0000000..45db14f
    - +  
     1/*
     2 * Copyright 2012, Vibhav Pant, vibhavp@gmail.com.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#include <sys/utmpx.h>
     6
     7void
     8endutxent(void)
     9{
     10    return;
     11}
     12
     13
     14struct utmpx *
     15getutxent(void)
     16{
     17    return NULL;
     18}
     19
     20
     21struct utmpx *
     22getutxid(const struct utmpx *)
     23{
     24    return NULL;
     25}
     26
     27
     28struct utmpx *
     29getutxline(const struct utmpx *)
     30{
     31    return NULL;
     32}
     33
     34
     35struct utmpx *
     36pututxline(const struct utmpx *)
     37{
     38    return NULL;
     39}
     40
     41
     42void
     43setutxent(void)
     44{
     45    return;
     46}