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

File 0001-Added-stub-implementation-for-utmpx.h.patch, 3.4 KB (added by vibhavp, 7 years ago)
  • new file headers/posix/sys/utmpx.h

    From c9b49ef10a48d04d107fc19c11bf604e97a3d285 Mon Sep 17 00:00:00 2001
    From: Vibhav Pant <vibhavp@ubuntu.com>
    Date: Tue, 11 Dec 2012 13:16:59 +0530
    Subject: [PATCH] Added stub implementation for utmpx.h
    
    ---
     headers/posix/sys/utmpx.h            |   50 ++++++++++++++++++++++++++++++++++
     src/system/libroot/posix/sys/Jamfile |    1 +
     src/system/libroot/posix/sys/utmpx.c |   43 +++++++++++++++++++++++++++++
     3 files changed, 94 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..3a7b586
    - +  
     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
     35extern "C" {
     36#endif
     37
     38extern void endutxent(void);
     39extern struct utmpx *getutxent(void);
     40extern struct utmpx *getutxid(const struct utmpx *ut);
     41struct utmpx *getutxline(const struct utmpx *ut);
     42struct utmpx *pututxline(const struct utmpx *ut);
     43void setutxent(void);
     44
     45#ifdef __cplusplus
     46}
     47#endif
     48
     49#endif // _SYS_UTMPX_H
     50
  • src/system/libroot/posix/sys/Jamfile

    diff --git a/src/system/libroot/posix/sys/Jamfile b/src/system/libroot/posix/sys/Jamfile
    index 3f439cb..753bcee 100644
    a b MergeObject posix_sys.o :  
    2323    umask.c
    2424    uname.c
    2525    utimes.c
     26    utmpx.c
    2627    wait.cpp
    2728    xsi_msg_queue.cpp
    2829    xsi_sem.cpp
  • 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..6e1fbe8
    - +  
     1/*
     2 * Copyright 2012, Vibhav Pant, vibhavp@gmail.com.
     3 * Distributed under the terms of the MIT License.
     4 */
     5#include "utmpx.h"
     6#include <stdio.h>
     7
     8void
     9endutxent(void)
     10{
     11    return;
     12}
     13
     14struct utmpx *
     15getutxent(void)
     16{
     17    return NULL;
     18}
     19
     20struct utmpx *
     21getutxid(const struct utmpx *ut)
     22{
     23  return NULL;
     24}
     25
     26struct utmpx *
     27getutxline(const struct utmpx *ut)
     28{
     29    return NULL;
     30}
     31
     32struct utmpx *
     33pututxline(const struct utmpx *ut)
     34{
     35    return NULL;
     36}
     37
     38void
     39setutxent(void)
     40{
     41    return;
     42}
     43