Subject: compile prob
To: None <current-users@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 05/01/2007 15:42:51
I just got

/usr/src/sys/compat/svr4/svr4_misc.c:1091: error: 'struct proc' has no member named 'p_ru'
/usr/src/sys/compat/svr4/svr4_misc.c:1092: error: 'struct proc' has no member named 'p_ru'

which seems fair enough. I had a look in svr4_32, and the code looks the
same, so no clues there...


svr4_misc.c:

static void
svr4_setinfo(p, st, s)
    struct proc *p; 
...
    svr4_siginfo_t *s; 
...
    if (p) {
        s->si_pid = p->p_pid;
        if (p->p_stat == SZOMB) {
            s->si_stime = p->p_ru->ru_stime.tv_sec;
            s->si_utime = p->p_ru->ru_utime.tv_sec;
        }       
        else {  
            s->si_stime = p->p_stats->p_ru.ru_stime.tv_sec;
            s->si_utime = p->p_stats->p_ru.ru_utime.tv_sec;
        }       
    }   


svr4_siginfo.h:

typedef union svr4_siginfo { 
    char    si_pad[128];    /* Total size; for future expansion */
    struct {
        int             _signo;
        int             _code;
        int             _errno;
#ifdef _LP64
        /* In _LP64 the union starts on an 8-byte boundary. */
        int             _pad;
#endif
        union {
            struct {
                svr4_pid_t  _pid;
                svr4_clock_t    _utime;
                int     _status;
                svr4_clock_t    _stime;
            } _child;

            struct {
                void *      _addr;
                int     _trap;
            } _fault;
        } _reason;
    } _info;
} svr4_siginfo_t;

BTW there is also
svr4_lwp.c:
TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_stime, &lwpinfo.lwp_stime);


Thoughts?

Cheers,

Patrick