freebsd.hh revision 11383
110810Sbr@bsdpad.com/*
210810Sbr@bsdpad.com * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
310810Sbr@bsdpad.com * All rights reserved.
410810Sbr@bsdpad.com *
510810Sbr@bsdpad.com * This software was developed by the University of Cambridge Computer
610810Sbr@bsdpad.com * Laboratory as part of the CTSRD Project, with support from the UK Higher
710810Sbr@bsdpad.com * Education Innovation Fund (HEIF).
810810Sbr@bsdpad.com *
910810Sbr@bsdpad.com * Redistribution and use in source and binary forms, with or without
1010810Sbr@bsdpad.com * modification, are permitted provided that the following conditions are
1110810Sbr@bsdpad.com * met: redistributions of source code must retain the above copyright
1210810Sbr@bsdpad.com * notice, this list of conditions and the following disclaimer;
1310810Sbr@bsdpad.com * redistributions in binary form must reproduce the above copyright
1410810Sbr@bsdpad.com * notice, this list of conditions and the following disclaimer in the
1510810Sbr@bsdpad.com * documentation and/or other materials provided with the distribution;
1610810Sbr@bsdpad.com * neither the name of the copyright holders nor the names of its
1710810Sbr@bsdpad.com * contributors may be used to endorse or promote products derived from
1810810Sbr@bsdpad.com * this software without specific prior written permission.
1910810Sbr@bsdpad.com *
2010810Sbr@bsdpad.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2110810Sbr@bsdpad.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2210810Sbr@bsdpad.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2310810Sbr@bsdpad.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2410810Sbr@bsdpad.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2510810Sbr@bsdpad.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2610810Sbr@bsdpad.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2710810Sbr@bsdpad.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2810810Sbr@bsdpad.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2910810Sbr@bsdpad.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3010810Sbr@bsdpad.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3110810Sbr@bsdpad.com */
3210810Sbr@bsdpad.com
3310810Sbr@bsdpad.com#ifndef __ARCH_ARM_FREEBSD_FREEBSD_HH__
3410810Sbr@bsdpad.com#define __ARCH_ARM_FREEBSD_FREEBSD_HH__
3510810Sbr@bsdpad.com
3610810Sbr@bsdpad.com#include "kern/freebsd/freebsd.hh"
3710810Sbr@bsdpad.com
3810810Sbr@bsdpad.comclass ArmFreebsd32 : public FreeBSD
3910810Sbr@bsdpad.com{
4010810Sbr@bsdpad.com  public:
4110810Sbr@bsdpad.com
4210810Sbr@bsdpad.com    /// This table maps the target open() flags to the corresponding
4310810Sbr@bsdpad.com    /// host open() flags.
4411381Sbrandon.potter@amd.com    static SyscallFlagTransTable openFlagTable[];
4510810Sbr@bsdpad.com
4610810Sbr@bsdpad.com    /// Number of entries in openFlagTable[].
4710810Sbr@bsdpad.com    static const int NUM_OPEN_FLAGS;
4810810Sbr@bsdpad.com
4910810Sbr@bsdpad.com    //@{
5010810Sbr@bsdpad.com    /// Basic ARM FreeBSD types
5110810Sbr@bsdpad.com    typedef uint32_t size_t;
5210810Sbr@bsdpad.com    typedef uint32_t off_t;
5310810Sbr@bsdpad.com    typedef int32_t time_t;
5410810Sbr@bsdpad.com    typedef int32_t clock_t;
5510810Sbr@bsdpad.com    //@}
5610810Sbr@bsdpad.com
5710810Sbr@bsdpad.com    //@{
5810810Sbr@bsdpad.com    /// open(2) flag values.
5910810Sbr@bsdpad.com    static const int TGT_O_RDONLY    = 0x00000000; //!< O_RDONLY
6010810Sbr@bsdpad.com    static const int TGT_O_WRONLY    = 0x00000001; //!< O_WRONLY
6110810Sbr@bsdpad.com    static const int TGT_O_RDWR      = 0x00000002; //!< O_RDWR
6210810Sbr@bsdpad.com    static const int TGT_O_CREAT     = 0x00000200; //!< O_CREAT
6310810Sbr@bsdpad.com    static const int TGT_O_EXCL      = 0x00000800; //!< O_EXCL
6410810Sbr@bsdpad.com    static const int TGT_O_NOCTTY    = 0x00008000; //!< O_NOCTTY
6510810Sbr@bsdpad.com    static const int TGT_O_TRUNC     = 0x00000400; //!< O_TRUNC
6610810Sbr@bsdpad.com    static const int TGT_O_APPEND    = 0x00000008; //!< O_APPEND
6710810Sbr@bsdpad.com    static const int TGT_O_NONBLOCK  = 0x00000004; //!< O_NONBLOCK
6810810Sbr@bsdpad.com    static const int TGT_O_SYNC      = 0x00000080; //!< O_SYNC
6910810Sbr@bsdpad.com    static const int TGT_FASYNC      = 0x00000040; //!< FASYNC
7010810Sbr@bsdpad.com    static const int TGT_O_DIRECT    = 0x00010000; //!< O_DIRECT
7110810Sbr@bsdpad.com    static const int TGT_O_DIRECTORY = 0x00020000; //!< O_DIRECTORY
7210810Sbr@bsdpad.com    static const int TGT_O_NOFOLLOW  = 0x00000100; //!< O_NOFOLLOW
7310810Sbr@bsdpad.com    static const int TGT_O_CLOEXEC   = 0x00100000; //!< O_CLOEXEC
7410810Sbr@bsdpad.com    //@}
7510810Sbr@bsdpad.com
7610810Sbr@bsdpad.com    /// For mmap().
7711383Sbrandon.potter@amd.com    static const unsigned TGT_MAP_SHARED    = 0x0001;
7811383Sbrandon.potter@amd.com    static const unsigned TGT_MAP_PRIVATE   = 0x0002;
7910810Sbr@bsdpad.com    static const unsigned TGT_MAP_ANONYMOUS = 0x1000;
8010810Sbr@bsdpad.com    static const unsigned TGT_MAP_FIXED     = 0x0010;
8110810Sbr@bsdpad.com
8210810Sbr@bsdpad.com    /// Limit struct for getrlimit/setrlimit.
8310810Sbr@bsdpad.com    struct rlimit {
8410810Sbr@bsdpad.com        uint32_t  rlim_cur;     //!< soft limit
8510810Sbr@bsdpad.com        uint32_t  rlim_max;     //!< hard limit
8610810Sbr@bsdpad.com    };
8710810Sbr@bsdpad.com
8810810Sbr@bsdpad.com    /// For gettimeofday().
8910810Sbr@bsdpad.com    struct timeval {
9010810Sbr@bsdpad.com        int32_t tv_sec;         //!< seconds
9110810Sbr@bsdpad.com        int32_t tv_usec;        //!< microseconds
9210810Sbr@bsdpad.com    };
9310810Sbr@bsdpad.com
9410810Sbr@bsdpad.com    // For writev/readv
9510810Sbr@bsdpad.com    struct tgt_iovec {
9610810Sbr@bsdpad.com        uint32_t iov_base; // void *
9710810Sbr@bsdpad.com        uint32_t iov_len;
9810810Sbr@bsdpad.com    };
9910810Sbr@bsdpad.com
10010810Sbr@bsdpad.com    /*
10110810Sbr@bsdpad.com     * sizeof st 120
10210810Sbr@bsdpad.com     * sizeof st_dev 4
10310810Sbr@bsdpad.com     * sizeof st_ino 4
10410810Sbr@bsdpad.com     * sizeof st_mode 2
10510810Sbr@bsdpad.com     * sizeof st_nlink 2
10610810Sbr@bsdpad.com     * sizeof st_uid 4
10710810Sbr@bsdpad.com     * sizeof st_gid 4
10810810Sbr@bsdpad.com     * sizeof st_rdev 4
10910810Sbr@bsdpad.com     * sizeof st_atim 16
11010810Sbr@bsdpad.com     * sizeof st_size 8
11110810Sbr@bsdpad.com     * sizeof st_blocks 8
11210810Sbr@bsdpad.com     * sizeof st_blksize 4
11310810Sbr@bsdpad.com     * sizeof st_flags 4
11410810Sbr@bsdpad.com     * sizeof st_gen 4
11510810Sbr@bsdpad.com     * sizeof st_lspare 4
11610810Sbr@bsdpad.com     */
11710810Sbr@bsdpad.com
11810810Sbr@bsdpad.com    typedef struct {
11910810Sbr@bsdpad.com        uint32_t   st_dev;
12010810Sbr@bsdpad.com        uint32_t   st_ino;
12110810Sbr@bsdpad.com        uint16_t   st_mode;
12210810Sbr@bsdpad.com        uint16_t   st_nlink;
12310810Sbr@bsdpad.com        uint32_t   st_uid;
12410810Sbr@bsdpad.com        uint32_t   st_gid;
12510810Sbr@bsdpad.com        uint32_t   st_rdev;
12610810Sbr@bsdpad.com        uint64_t   st_atimeX;
12710810Sbr@bsdpad.com        uint64_t   st_atime_nsec;
12810810Sbr@bsdpad.com        uint64_t   st_mtimeX;
12910810Sbr@bsdpad.com        uint64_t   st_mtime_nsec;
13010810Sbr@bsdpad.com        uint64_t   st_ctimeX;
13110810Sbr@bsdpad.com        uint64_t   st_ctime_nsec;
13210810Sbr@bsdpad.com        uint64_t   st_size;
13310810Sbr@bsdpad.com        uint64_t   st_blocks;
13410810Sbr@bsdpad.com        uint32_t   st_blksize;
13510810Sbr@bsdpad.com        uint32_t   st_flags;
13610810Sbr@bsdpad.com        uint32_t   st_gen;
13710810Sbr@bsdpad.com        uint32_t   st_lspare;
13810810Sbr@bsdpad.com        uint64_t   st_birthtimX;
13910810Sbr@bsdpad.com        uint64_t   st_birthtim;
14010810Sbr@bsdpad.com    } tgt_stat;
14110810Sbr@bsdpad.com
14210810Sbr@bsdpad.com    typedef struct {
14310810Sbr@bsdpad.com        uint32_t   st_dev;
14410810Sbr@bsdpad.com        uint32_t   st_ino;
14510810Sbr@bsdpad.com        uint16_t   st_mode;
14610810Sbr@bsdpad.com        uint16_t   st_nlink;
14710810Sbr@bsdpad.com        uint32_t   st_uid;
14810810Sbr@bsdpad.com        uint32_t   st_gid;
14910810Sbr@bsdpad.com        uint32_t   st_rdev;
15010810Sbr@bsdpad.com        uint64_t   st_atimeX;
15110810Sbr@bsdpad.com        uint64_t   st_atime_nsec;
15210810Sbr@bsdpad.com        uint64_t   st_mtimeX;
15310810Sbr@bsdpad.com        uint64_t   st_mtime_nsec;
15410810Sbr@bsdpad.com        uint64_t   st_ctimeX;
15510810Sbr@bsdpad.com        uint64_t   st_ctime_nsec;
15610810Sbr@bsdpad.com        uint64_t   st_size;
15710810Sbr@bsdpad.com        uint64_t   st_blocks;
15810810Sbr@bsdpad.com        uint32_t   st_blksize;
15910810Sbr@bsdpad.com        uint32_t   st_flags;
16010810Sbr@bsdpad.com        uint32_t   st_gen;
16110810Sbr@bsdpad.com        uint32_t   st_lspare;
16210810Sbr@bsdpad.com        uint64_t   st_birthtimX;
16310810Sbr@bsdpad.com        uint64_t   st_birthtim;
16410810Sbr@bsdpad.com    } tgt_stat64;
16510810Sbr@bsdpad.com
16610810Sbr@bsdpad.com    /// For getrusage().
16710810Sbr@bsdpad.com    struct rusage {
16810810Sbr@bsdpad.com        struct timeval ru_utime;        //!< user time used
16910810Sbr@bsdpad.com        struct timeval ru_stime;        //!< system time used
17010810Sbr@bsdpad.com        int32_t ru_maxrss;              //!< max rss
17110810Sbr@bsdpad.com        int32_t ru_ixrss;               //!< integral shared memory size
17210810Sbr@bsdpad.com        int32_t ru_idrss;               //!< integral unshared data "
17310810Sbr@bsdpad.com        int32_t ru_isrss;               //!< integral unshared stack "
17410810Sbr@bsdpad.com        int32_t ru_minflt;              //!< page reclaims - total vmfaults
17510810Sbr@bsdpad.com        int32_t ru_majflt;              //!< page faults
17610810Sbr@bsdpad.com        int32_t ru_nswap;               //!< swaps
17710810Sbr@bsdpad.com        int32_t ru_inblock;             //!< block input operations
17810810Sbr@bsdpad.com        int32_t ru_oublock;             //!< block output operations
17910810Sbr@bsdpad.com        int32_t ru_msgsnd;              //!< messages sent
18010810Sbr@bsdpad.com        int32_t ru_msgrcv;              //!< messages received
18110810Sbr@bsdpad.com        int32_t ru_nsignals;            //!< signals received
18210810Sbr@bsdpad.com        int32_t ru_nvcsw;               //!< voluntary context switches
18310810Sbr@bsdpad.com        int32_t ru_nivcsw;              //!< involuntary "
18410810Sbr@bsdpad.com    };
18510810Sbr@bsdpad.com
18610810Sbr@bsdpad.com    /// For times().
18710810Sbr@bsdpad.com    struct tms {
18810810Sbr@bsdpad.com        int32_t tms_utime;      //!< user time
18910810Sbr@bsdpad.com        int32_t tms_stime;      //!< system time
19010810Sbr@bsdpad.com        int32_t tms_cutime;     //!< user time of children
19110810Sbr@bsdpad.com        int32_t tms_cstime;     //!< system time of children
19210810Sbr@bsdpad.com    };
19310810Sbr@bsdpad.com};
19410810Sbr@bsdpad.com
19510810Sbr@bsdpad.comclass ArmFreebsd64 : public FreeBSD
19610810Sbr@bsdpad.com{
19710810Sbr@bsdpad.com  public:
19810810Sbr@bsdpad.com
19910810Sbr@bsdpad.com    /// This table maps the target open() flags to the corresponding
20010810Sbr@bsdpad.com    /// host open() flags.
20111381Sbrandon.potter@amd.com    static SyscallFlagTransTable openFlagTable[];
20210810Sbr@bsdpad.com
20310810Sbr@bsdpad.com    /// Number of entries in openFlagTable[].
20410810Sbr@bsdpad.com    static const int NUM_OPEN_FLAGS;
20510810Sbr@bsdpad.com
20610810Sbr@bsdpad.com    //@{
20710810Sbr@bsdpad.com    /// Basic ARM FreeBSD types
20810810Sbr@bsdpad.com    typedef uint64_t size_t;
20910810Sbr@bsdpad.com    typedef uint64_t off_t;
21010810Sbr@bsdpad.com    typedef int64_t time_t;
21110810Sbr@bsdpad.com    typedef int64_t clock_t;
21210810Sbr@bsdpad.com    //@}
21310810Sbr@bsdpad.com
21410810Sbr@bsdpad.com    //@{
21510810Sbr@bsdpad.com    /// open(2) flag values.
21610810Sbr@bsdpad.com    static const int TGT_O_RDONLY    = 0x00000000; //!< O_RDONLY
21710810Sbr@bsdpad.com    static const int TGT_O_WRONLY    = 0x00000001; //!< O_WRONLY
21810810Sbr@bsdpad.com    static const int TGT_O_RDWR      = 0x00000002; //!< O_RDWR
21910810Sbr@bsdpad.com    static const int TGT_O_CREAT     = 0x00000200; //!< O_CREAT
22010810Sbr@bsdpad.com    static const int TGT_O_EXCL      = 0x00000800; //!< O_EXCL
22110810Sbr@bsdpad.com    static const int TGT_O_NOCTTY    = 0x00008000; //!< O_NOCTTY
22210810Sbr@bsdpad.com    static const int TGT_O_TRUNC     = 0x00000400; //!< O_TRUNC
22310810Sbr@bsdpad.com    static const int TGT_O_APPEND    = 0x00000008; //!< O_APPEND
22410810Sbr@bsdpad.com    static const int TGT_O_NONBLOCK  = 0x00000004; //!< O_NONBLOCK
22510810Sbr@bsdpad.com    static const int TGT_O_SYNC      = 0x00000080; //!< O_SYNC
22610810Sbr@bsdpad.com    static const int TGT_FASYNC      = 0x00000040; //!< FASYNC
22710810Sbr@bsdpad.com    static const int TGT_O_DIRECT    = 0x00010000; //!< O_DIRECT
22810810Sbr@bsdpad.com    static const int TGT_O_DIRECTORY = 0x00020000; //!< O_DIRECTORY
22910810Sbr@bsdpad.com    static const int TGT_O_NOFOLLOW  = 0x00000100; //!< O_NOFOLLOW
23010810Sbr@bsdpad.com    static const int TGT_O_CLOEXEC   = 0x00100000; //!< O_CLOEXEC
23110810Sbr@bsdpad.com    //@}
23210810Sbr@bsdpad.com
23310810Sbr@bsdpad.com    /// For mmap().
23411383Sbrandon.potter@amd.com    static const unsigned TGT_MAP_SHARED    = 0x0001;
23511383Sbrandon.potter@amd.com    static const unsigned TGT_MAP_PRIVATE   = 0x0002;
23610810Sbr@bsdpad.com    static const unsigned TGT_MAP_ANONYMOUS = 0x1000;
23710810Sbr@bsdpad.com    static const unsigned TGT_MAP_FIXED     = 0x0010;
23810810Sbr@bsdpad.com
23910810Sbr@bsdpad.com    //@{
24010810Sbr@bsdpad.com    /// For getrusage().
24110810Sbr@bsdpad.com    static const int TGT_RUSAGE_SELF = 0;
24210810Sbr@bsdpad.com    static const int TGT_RUSAGE_CHILDREN = -1;
24310810Sbr@bsdpad.com    static const int TGT_RUSAGE_THREAD = 1;
24410810Sbr@bsdpad.com    //@}
24510810Sbr@bsdpad.com
24610810Sbr@bsdpad.com    /// Resource enumeration for getrlimit().
24710810Sbr@bsdpad.com    enum rlimit_resources {
24810810Sbr@bsdpad.com        TGT_RLIMIT_CPU = 0,
24910810Sbr@bsdpad.com        TGT_RLIMIT_FSIZE = 1,
25010810Sbr@bsdpad.com        TGT_RLIMIT_DATA = 2,
25110810Sbr@bsdpad.com        TGT_RLIMIT_STACK = 3,
25210810Sbr@bsdpad.com        TGT_RLIMIT_CORE = 4,
25310810Sbr@bsdpad.com        TGT_RLIMIT_RSS = 5,
25410810Sbr@bsdpad.com        TGT_RLIMIT_MEMLOCK = 6,
25510810Sbr@bsdpad.com        TGT_RLIMIT_NPROC = 7,
25610810Sbr@bsdpad.com        TGT_RLIMIT_NOFILE = 8,
25710810Sbr@bsdpad.com        TGT_RLIMIT_SBSIZE = 9,
25810810Sbr@bsdpad.com        TGT_RLIMIT_VMEM = 10,
25910810Sbr@bsdpad.com        TGT_RLIMIT_AS = TGT_RLIMIT_VMEM,
26010810Sbr@bsdpad.com        TGT_RLIMIT_NPTS = 11,
26110810Sbr@bsdpad.com        TGT_RLIMIT_SWAP = 12,
26210810Sbr@bsdpad.com        TGT_RLIMIT_KQUEUES = 13
26310810Sbr@bsdpad.com    };
26410810Sbr@bsdpad.com
26510810Sbr@bsdpad.com    /// Limit struct for getrlimit/setrlimit.
26610810Sbr@bsdpad.com    struct rlimit {
26710810Sbr@bsdpad.com        uint64_t  rlim_cur;     //!< soft limit
26810810Sbr@bsdpad.com        uint64_t  rlim_max;     //!< hard limit
26910810Sbr@bsdpad.com    };
27010810Sbr@bsdpad.com
27110810Sbr@bsdpad.com    /// For gettimeofday().
27210810Sbr@bsdpad.com    struct timeval {
27310810Sbr@bsdpad.com        int64_t tv_sec;         //!< seconds
27410810Sbr@bsdpad.com        int64_t tv_usec;        //!< microseconds
27510810Sbr@bsdpad.com    };
27610810Sbr@bsdpad.com
27710810Sbr@bsdpad.com    // For writev/readv
27810810Sbr@bsdpad.com    struct tgt_iovec {
27910810Sbr@bsdpad.com        uint64_t iov_base; // void *
28010810Sbr@bsdpad.com        uint64_t iov_len;
28110810Sbr@bsdpad.com    };
28210810Sbr@bsdpad.com
28310810Sbr@bsdpad.com    typedef struct {
28410810Sbr@bsdpad.com        uint32_t   st_dev;
28510810Sbr@bsdpad.com        uint32_t   st_ino;
28610810Sbr@bsdpad.com        uint16_t   st_mode;
28710810Sbr@bsdpad.com        uint16_t   st_nlink;
28810810Sbr@bsdpad.com        uint32_t   st_uid;
28910810Sbr@bsdpad.com        uint32_t   st_gid;
29010810Sbr@bsdpad.com        uint32_t   st_rdev;
29110810Sbr@bsdpad.com        uint64_t   st_atimeX;
29210810Sbr@bsdpad.com        uint64_t   st_atime_nsec;
29310810Sbr@bsdpad.com        uint64_t   st_mtimeX;
29410810Sbr@bsdpad.com        uint64_t   st_mtime_nsec;
29510810Sbr@bsdpad.com        uint64_t   st_ctimeX;
29610810Sbr@bsdpad.com        uint64_t   st_ctime_nsec;
29710810Sbr@bsdpad.com        uint64_t   st_size;
29810810Sbr@bsdpad.com        uint64_t   st_blocks;
29910810Sbr@bsdpad.com        uint32_t   st_blksize;
30010810Sbr@bsdpad.com        uint32_t   st_flags;
30110810Sbr@bsdpad.com        uint32_t   st_gen;
30210810Sbr@bsdpad.com        uint32_t   st_lspare;
30310810Sbr@bsdpad.com        uint64_t   st_birthtimX;
30410810Sbr@bsdpad.com        uint64_t   st_birthtim;
30510810Sbr@bsdpad.com    } tgt_stat;
30610810Sbr@bsdpad.com
30710810Sbr@bsdpad.com    typedef struct {
30810810Sbr@bsdpad.com        uint32_t   st_dev;
30910810Sbr@bsdpad.com        uint32_t   st_ino;
31010810Sbr@bsdpad.com        uint16_t   st_mode;
31110810Sbr@bsdpad.com        uint16_t   st_nlink;
31210810Sbr@bsdpad.com        uint32_t   st_uid;
31310810Sbr@bsdpad.com        uint32_t   st_gid;
31410810Sbr@bsdpad.com        uint32_t   st_rdev;
31510810Sbr@bsdpad.com        uint64_t   st_atimeX;
31610810Sbr@bsdpad.com        uint64_t   st_atime_nsec;
31710810Sbr@bsdpad.com        uint64_t   st_mtimeX;
31810810Sbr@bsdpad.com        uint64_t   st_mtime_nsec;
31910810Sbr@bsdpad.com        uint64_t   st_ctimeX;
32010810Sbr@bsdpad.com        uint64_t   st_ctime_nsec;
32110810Sbr@bsdpad.com        uint64_t   st_size;
32210810Sbr@bsdpad.com        uint64_t   st_blocks;
32310810Sbr@bsdpad.com        uint32_t   st_blksize;
32410810Sbr@bsdpad.com        uint32_t   st_flags;
32510810Sbr@bsdpad.com        uint32_t   st_gen;
32610810Sbr@bsdpad.com        uint32_t   st_lspare;
32710810Sbr@bsdpad.com        uint64_t   st_birthtimX;
32810810Sbr@bsdpad.com        uint64_t   st_birthtim;
32910810Sbr@bsdpad.com    } tgt_stat64;
33010810Sbr@bsdpad.com
33110810Sbr@bsdpad.com    /// For getrusage().
33210810Sbr@bsdpad.com    struct rusage {
33310810Sbr@bsdpad.com        struct timeval ru_utime;        //!< user time used
33410810Sbr@bsdpad.com        struct timeval ru_stime;        //!< system time used
33510810Sbr@bsdpad.com        int64_t ru_maxrss;              //!< max rss
33610810Sbr@bsdpad.com        int64_t ru_ixrss;               //!< integral shared memory size
33710810Sbr@bsdpad.com        int64_t ru_idrss;               //!< integral unshared data "
33810810Sbr@bsdpad.com        int64_t ru_isrss;               //!< integral unshared stack "
33910810Sbr@bsdpad.com        int64_t ru_minflt;              //!< page reclaims - total vmfaults
34010810Sbr@bsdpad.com        int64_t ru_majflt;              //!< page faults
34110810Sbr@bsdpad.com        int64_t ru_nswap;               //!< swaps
34210810Sbr@bsdpad.com        int64_t ru_inblock;             //!< block input operations
34310810Sbr@bsdpad.com        int64_t ru_oublock;             //!< block output operations
34410810Sbr@bsdpad.com        int64_t ru_msgsnd;              //!< messages sent
34510810Sbr@bsdpad.com        int64_t ru_msgrcv;              //!< messages received
34610810Sbr@bsdpad.com        int64_t ru_nsignals;            //!< signals received
34710810Sbr@bsdpad.com        int64_t ru_nvcsw;               //!< voluntary context switches
34810810Sbr@bsdpad.com        int64_t ru_nivcsw;              //!< involuntary "
34910810Sbr@bsdpad.com    };
35010810Sbr@bsdpad.com
35110810Sbr@bsdpad.com    /// For times().
35210810Sbr@bsdpad.com    struct tms {
35310810Sbr@bsdpad.com        int64_t tms_utime;      //!< user time
35410810Sbr@bsdpad.com        int64_t tms_stime;      //!< system time
35510810Sbr@bsdpad.com        int64_t tms_cutime;     //!< user time of children
35610810Sbr@bsdpad.com        int64_t tms_cstime;     //!< system time of children
35710810Sbr@bsdpad.com    };
35810810Sbr@bsdpad.com};
35910810Sbr@bsdpad.com
36010810Sbr@bsdpad.com#endif
361