Changeset 2060 for trunk


Ignore:
Timestamp:
Jun 23, 2005, 8:00:41 AM (20 years ago)
Author:
bird
Message:

Updated sys/stat.h, sys/resource.h and sys/_types.h to FreeBSD 5.3 level.

Location:
trunk/src/emx/include/sys
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/sys/_types.h

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r2059 r2060  
    2424 * SUCH DAMAGE.
    2525 *
    26  * $FreeBSD: src/sys/sys/_types.h,v 1.14 2003/03/28 15:27:30 mike Exp $
     26 * $FreeBSD: src/sys/sys/_types.h,v 1.19 2004/06/19 17:58:32 marcel Exp $
    2727 */
    2828
    2929/** @file
    30  * FreeBSD 5.1
     30 * FreeBSD 5.3
    3131 *
    3232 * @changed off_t to 32bit and mode to 32bit.
     
    5757#endif
    5858typedef long            __key_t;        /* IPC key (for Sys V IPC) */
     59typedef __int32_t       __lwpid_t;      /* Thread ID (a.k.a. LWP) */
    5960#if 1 /* bird: emx */
    6061typedef __int32_t       __mode_t;       /* permissions */
     
    6465typedef int             __nl_item;
    6566typedef __uint16_t      __nlink_t;      /* link count */
    66 #if 0 /* bird: emx */
    67 typedef __int32_t       __off_t;        /* file offset */
    68 #else
    6967typedef __int64_t       __off_t;        /* file offset */
    70 #endif
    7168typedef __int32_t       __pid_t;        /* process [group] */
    7269typedef __int64_t       __rlim_t;       /* resource limit (XXX not unsigned) */
     
    7572typedef long            __suseconds_t;  /* microseconds (signed) */
    7673typedef __int32_t       __timer_t;      /* timer_gettime()... */
    77 typedef __uint32_t      __udev_t;       /* device number */
    7874typedef __uint32_t      __uid_t;
    7975typedef unsigned int    __useconds_t;   /* microseconds (unsigned) */
     
    9793 * character set plus one extra value (WEOF), and must be at least 16 bits.
    9894 */
    99 typedef int             __ct_rune_t;
    100 typedef __ct_rune_t     __rune_t;
     95typedef int             __ct_rune_t;    /* arg type for ctype funcs */
     96typedef __ct_rune_t     __rune_t;       /* rune_t (see above) */
    10197#if 0 /* bird: wchar_t is usually 2 bytes on OS/2. (might change this later!) */
    102 typedef __ct_rune_t     __wchar_t;
     98typedef __ct_rune_t     __wchar_t;      /* wchar_t (see above) */
    10399#else /* bird */
    104100typedef unsigned short  __wchar_t;
    105101#endif /* bird */
    106 typedef __ct_rune_t     __wint_t;
     102typedef __ct_rune_t     __wint_t;       /* wint_t (see above) */
    107103
    108 /*
    109  * dev_t has differing meanings in userland and the kernel.
    110  */
    111 #ifdef _KERNEL
    112 struct cdev;
    113 typedef struct cdev     *__dev_t;
    114 #else
    115 typedef __udev_t        __dev_t;                /* device number */
    116 #endif
     104typedef __uint32_t      __dev_t;        /* device number */
     105
     106typedef __uint32_t      __fixpt_t;      /* fixed point number */
    117107
    118108/*
     
    122112typedef union {
    123113        char            __mbstate8[128];
    124         __int64_t       _mbstateL;              /* for alignment */
     114        __int64_t       _mbstateL;      /* for alignment */
    125115} __mbstate_t;
    126116
  • trunk/src/emx/include/sys/resource.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r2059 r2060  
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    1713 * 4. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
     
    3228 *
    3329 *      @(#)resource.h  8.4 (Berkeley) 1/9/95
    34  * $FreeBSD: src/sys/sys/resource.h,v 1.19 2003/02/16 13:30:29 phk Exp $
     30 * $FreeBSD: src/sys/sys/resource.h,v 1.23 2004/06/13 22:07:58 das Exp $
    3531 */
    3632
    3733/** @file
    38  * FreeBSD 5.1
     34 * FreeBSD 5.3
    3935 * @changed bird: get/setpriority takes id_t not int according to SuS.
    4036 */
     
    4339#define _SYS_RESOURCE_H_
    4440
     41#include <sys/cdefs.h>
     42#include <sys/_timeval.h>
     43#include <sys/_types.h>
     44
    4545/*
    4646 * Process priority specifications to get/setpriority.
     
    4848#define PRIO_MIN        -20
    4949#define PRIO_MAX        20
    50 #ifdef _KERNEL
    51 #define PRIO_TOTAL      (PRIO_MAX - PRIO_MIN)
    52 #endif /* _KERNEL */
    5350
    5451#define PRIO_PROCESS    0
     
    9895#define RLIMIT_SBSIZE   9               /* maximum size of all socket buffers */
    9996#define RLIMIT_VMEM     10              /* virtual process size (inclusive of mmap) */
     97#define RLIMIT_AS       RLIMIT_VMEM     /* standard name for RLIMIT_VMEM */
    10098
    10199#define RLIM_NLIMITS    11              /* number of resource limits */
    102100
    103101#define RLIM_INFINITY   ((rlim_t)(((u_quad_t)1 << 63) - 1))
     102/* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */
    104103
    105104
     
    124123#endif
    125124
    126 struct orlimit {
    127         int32_t rlim_cur;               /* current (soft) limit */
    128         int32_t rlim_max;               /* maximum value for rlim_cur */
    129 };
     125#ifndef _RLIM_T_DECLARED
     126typedef __rlim_t        rlim_t;
     127#define _RLIM_T_DECLARED
     128#endif
    130129
    131130struct rlimit {
     
    134133};
    135134
    136 /* Load average structure. */
     135#if __BSD_VISIBLE
     136
     137struct orlimit {
     138        __int32_t       rlim_cur;       /* current (soft) limit */
     139        __int32_t       rlim_max;       /* maximum value for rlim_cur */
     140};
     141
    137142struct loadavg {
    138         fixpt_t ldavg[3];
    139         long    fscale;
     143        __fixpt_t       ldavg[3];
     144        long            fscale;
    140145};
    141146
     
    147152#define CPUSTATES       5
    148153
     154#endif  /* __BSD_VISIBLE */
     155
    149156#ifdef _KERNEL
    150157extern struct loadavg averunnable;
    151158extern long cp_time[CPUSTATES];
    152159
    153 int     dosetrlimit(struct thread *, u_int, struct rlimit *);
     160int     kern_setrlimit(struct thread *, u_int, struct rlimit *);
    154161
    155162#else
    156 #include <sys/cdefs.h>
    157163
    158164__BEGIN_DECLS
     165/* XXX 2nd arg to [gs]etpriority() should be an id_t */
    159166int     getpriority(int, /*int*/ id_t);         /* bird: SuS uses id_t */
    160167int     getrlimit(int, struct rlimit *);
  • trunk/src/emx/include/sys/stat.h

    • Property cvs2svn:cvs-rev changed from 1.10 to 1.11
    r2059 r2060  
    1616 *    notice, this list of conditions and the following disclaimer in the
    1717 *    documentation and/or other materials provided with the distribution.
    18  * 3. All advertising materials mentioning features or use of this software
    19  *    must display the following acknowledgement:
    20  *      This product includes software developed by the University of
    21  *      California, Berkeley and its contributors.
    2218 * 4. Neither the name of the University nor the names of its contributors
    2319 *    may be used to endorse or promote products derived from this software
     
    3733 *
    3834 *      @(#)stat.h      8.12 (Berkeley) 6/16/95
    39  * $FreeBSD: src/sys/sys/stat.h,v 1.37 2003/05/22 17:07:57 mike Exp $
     35 * $FreeBSD: src/sys/sys/stat.h,v 1.40 2004/06/17 17:16:52 phk Exp $
    4036 */
    4137
    4238/** @file
    43  * FreeBSD 5.1
     39 * FreeBSD 5.3
    4440 * @changed     bird: EMX isms and hid the BSD specific structs and related stuff.
    4541 * @changed     bird: No UF_ and SF_ because we ain't got any st_flags.
     
    140136
    141137struct stat {
    142         __udev_t  st_dev;               /* inode's device */
     138        __dev_t   st_dev;               /* inode's device */
    143139        ino_t     st_ino;               /* inode's number */
    144140        mode_t    st_mode;              /* inode protection mode */
     
    146142        uid_t     st_uid;               /* user ID of the file's owner */
    147143        gid_t     st_gid;               /* group ID of the file's group */
    148         __udev_t  st_rdev;              /* device type */
     144        __dev_t   st_rdev;              /* device type */
    149145#if 1 /* bird: emx */
    150146        time_t    st_atime;
     
    199195#if __BSD_VISIBLE
    200196struct nstat {
    201         __udev_t st_dev;                /* inode's device */
     197        __dev_t  st_dev;               /* inode's device */
    202198        ino_t     st_ino;               /* inode's number */
    203199        __uint32_t st_mode;             /* inode protection mode */
     
    205201        uid_t     st_uid;               /* user ID of the file's owner */
    206202        gid_t     st_gid;               /* group ID of the file's group */
    207         __udev_t st_rdev;               /* device type */
     203        __dev_t  st_rdev;              /* device type */
    208204        struct  timespec st_atimespec;  /* time of last access */
    209205        struct  timespec st_mtimespec;  /* time of last data modification */
     
    370366
    371367#endif /* !_SYS_STAT_H_ */
    372 
  • trunk/src/emx/include/sys/types.h

    • Property cvs2svn:cvs-rev changed from 1.10 to 1.11
    r2059 r2060  
    1616 *    notice, this list of conditions and the following disclaimer in the
    1717 *    documentation and/or other materials provided with the distribution.
    18  * 3. All advertising materials mentioning features or use of this software
    19  *    must display the following acknowledgement:
    20  *      This product includes software developed by the University of
    21  *      California, Berkeley and its contributors.
    2218 * 4. Neither the name of the University nor the names of its contributors
    2319 *    may be used to endorse or promote products derived from this software
     
    3733 *
    3834 *      @(#)types.h     8.6 (Berkeley) 2/19/95
    39  * $FreeBSD: src/sys/sys/types.h,v 1.83 2003/03/28 15:27:30 mike Exp $
     35 * $FreeBSD: src/sys/sys/types.h,v 1.90 2004/06/19 17:58:32 marcel Exp $
    4036 */
    4137
    4238/** @file
    43  * FreeBSD 5.1
     39 * FreeBSD 5.3
    4440 *
    4541 * @changed bird: Some EMX defines and a bit of toolkit pollution.
     
    6460typedef unsigned int    u_int;
    6561typedef unsigned long   u_long;
     62#ifndef _KERNEL
    6663typedef unsigned short  ushort;         /* Sys V compatibility */
    6764typedef unsigned int    uint;           /* Sys V compatibility */
     65#endif
    6866#endif
    6967
     
    154152#endif
    155153
    156 typedef __uint32_t      fixpt_t;        /* fixed point number */
     154typedef __fixpt_t       fixpt_t;        /* fixed point number */
    157155
    158156#ifndef _FSBLKCNT_T_DECLARED            /* for statvfs() */
     
    194192#endif
    195193
     194#ifndef _LWPID_T_DECLARED
     195typedef __lwpid_t       lwpid_t;        /* Thread ID (a.k.a. LWP) */
     196#define _LWPID_T_DECLARED
     197#endif
     198
    196199#ifndef _MODE_T_DECLARED
    197200typedef __mode_t        mode_t;         /* permissions */
     
    254257
    255258typedef __u_register_t  u_register_t;
    256 typedef __udev_t        udev_t;         /* device number */
    257259
    258260#if !defined(_UID_T_DECLARED) && !defined(_UID_T)  /* bird: emx */
     
    275277#ifdef _KERNEL
    276278typedef int             boolean_t;
     279typedef __cpumask_t     cpumask_t;
    277280typedef __intfptr_t     intfptr_t;
    278281
     
    312315#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
    313316#define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
     317#endif /* !_KERNEL */
     318
    314319#define makedev(x,y)    ((dev_t)(((x) << 8) | (y)))     /* create dev_t */
    315 #endif /* !_KERNEL */
    316320
    317321/*
Note: See TracChangeset for help on using the changeset viewer.