Sync with CSRG.

This commit is contained in:
mycroft 1994-12-13 15:54:52 +00:00
parent aeda11fc40
commit 824bb11fe8
3 changed files with 113 additions and 121 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: acct.h,v 1.12 1994/10/30 19:09:08 cgd Exp $ */
/* $NetBSD: acct.h,v 1.13 1994/12/13 16:04:55 mycroft Exp $ */
/*-
* Copyright (c) 1990, 1993
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
@ -37,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)acct.h 8.2 (Berkeley) 1/21/94
* @(#)acct.h 8.3 (Berkeley) 7/10/94
*/
/*
@ -48,24 +48,24 @@
typedef u_int16_t comp_t;
struct acct {
char ac_comm[10]; /* command name */
comp_t ac_utime; /* user time */
comp_t ac_stime; /* system time */
comp_t ac_etime; /* elapsed time */
time_t ac_btime; /* starting time */
uid_t ac_uid; /* user id */
gid_t ac_gid; /* group id */
int16_t ac_mem; /* average memory usage */
comp_t ac_io; /* count of IO blocks */
dev_t ac_tty; /* controlling tty */
u_int8_t ac_flag; /* accounting flags; see below. */
};
char ac_comm[10]; /* command name */
comp_t ac_utime; /* user time */
comp_t ac_stime; /* system time */
comp_t ac_etime; /* elapsed time */
time_t ac_btime; /* starting time */
uid_t ac_uid; /* user id */
gid_t ac_gid; /* group id */
u_int16_t ac_mem; /* average memory usage */
comp_t ac_io; /* count of IO blocks */
dev_t ac_tty; /* controlling tty */
#define AFORK 0x01 /* forked but not execed */
#define AFORK 0x01 /* fork'd but not exec'd */
#define ASU 0x02 /* used super-user permissions */
#define ACOMPAT 0x04 /* used compatibility mode */
#define ACORE 0x08 /* dumped core */
#define AXSIG 0x10 /* killed by a signal */
u_int8_t ac_flag; /* accounting flags */
};
/*
* 1/AHZ is the granularity of the data encoded in the comp_t fields.

View File

@ -1,4 +1,4 @@
/* $NetBSD: dirent.h,v 1.8 1994/06/29 06:43:54 cgd Exp $ */
/* $NetBSD: dirent.h,v 1.9 1994/12/13 15:58:20 mycroft Exp $ */
/*-
* Copyright (c) 1989, 1993
@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)dir.h 8.1 (Berkeley) 6/2/93
* @(#)dirent.h 8.3 (Berkeley) 8/10/94
*/
/*
@ -47,10 +47,10 @@
*/
struct dirent {
unsigned long d_fileno; /* file number of entry */
unsigned short d_reclen; /* length of this record */
unsigned char d_type; /* file type, see below */
unsigned char d_namlen; /* length of string in d_name */
u_int32_t d_fileno; /* file number of entry */
u_int16_t d_reclen; /* length of this record */
u_int8_t d_type; /* file type, see below */
u_int8_t d_namlen; /* length of string in d_name */
#ifdef _POSIX_SOURCE
char d_name[255 + 1]; /* name must be no longer than this */
#else
@ -70,6 +70,7 @@ struct dirent {
#define DT_REG 8
#define DT_LNK 10
#define DT_SOCK 12
#define DT_WHT 14
/*
* Convert between stat structure types and directory types.

View File

@ -1,8 +1,8 @@
/* $NetBSD: disklabel.h,v 1.30 1994/10/17 20:07:03 cgd Exp $ */
/* $NetBSD: disklabel.h,v 1.31 1994/12/13 15:54:52 mycroft Exp $ */
/*
* Copyright (c) 1987, 1988 Regents of the University of California.
* All rights reserved.
* Copyright (c) 1987, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -32,20 +32,22 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)disklabel.h 7.19 (Berkeley) 5/7/91
* @(#)disklabel.h 8.2 (Berkeley) 7/10/94
*/
#ifndef _SYS_DISKLABEL_H_
#define _SYS_DISKLABEL_H_
/*
* Disk description table, see disktab(5)
*/
#define _PATH_DISKTAB "/etc/disktab"
#define DISKTAB "/etc/disktab" /* deprecated */
/*
* Each disk has a label which includes information about the hardware
* disk geometry, filesystem partitions, and drive specific
* information. The location of the label, as well as the number of
* partitions the label can describe and the number of the "whole
* disk" (raw) paritition are machine dependent.
* disk geometry, filesystem partitions, and drive specific information.
* The location of the label, as well as the number of partitions the
* label can describe and the number of the "whole disk" (raw)
* paritition are machine dependent.
*/
#include <machine/disklabel.h>
/*
@ -53,19 +55,11 @@
* This is the maximum value of MAXPARTITIONS for which 'struct disklabel'
* is <= DEV_BSIZE bytes long. If MAXPARTITIONS is greater than this, beware.
*/
#define MAXMAXPARTITIONS 22
#if MAXPARTITIONS > MAXMAXPARTITIONS
#warn beware: MAXPARTITIONS bigger than MAXMAXPARTITIONS
#endif
/*
* Disk description table, see disktab(5)
*/
#define _PATH_DISKTAB "/etc/disktab"
#define DISKTAB "/etc/disktab" /* deprecated */
/*
* Translate between device numbers and major/disk unit/disk partition.
*/
@ -74,14 +68,15 @@
#define MAKEDISKDEV(maj, unit, part) \
(makedev((maj), ((unit) * MAXPARTITIONS) + (part)))
#define DISKMAGIC ((u_long) 0x82564557) /* The disk magic number */
#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */
#ifndef LOCORE
struct disklabel {
u_long d_magic; /* the magic number */
short d_type; /* drive type */
short d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
u_int32_t d_magic; /* the magic number */
u_int16_t d_type; /* drive type */
u_int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
/*
* d_packname contains the pack identifier and is returned when
* the disklabel is read off the disk or in-core copy.
@ -91,7 +86,7 @@ struct disklabel {
* getdiskbyname(3) to retrieve the values from /etc/disktab.
*/
#if defined(KERNEL) || defined(STANDALONE)
char d_packname[16]; /* pack identifier */
char d_packname[16]; /* pack identifier */
#else
union {
char un_d_packname[16]; /* pack identifier */
@ -104,69 +99,76 @@ struct disklabel {
#define d_boot0 d_un.un_b.un_d_boot0
#define d_boot1 d_un.un_b.un_d_boot1
#endif /* ! KERNEL or STANDALONE */
/* disk geometry: */
u_long d_secsize; /* # of bytes per sector */
u_long d_nsectors; /* # of data sectors per track */
u_long d_ntracks; /* # of tracks per cylinder */
u_long d_ncylinders; /* # of data cylinders per unit */
u_long d_secpercyl; /* # of data sectors per cylinder */
u_long d_secperunit; /* # of data sectors per unit */
u_int32_t d_secsize; /* # of bytes per sector */
u_int32_t d_nsectors; /* # of data sectors per track */
u_int32_t d_ntracks; /* # of tracks per cylinder */
u_int32_t d_ncylinders; /* # of data cylinders per unit */
u_int32_t d_secpercyl; /* # of data sectors per cylinder */
u_int32_t d_secperunit; /* # of data sectors per unit */
/*
* Spares (bad sector replacements) below
* are not counted in d_nsectors or d_secpercyl.
* Spare sectors are assumed to be physical sectors
* which occupy space at the end of each track and/or cylinder.
* Spares (bad sector replacements) below are not counted in
* d_nsectors or d_secpercyl. Spare sectors are assumed to
* be physical sectors which occupy space at the end of each
* track and/or cylinder.
*/
u_short d_sparespertrack; /* # of spare sectors per track */
u_short d_sparespercyl; /* # of spare sectors per cylinder */
u_int16_t d_sparespertrack; /* # of spare sectors per track */
u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */
/*
* Alternate cylinders include maintenance, replacement,
* configuration description areas, etc.
* Alternate cylinders include maintenance, replacement, configuration
* description areas, etc.
*/
u_long d_acylinders; /* # of alt. cylinders per unit */
u_int32_t d_acylinders; /* # of alt. cylinders per unit */
/* hardware characteristics: */
/*
* d_interleave, d_trackskew and d_cylskew describe perturbations
* in the media format used to compensate for a slow controller.
* Interleave is physical sector interleave, set up by the formatter
* or controller when formatting. When interleaving is in use,
* logically adjacent sectors are not physically contiguous,
* but instead are separated by some number of sectors.
* It is specified as the ratio of physical sectors traversed
* per logical sector. Thus an interleave of 1:1 implies contiguous
* layout, while 2:1 implies that logical sector 0 is separated
* by one sector from logical sector 1.
* d_trackskew is the offset of sector 0 on track N
* relative to sector 0 on track N-1 on the same cylinder.
* Finally, d_cylskew is the offset of sector 0 on cylinder N
* relative to sector 0 on cylinder N-1.
* Interleave is physical sector interleave, set up by the
* formatter or controller when formatting. When interleaving is
* in use, logically adjacent sectors are not physically
* contiguous, but instead are separated by some number of
* sectors. It is specified as the ratio of physical sectors
* traversed per logical sector. Thus an interleave of 1:1
* implies contiguous layout, while 2:1 implies that logical
* sector 0 is separated by one sector from logical sector 1.
* d_trackskew is the offset of sector 0 on track N relative to
* sector 0 on track N-1 on the same cylinder. Finally, d_cylskew
* is the offset of sector 0 on cylinder N relative to sector 0
* on cylinder N-1.
*/
u_short d_rpm; /* rotational speed */
u_short d_interleave; /* hardware sector interleave */
u_short d_trackskew; /* sector 0 skew, per track */
u_short d_cylskew; /* sector 0 skew, per cylinder */
u_long d_headswitch; /* head switch time, usec */
u_long d_trkseek; /* track-to-track seek, usec */
u_long d_flags; /* generic flags */
u_int16_t d_rpm; /* rotational speed */
u_int16_t d_interleave; /* hardware sector interleave */
u_int16_t d_trackskew; /* sector 0 skew, per track */
u_int16_t d_cylskew; /* sector 0 skew, per cylinder */
u_int32_t d_headswitch; /* head switch time, usec */
u_int32_t d_trkseek; /* track-to-track seek, usec */
u_int32_t d_flags; /* generic flags */
#define NDDATA 5
u_long d_drivedata[NDDATA]; /* drive-type specific information */
u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */
#define NSPARE 5
u_long d_spare[NSPARE]; /* reserved for future use */
u_long d_magic2; /* the magic number (again) */
u_short d_checksum; /* xor of data incl. partitions */
u_int32_t d_spare[NSPARE]; /* reserved for future use */
u_int32_t d_magic2; /* the magic number (again) */
u_int16_t d_checksum; /* xor of data incl. partitions */
/* filesystem and partition information: */
u_short d_npartitions; /* number of partitions in following */
u_long d_bbsize; /* size of boot area at sn0, bytes */
u_long d_sbsize; /* max size of fs superblock, bytes */
u_int16_t d_npartitions; /* number of partitions in following */
u_int32_t d_bbsize; /* size of boot area at sn0, bytes */
u_int32_t d_sbsize; /* max size of fs superblock, bytes */
struct partition { /* the partition table */
u_long p_size; /* number of sectors in partition */
u_long p_offset; /* starting sector */
u_long p_fsize; /* filesystem basic fragment size */
u_char p_fstype; /* filesystem type, see below */
u_char p_frag; /* filesystem fragments per block */
u_short p_cpg; /* filesystem cylinders per group */
u_int32_t p_size; /* number of sectors in partition */
u_int32_t p_offset; /* starting sector */
u_int32_t p_fsize; /* filesystem basic fragment size */
u_int8_t p_fstype; /* filesystem type, see below */
u_int8_t p_frag; /* filesystem fragments per block */
union {
u_int16_t cpg; /* UFS: FS cylinders per group */
u_int16_t sgs; /* LFS: FS segment shift */
} __partition_u1;
#define p_cpg __partition_u1.cpg
#define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
#else /* LOCORE */
@ -190,14 +192,9 @@ struct disklabel {
#define DTYPE_ESDI 5 /* ESDI interface */
#define DTYPE_ST506 6 /* ST506 etc. */
#define DTYPE_HPIB 7 /* CS/80 on HP-IB */
#define DTYPE_HPFL 8 /* HP Fiber-link */
#define DTYPE_HPFL 8 /* HP Fiber-link */
#define DTYPE_FLOPPY 10 /* floppy */
/* d_subtype values: */
#define DSTYPE_INDOSPART 0x8 /* is inside dos partition */
#define DSTYPE_DOSPART(s) ((s) & 3) /* dos partition number */
#define DSTYPE_GEOMETRY 0x10 /* drive params in label */
#ifdef DKTYPENAMES
static char *dktypenames[] = {
"unknown",
@ -211,7 +208,7 @@ static char *dktypenames[] = {
"HP-FL",
"type 9",
"floppy",
0
NULL
};
#define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1)
#endif
@ -229,15 +226,14 @@ static char *dktypenames[] = {
#define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */
#define FS_V8 6 /* Eighth Edition, 4K blocks */
#define FS_BSDFFS 7 /* 4.2BSD fast file system */
#define FS_MSDOS 8 /* MS-DOS file system */
#define FS_MSDOS 8 /* MSDOS file system */
#define FS_BSDLFS 9 /* 4.4BSD log-structured file system */
#define FS_OTHER 10 /* in use, but unknown/unsupported */
#define FS_HPFS 11 /* OS/2 high-performance file system */
#define FS_ISO9660 12 /* ISO-9660 filesystem (cdrom) */
#define FS_ISOFS FS_ISO9660
#define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */
#define FS_BOOT 13 /* partition contains bootstrap */
#define FS_ADOS 14 /* AmigaDOS fast file system */
#define FS_HFS 15 /* Macintosh HFS */
#define FS_ADOS 14 /* AmigaDOS fast file system */
#define FS_HFS 15 /* Macintosh HFS */
#ifdef DKTYPENAMES
static char *fstypenames[] = {
@ -249,15 +245,15 @@ static char *fstypenames[] = {
"4.1BSD",
"Eighth Edition",
"4.2BSD",
"MS-DOS",
"MSDOS",
"4.4LFS",
"unknown",
"HPFS",
"ISO-9660",
"ISO9660",
"boot",
"ADOS",
"HFS",
0
NULL
};
#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
#endif
@ -270,7 +266,6 @@ static char *fstypenames[] = {
#define D_BADSECT 0x04 /* supports bad sector forw. */
#define D_RAMDISK 0x08 /* disk emulator */
#define D_CHAIN 0x10 /* can do back-back transfers */
#define D_DOSPART 0x20 /* within MSDOS partition */
/*
* Drive data for SMD.
@ -294,22 +289,20 @@ static char *fstypenames[] = {
#ifndef LOCORE
/*
* Structure used to perform a format
* or other raw operation, returning data
* and/or register values.
* Register identification and format
* Structure used to perform a format or other raw operation, returning
* data and/or register values. Register identification and format
* are device- and driver-dependent.
*/
struct format_op {
char *df_buf;
int df_count; /* value-result */
daddr_t df_startblk;
int df_reg[8]; /* result */
int df_count; /* value-result */
daddr_t df_startblk;
int df_reg[8]; /* result */
};
/*
* Structure used internally to retrieve
* information about a partition on a disk.
* Structure used internally to retrieve information about a partition
* on a disk.
*/
struct partinfo {
struct disklabel *disklab;
@ -358,5 +351,3 @@ struct disklabel *getdiskbyname __P((const char *));
__END_DECLS
#endif
#endif /* !_SYS_DISKLABEL_H_ */