about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sys
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-01-19 04:54:28 +0000
committerUlrich Drepper <drepper@redhat.com>1997-01-19 04:54:28 +0000
commit5290baf06cbad096b1a085b2e20031b854e0226c (patch)
tree1c19465ad66411891bf1759b2c0edfdfb37d083f /sysdeps/unix/sysv/linux/sys
parentb51c27c0328382d5e0909f6c595ed381392b9200 (diff)
downloadglibc-5290baf06cbad096b1a085b2e20031b854e0226c.tar.gz
glibc-5290baf06cbad096b1a085b2e20031b854e0226c.tar.xz
glibc-5290baf06cbad096b1a085b2e20031b854e0226c.zip
update from main archive 970118 cvs/libc-970119
Sun Jan 19 04:38:20 1997  Ulrich Drepper  <drepper@cygnus.com>

	* config.make.in (have-ksh, KSH): New variables.  Will be filled
	in by configure.
	* configure.in: Add test for ksh like shell (prefer bash).
	* time/Makefile (tests): Depend on install-test-data.
	(distribute): Add simplebackw.
	(generated-dirs): New variable.
	[$(have-ksh)==yes] (install-others): Add iso3166.tab and zone.tab.
	(install-bin): Add tzselect.
	(install-test-data): Install the zoneinfo files which are needed
	for the test case in the build directory.
	(test-tz-ENV): New variable.  Call test-tz program using data in
	build directory.
	* time/simpleback: New file.
	* time/test-tz.c: Pretty print.
	* time/tzfile.c: Use value of environment variable TZDIR as directory
	to look for zone info files.
	don't let search for DST data destroy already found values.
	* time/tzselect.ksh: Use @KSH@ and @TZDIR@ to be substituted when
	installing.
	* time/tzset.c (__tzset_internal): Avoid freeing string twice.
	Set DST zone name to normal zone name if no information is provided.

	* time/mktime.c (mktime): Call __tzset_internal to use current
	value of TZ.

	* Makerules (common-clean): Remove $(generated-dirs) inclusing content.

	* glibcbug.in: Fix several bugs.  Reported by several people.

	* elf/Makefile: Correct dependecies for $(objpfx)ldd.

	* inet/netinet/ip.h: Define IPTOS_LOWCOST and IPTOS_MINCOST.

	* locale/C-time.c: Update copyright.
	* locale/localeinfo.h: Likewise.
	* sysdeps/unix/bsd/bsd4.4/direntry.h: Likewise.

	* locale/programs/ld-time.c (time_finish): Correct message string.
	* locale/programs/linereader.c (lr_token): Use correctly `number'
	not `digit' in message string.

	* stdlib/strtol.c [UNSIGNED]: Don't punt immediately when `-' is
	seen.  Instead return ULONG_MAX and set ERANGE.
	* stdlib/tst-strtol.c: Correct test to reflect above change.

Sun Jan 19 03:22:30 1997  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/sys/mtio.h: Don't use <linux/mtio.h>.
	We must not use <linux/posix_types.h>.

	* sysdeps/unix/sysv/linux/sys/ipc_buf.h: Don't use __kernel_* types
	since we must not use <linux/posix_types.h>.
	* sysdeps/unix/sysv/linux/sys/procfs.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h: New file.  Similar
	to sysdeps/unix/sysv/linux/sys/ipc_buf.h, but use alpha relavent
	types.
	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: New file.  Similar
	to sysdeps/unix/sysv/linux/sys/procfs.h, but use alpha relavent
	types.

Sun Jan 19 01:48:20 1997  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* sysdeps/libm-i387/e_exp.S: Correct computation of fractional
	part.
	* sysdeps/libm-i387/e_expf.S: Likewise.
	* sysdeps/libm-i387/e_expl.S: Likewise.
	* sysdeps/libm-i387/s_expm1.S: Correct computation of fractional
	part.  Take care of additional value left on stack by fscale.
	* sysdeps/libm-i387/s_expm1f.S: Likewise.
	* sysdeps/libm-i387/s_expm1l.S: Likewise.

Fri Jan 17 17:45:32 1997  Ulrich Drepper  <drepper@cygnus.com>

	* posix/getopt.c: Change all direct usages of `gettext' to `_'.

	* sysdeps/generic/sysd-stdio.c (__stdio_reopen): Add missing
	parameter.
	Reported by Harmanjit Singh <harman@netearth.iitd.ernet.in>.

Thu Jan 16 23:39:25 1997  Ulrich Drepper  <drepper@cygnus.com>

	* stdio-common/Makefile (tests): Add scanf11.
	* stdio-common/scanf11.c: New file.
	* stdio-common/vfscanf.c (__vfscanf): Increment `done' when %n
	was processed and value is not suppressed.
	* stdio-common/bug10.c: Correct test to expect %n increment the
	return value of scanf.
	* stdio-common/scanf1.c: Likewise.
	* stdio-common/scanf3.c: Likewise.
	* stdio-common/scanf10.c: Likewise.
	* stdio-common/tstdiomisc.c: Likewise.

	* time/strptime.c: Add lots of conditional compiling to enable use
	outside glibc.  When used in glibc, make sure C locale format
	strings will always be recognized.

Sat Jan 11 18:53:47 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/sys/sysmacros.h (major, minor, makedev):
	Fix definitions so that they work with __kernel_dev_t.

Sat Jan 11 14:24:10 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/kernel_sigaction.h,
	sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h,
	sysdeps/unix/sysv/linux/sigaction.c: New files.
	* sysdeps/unix/sysv/linux/syscalls.list: Add s_sigaction.

Sun Jan 12 15:22:33 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* libc-symbols.h (link_warning): Make sure that the .gnu.warning
	section is not allocated.
	Update and reformat copyright.

Sun Jan 12 12:19:28 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* elf/Makefile ($(objpfx)ldd): Fix depedency list.

Sat Jan 11 15:11:26 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls): Fix
	command so that it works in subdirectories.

Wed Jan  8 22:07:58 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/i386/syscalls.list: Add s_getgroups and
	s_setgroups.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgroups.c,
	sysdeps/unix/sysv/linux/i386/setgroups.c,
	sysdeps/unix/sysv/linux/m68k/getgroups.c,
	sysdeps/unix/sysv/linux/m68k/setgroups.c: New files.

Wed Jan  8 19:42:59 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makefile (config.status): Delete bogus rule.
	($(objpfx)glibcbug): Renamed from plain `glibcbug', depend on
	config.status in build directory, fix command to change to build
	directory.
	* Makeconfig ($(common-objpfx)config.status): Depend on version.h.

Thu Jan  9 08:47:54 1997  Andreas Jaeger  <aj@arthur.pfalz.de>

	* glibcbug.in (while): We test for four and not five conditions,
	set MAIL_AGENT instead of RMAIL, filter spaces and tabs.

Thu Jan 16 22:00:27 1997  Ulrich Drepper  <drepper@cygnus.com>

	* misc/syslog.c: Don't define cancel_handler if _LIBC_REENTRANT
	is not defined.  Reported by Andreas Jaeger.

Thu Jan  9 08:47:54 1997  Andreas Jaeger  <aj@arthur.pfalz.de>

	* new-malloc/malloc.c (__MALLOC_P): define call to pthread
	initializer only if NO_THREADS is not defined.

Wed Jan  8 21:28:58 1997  Andreas Jaeger  <aj@arthur.pfalz.de>

	* resolv/nss_dns/dns-host.c: Clean-up: delete unnecessary includes
	and variables.

Thu Jan 16 21:50:27 1997  Ulrich Drepper  <drepper@cygnus.com>

	* inet/arpa/inet.h: Include <netinet/in.h> to get struct in_addr
	defined.

Tue Jan  7 17:29:59 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makerules (LDLIBS-c.so): New variable.

Tue Jan  7 19:22:00 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makefile ($(includedir)/gnu/lib-names.h): Define the library
	names as strings, not as sequence of tokens that may fall apart.

Fri Jan 10 14:08:41 1997  Roland McGrath  <roland@fmh.frob.com>

	* time/tzfile.c (__tzfile_read): Check for bogus type and zone name
	indices in data file and punt, so a bogus file can't crash us.

Thu Jan 16 20:29:15 1997  Ulrich Drepper  <drepper@cygnus.com>

	* values.h [__USE_MISC]: Define BITSPERBYTE.

Fri Jan 17 14:16:28 1997  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>

	* stdio/vdprintf.c: Moved file to ...
	* sysdeps/posix/vdprintf.c: Here.  De-ansideclificate.
	* sysdeps/stub/vdprintf.c: New file.
	* sysdeps/mach/hurd/vdprintf.c: New file.

Thu Jan  9 15:59:35 1997  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/posix_opt.h: New file.

	* sysdeps/mach/hurd/sigwait.c (sigwait): Don't affect signal mask.

	* sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Finish
	deansideclification.

	* sysdeps/mach/libc-lock.h: Add kludges to pretend to implement
	recursive locks.

Tue Jan  7 09:48:15 1997  Andreas Jaeger  <aj@arthur.pfalz.de>

	* signal/sigempty.c (sigemptyset): Correct typo: Empty set should
	have all bits zero.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sys')
-rw-r--r--sysdeps/unix/sysv/linux/sys/ipc_buf.h44
-rw-r--r--sysdeps/unix/sysv/linux/sys/mtio.h242
-rw-r--r--sysdeps/unix/sysv/linux/sys/procfs.h82
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysmacros.h6
4 files changed, 306 insertions, 68 deletions
diff --git a/sysdeps/unix/sysv/linux/sys/ipc_buf.h b/sysdeps/unix/sysv/linux/sys/ipc_buf.h
index a1eba68113..f5fea0d295 100644
--- a/sysdeps/unix/sysv/linux/sys/ipc_buf.h
+++ b/sysdeps/unix/sysv/linux/sys/ipc_buf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -25,43 +25,43 @@
 #include <sys/types.h>
 
 /* Mode bits for `msgget', `semget', and `shmget'.  */
-#define IPC_CREAT	01000		/* create key if key does not exist */
-#define IPC_EXCL	02000		/* fail if key exists */
-#define IPC_NOWAIT	04000		/* return error on wait */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
 
 /* Control commands for `msgctl', `semctl', and `shmctl'.  */
-#define IPC_RMID	0		/* remove identifier */
-#define IPC_SET		1		/* set `ipc_perm' options */
-#define IPC_STAT	2		/* get `ipc_perm' options */
-#define IPC_INFO	3		/* see ipcs */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#define IPC_INFO	3		/* See ipcs.  */
 
 
 __BEGIN_DECLS
 
 /* Special key values.  */
-#define IPC_PRIVATE	((key_t) 0)	/* private key */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
 
 
 /* Data structure used to pass permission information to IPC operations.  */
 struct ipc_perm
-{
-  key_t __key;				/* key */
-  __uid_t uid;				/* owner's user ID */
-  __gid_t gid;				/* owner's group ID */
-  __uid_t cuid;				/* creator's user ID */
-  __gid_t cgid;				/* creator's group ID */
-  __mode_t mode;			/* read/write permission */
-  unsigned short int __seq;		/* sequence number */
-};
+  {
+    __key_t __key;			/* Key.  */
+    unsigned short int uid;		/* Owner's user ID.  */
+    unsigned short int gid;		/* Owner's group ID.  */
+    unsigned short int cuid;		/* Creator's user ID.  */
+    unsigned short int cgid;		/* Creator's group ID.  */
+    unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+  };
 
 
 /* Kludge to work around Linux' restriction of only up to five
    arguments to a system call.  */
 struct ipc_kludge
-{
-  void *msgp;
-  long msgtyp;
-};
+  {
+    void *msgp;
+    long int msgtyp;
+  };
 
 /* The actual system call: all functions are multiplexed by this.  */
 extern int __ipc __P ((int __call, int __first, int __second, int __third,
diff --git a/sysdeps/unix/sysv/linux/sys/mtio.h b/sysdeps/unix/sysv/linux/sys/mtio.h
index 45db6a51b4..e238ef92d7 100644
--- a/sysdeps/unix/sysv/linux/sys/mtio.h
+++ b/sysdeps/unix/sysv/linux/sys/mtio.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Structures and definitions for magnetic tape I/O control commands.
+   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,13 +17,250 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* Written by H. Bergman <hennus@cybercomm.nl>.  */
+
 #ifndef _SYS_MTIO_H
 #define _SYS_MTIO_H	1
 
 /* Get necessary definitions from system and kernel headers.  */
 #include <sys/types.h>
 #include <sys/ioctl.h>
-#include <linux/mtio.h>
+
+
+/* Structure for MTIOCTOP - magnetic tape operation command.  */
+struct mtop
+  {
+    short int mt_op;		/* Operations defined below.  */
+    int mt_count;		/* How many of them.  */
+  };
+
+/* Magnetic Tape operations [Not all operations supported by all drivers].  */
+#define MTRESET 0	/* +reset drive in case of problems.  */
+#define MTFSF	1	/* Forward space over FileMark,
+			 * position at first record of next file.  */
+#define MTBSF	2	/* Backward space FileMark (position before FM).  */
+#define MTFSR	3	/* Forward space record.  */
+#define MTBSR	4	/* Backward space record.  */
+#define MTWEOF	5	/* Write an end-of-file record (mark).  */
+#define MTREW	6	/* Rewind.  */
+#define MTOFFL	7	/* Rewind and put the drive offline (eject?).  */
+#define MTNOP	8	/* No op, set status only (read with MTIOCGET).  */
+#define MTRETEN 9	/* Retension tape.  */
+#define MTBSFM	10	/* +backward space FileMark, position at FM.  */
+#define MTFSFM  11	/* +forward space FileMark, position at FM.  */
+#define MTEOM	12	/* Goto end of recorded media (for appending files).
+			   MTEOM positions after the last FM, ready for
+			   appending another file.  */
+#define MTERASE 13	/* Erase tape -- be careful!  */
+
+#define MTRAS1  14	/* Run self test 1 (nondestructive).  */
+#define MTRAS2	15	/* Run self test 2 (destructive).  */
+#define MTRAS3  16	/* Reserved for self test 3.  */
+
+#define MTSETBLK 20	/* Set block length (SCSI).  */
+#define MTSETDENSITY 21	/* Set tape density (SCSI).  */
+#define MTSEEK	22	/* Seek to block (Tandberg, etc.).  */
+#define MTTELL	23	/* Tell block (Tandberg, etc.).  */
+#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2.
+			     Ordinary buffered operation with code 1.  */
+#define MTFSS	25	/* Space forward over setmarks.  */
+#define MTBSS	26	/* Space backward over setmarks.  */
+#define MTWSM	27	/* Write setmarks.  */
+
+#define MTLOCK  28	/* Lock the drive door.  */
+#define MTUNLOCK 29	/* Unlock the drive door.  */
+#define MTLOAD  30	/* Execute the SCSI load command.  */
+#define MTUNLOAD 31	/* Execute the SCSI unload command.  */
+#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15.  */
+#define MTSETPART 33	/* Change the active tape partition.  */
+#define MTMKPART  34	/* Format the tape with one or two partitions.  */
+
+/* structure for MTIOCGET - mag tape get status command */
+
+struct mtget
+  {
+    long int mt_type;		/* Type of magtape device.  */
+    long int mt_resid;		/* Residual count: (not sure)
+				   number of bytes ignored, or
+				   number of files not skipped, or
+				   number of records not skipped.  */
+    /* The following registers are device dependent.  */
+    long int mt_dsreg;		/* Status register.  */
+    long int mt_gstat;		/* Generic (device independent) status.  */
+    long int mt_erreg;		/* Error register.  */
+    /* The next two fields are not always used.  */
+    __daddr_t mt_fileno;	/* Number of current file on tape.  */
+    __daddr_t mt_blkno;		/* Current block number.  */
+  };
+
+
+
+/* Constants for mt_type. Not all of these are supported, and
+   these are not all of the ones that are supported.  */
+#define MT_ISUNKNOWN		0x01
+#define MT_ISQIC02		0x02	/* Generic QIC-02 tape streamer.  */
+#define MT_ISWT5150		0x03	/* Wangtek 5150EQ, QIC-150, QIC-02.  */
+#define MT_ISARCHIVE_5945L2	0x04	/* Archive 5945L-2, QIC-24, QIC-02?. */
+#define MT_ISCMSJ500		0x05	/* CMS Jumbo 500 (QIC-02?).  */
+#define MT_ISTDC3610		0x06	/* Tandberg 6310, QIC-24.  */
+#define MT_ISARCHIVE_VP60I	0x07	/* Archive VP60i, QIC-02.  */
+#define MT_ISARCHIVE_2150L	0x08	/* Archive Viper 2150L.  */
+#define MT_ISARCHIVE_2060L	0x09	/* Archive Viper 2060L.  */
+#define MT_ISARCHIVESC499	0x0A	/* Archive SC-499 QIC-36 controller. */
+#define MT_ISQIC02_ALL_FEATURES	0x0F	/* Generic QIC-02 with all features. */
+#define MT_ISWT5099EEN24	0x11	/* Wangtek 5099-een24, 60MB, QIC-24. */
+#define MT_ISTEAC_MT2ST		0x12	/* Teac MT-2ST 155mb drive,
+					   Teac DC-1 card (Wangtek type).  */
+#define MT_ISEVEREX_FT40A	0x32	/* Everex FT40A (QIC-40).  */
+#define MT_ISDDS1		0x51	/* DDS device without partitions.  */
+#define MT_ISDDS2		0x52	/* DDS device with partitions.  */
+#define MT_ISSCSI1		0x71	/* Generic ANSI SCSI-1 tape unit.  */
+#define MT_ISSCSI2		0x72	/* Generic ANSI SCSI-2 tape unit.  */
+
+/* QIC-40/80/3010/3020 ftape supported drives.
+   20bit vendor ID + 0x800000 (see vendors.h in ftape distribution).  */
+#define MT_ISFTAPE_UNKNOWN	0x800000 /* obsolete */
+#define MT_ISFTAPE_FLAG		0x800000
+
+struct mt_tape_info
+  {
+    long int t_type;		/* Device type id (mt_type).  */
+    char *t_name;		/* Descriptive name.  */
+  };
+
+#define MT_TAPE_INFO \
+  {									      \
+	{MT_ISUNKNOWN,		"Unknown type of tape device"},		      \
+	{MT_ISQIC02,		"Generic QIC-02 tape streamer"},	      \
+	{MT_ISWT5150,		"Wangtek 5150, QIC-150"},		      \
+	{MT_ISARCHIVE_5945L2,	"Archive 5945L-2"},			      \
+	{MT_ISCMSJ500,		"CMS Jumbo 500"},			      \
+	{MT_ISTDC3610,		"Tandberg TDC 3610, QIC-24"},		      \
+	{MT_ISARCHIVE_VP60I,	"Archive VP60i, QIC-02"},		      \
+	{MT_ISARCHIVE_2150L,	"Archive Viper 2150L"},			      \
+	{MT_ISARCHIVE_2060L,	"Archive Viper 2060L"},			      \
+	{MT_ISARCHIVESC499,	"Archive SC-499 QIC-36 controller"},	      \
+	{MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"},	      \
+	{MT_ISWT5099EEN24,	"Wangtek 5099-een24, 60MB"},		      \
+	{MT_ISTEAC_MT2ST,	"Teac MT-2ST 155mb data cassette drive"},     \
+	{MT_ISEVEREX_FT40A,	"Everex FT40A, QIC-40"},		      \
+	{MT_ISSCSI1,		"Generic SCSI-1 tape"},			      \
+	{MT_ISSCSI2,		"Generic SCSI-2 tape"},			      \
+	{0, NULL}							      \
+  }
+
+
+/* Structure for MTIOCPOS - mag tape get position command.  */
+
+struct mtpos
+  {
+    long int mt_blkno;	/* Current block number.  */
+  };
+
+
+/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
+   as an interim solution for QIC-02 until DDI is fully implemented.  */
+struct mtconfiginfo
+  {
+    long int mt_type;		/* Drive type.  */
+    long int ifc_type;		/* Interface card type.  */
+    unsigned short int irqnr;	/* IRQ number to use.  */
+    unsigned short int dmanr;	/* DMA channel to use.  */
+    unsigned short int port;	/* IO port base address.  */
+
+    unsigned long int debug;	/* Debugging flags.  */
+
+    unsigned have_dens:1;
+    unsigned have_bsf:1;
+    unsigned have_fsr:1;
+    unsigned have_bsr:1;
+    unsigned have_eod:1;
+    unsigned have_seek:1;
+    unsigned have_tell:1;
+    unsigned have_ras1:1;
+    unsigned have_ras2:1;
+    unsigned have_ras3:1;
+    unsigned have_qfa:1;
+
+    unsigned pad1:5;
+    char reserved[10];
+  };
+
+
+/* Magnetic tape I/O control commands.  */
+#define	MTIOCTOP	_IOW('m', 1, struct mtop)	/* Do a mag tape op. */
+#define	MTIOCGET	_IOR('m', 2, struct mtget)	/* Get tape status.  */
+#define	MTIOCPOS	_IOR('m', 3, struct mtpos)	/* Get tape position.*/
+
+/* The next two are used by the QIC-02 driver for runtime reconfiguration.
+   See tpqic02.h for struct mtconfiginfo.  */
+#define	MTIOCGETCONFIG	_IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/
+#define	MTIOCSETCONFIG	_IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/
+
+/* Generic Mag Tape (device independent) status macros for examining
+   mt_gstat -- HP-UX compatible.
+   There is room for more generic status bits here, but I don't
+   know which of them are reserved. At least three or so should
+   be added to make this really useful.  */
+#define GMT_EOF(x)              ((x) & 0x80000000)
+#define GMT_BOT(x)              ((x) & 0x40000000)
+#define GMT_EOT(x)              ((x) & 0x20000000)
+#define GMT_SM(x)               ((x) & 0x10000000)  /* DDS setmark */
+#define GMT_EOD(x)              ((x) & 0x08000000)  /* DDS EOD */
+#define GMT_WR_PROT(x)          ((x) & 0x04000000)
+/* #define GMT_ ? 		((x) & 0x02000000) */
+#define GMT_ONLINE(x)           ((x) & 0x01000000)
+#define GMT_D_6250(x)           ((x) & 0x00800000)
+#define GMT_D_1600(x)           ((x) & 0x00400000)
+#define GMT_D_800(x)            ((x) & 0x00200000)
+/* #define GMT_ ? 		((x) & 0x00100000) */
+/* #define GMT_ ? 		((x) & 0x00080000) */
+#define GMT_DR_OPEN(x)          ((x) & 0x00040000)  /* Door open (no tape).  */
+/* #define GMT_ ? 		((x) & 0x00020000) */
+#define GMT_IM_REP_EN(x)        ((x) & 0x00010000)  /* Immediate report mode.*/
+/* 16 generic status bits unused.  */
+
+
+/* SCSI-tape specific definitions.  Bitfield shifts in the status  */
+#define MT_ST_BLKSIZE_SHIFT	0
+#define MT_ST_BLKSIZE_MASK	0xffffff
+#define MT_ST_DENSITY_SHIFT	24
+#define MT_ST_DENSITY_MASK	0xff000000
+
+#define MT_ST_SOFTERR_SHIFT	0
+#define MT_ST_SOFTERR_MASK	0xffff
+
+/* Bitfields for the MTSETDRVBUFFER ioctl.  */
+#define MT_ST_OPTIONS		0xf0000000
+#define MT_ST_BOOLEANS		0x10000000
+#define MT_ST_SETBOOLEANS	0x30000000
+#define MT_ST_CLEARBOOLEANS	0x40000000
+#define MT_ST_WRITE_THRESHOLD	0x20000000
+#define MT_ST_DEF_BLKSIZE	0x50000000
+#define MT_ST_DEF_OPTIONS	0x60000000
+
+#define MT_ST_BUFFER_WRITES	0x1
+#define MT_ST_ASYNC_WRITES	0x2
+#define MT_ST_READ_AHEAD	0x4
+#define MT_ST_DEBUGGING		0x8
+#define MT_ST_TWO_FM		0x10
+#define MT_ST_FAST_MTEOM	0x20
+#define MT_ST_AUTO_LOCK		0x40
+#define MT_ST_DEF_WRITES	0x80
+#define MT_ST_CAN_BSR		0x100
+#define MT_ST_NO_BLKLIMS	0x200
+#define MT_ST_CAN_PARTITIONS    0x400
+#define MT_ST_SCSI2LOGICAL      0x800
+
+/* The mode parameters to be controlled. Parameter chosen with bits 20-28.  */
+#define MT_ST_CLEAR_DEFAULT	0xfffff
+#define MT_ST_DEF_DENSITY	(MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION	(MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER	(MT_ST_DEF_OPTIONS | 0x300000)
+
+/* The offset for the arguments for the special HP changer load command.  */
+#define MT_ST_HPLOADER_OFFSET 10000
+
 
 /* Specify default tape device.  */
 #ifndef DEFTAPE
diff --git a/sysdeps/unix/sysv/linux/sys/procfs.h b/sysdeps/unix/sysv/linux/sys/procfs.h
index 59f0fcd594..e8d32390fa 100644
--- a/sysdeps/unix/sysv/linux/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,11 +34,11 @@
 __BEGIN_DECLS
 
 struct elf_siginfo
-{
-  int si_signo;				/* signal number */
-  int si_code;				/* extra code */
-  int si_errno;				/* errno */
-};
+  {
+    int si_signo;			/* Signal number.  */
+    int si_code;			/* Extra code.  */
+    int si_errno;			/* Errno.  */
+  };
 
 typedef elf_greg_t greg_t;
 typedef elf_gregset_t gregset_t;
@@ -53,52 +53,52 @@ typedef elf_fpregset_t fpregset_t;
    gdb doesn't really use excluded.  Fields present but not used are
    marked with "XXX".  */
 struct elf_prstatus
-{
+  {
 #if 0
-  long pr_flags;			/* XXX Process flags */
-  short pr_why;				/* XXX Reason for process halt */
-  short pr_what;			/* XXX More detailed reason */
+    long int pr_flags;			/* XXX Process flags.  */
+    short int pr_why;			/* XXX Reason for process halt.  */
+    short int pr_what;			/* XXX More detailed reason.  */
 #endif
-  struct elf_siginfo pr_info;		/* Info associated with signal */
-  short pr_cursig;			/* Current signal */
-  sigset_t pr_sigpend;			/* Set of pending signals */
-  sigset_t pr_sighold;			/* Set of held signals */
+    struct elf_siginfo pr_info;		/* Info associated with signal.  */
+    short int pr_cursig;		/* Current signal.  */
+    unsigned long int pr_sigpend;	/* Set of pending signals.  */
+    unsigned long int pr_sighold;	/* Set of held signals.  */
 #if 0
-  struct sigaltstack pr_altstack;	/* Alternate stack info */
-  struct sigaction pr_action;		/* Signal action for current sig */
+    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
+    struct sigaction pr_action;		/* Signal action for current sig.  */
 #endif
-  pid_t pr_pid;
-  pid_t pr_ppid;
-  pid_t pr_pgrp;
-  pid_t pr_sid;
-  struct timeval pr_utime;		/* User time */
-  struct timeval pr_stime;		/* System time */
-  struct timeval pr_cutime;		/* Cumulative user time */
-  struct timeval pr_cstime;		/* Cumulative system time */
+    __pid_t pr_pid;
+    __pid_t pr_ppid;
+    __pid_t pr_pgrp;
+    __pid_t pr_sid;
+    struct timeval pr_utime;		/* User time.  */
+    struct timeval pr_stime;		/* System time.  */
+    struct timeval pr_cutime;		/* Cumulative user time.  */
+    struct timeval pr_cstime;		/* Cumulative system time.  */
 #if 0
-  long pr_instr;			/* Current instruction */
+    long int pr_instr;			/* Current instruction.  */
 #endif
-  elf_gregset_t pr_reg;			/* GP registers */
-  int pr_fpvalid;			/* True if math copro being used.  */
-};
+    elf_gregset_t pr_reg;		/* GP registers.  */
+    int pr_fpvalid;			/* True if math copro being used.  */
+  };
 
 
 #define ELF_PRARGSZ     (80)    /* Number of chars for args */
 
 struct elf_prpsinfo
-{
-  char pr_state;			/* numeric process state */
-  char pr_sname;			/* char for pr_state */
-  char pr_zomb;				/* zombie */
-  char pr_nice;				/* nice val */
-  unsigned long pr_flag;		/* flags */
-  uid_t pr_uid;
-  gid_t pr_gid;
-  pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
-  /* Lots missing */
-  char pr_fname[16];			/* filename of executable */
-  char pr_psargs[ELF_PRARGSZ];		/* initial part of arg list */
-};
+  {
+    char pr_state;			/* Numeric process state.  */
+    char pr_sname;			/* Char for pr_state.  */
+    char pr_zomb;			/* Zombie.  */
+    char pr_nice;			/* Nice val.  */
+    unsigned long int pr_flag;		/* Flags.  */
+    unsigned short int pr_uid;
+    unsigned short int pr_gid;
+    unsigned short int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    /* Lots missing */
+    char pr_fname[16];			/* Filename of executable.  */
+    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
+  };
 
 
 typedef struct elf_prstatus prstatus_t;
diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h
index b859dc7d64..85b1b85d2e 100644
--- a/sysdeps/unix/sysv/linux/sys/sysmacros.h
+++ b/sysdeps/unix/sysv/linux/sys/sysmacros.h
@@ -22,8 +22,8 @@
 #define _SYS_SYSMACROS_H	1
 
 /* For compatibility we provide alternative names.  */
-#define major(dev) ((dev) >> 32)
-#define minor(dev) ((dev) & 0xffffffff)
-#define makedev(major, minor) (((major) << 32) | (monor))
+#define major(dev) (((dev) >> 8) & 0xff)
+#define minor(dev) ((dev) & 0xff)
+#define makedev(major, minor) (((major) << 8) | (minor))
 
 #endif /* _SYS_SYSMACROS_H */