]> git.cworth.org Git - tar/blob - lib/system-ioctl.h
upstream: Fix extraction of device nodes.
[tar] / lib / system-ioctl.h
1 /* System dependent definitions for GNU tar's use of ioctl macros.
2
3    Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003,
4    2004, 2005, 2006, 2007 Free Software Foundation, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3, or (at your option)
9    any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software Foundation,
18    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
19
20 /* This is a real challenge to properly get MTIO* symbols :-(.  ISC uses
21    <sys/gentape.h>.  SCO and BSDi uses <sys/tape.h>; BSDi also requires
22    <sys/tprintf.h> and <sys/device.h> for defining tp_dev and tpr_t.  It
23    seems that the rest use <sys/mtio.h>, which itself requires other files,
24    depending on systems.  Pyramid defines _IOW in <sgtty.h>, for example.  */
25
26 #if HAVE_SYS_GENTAPE_H
27 # include <sys/gentape.h>
28 #else
29 # if HAVE_SYS_TAPE_H
30 #  if HAVE_SYS_DEVICE_H
31 #   include <sys/device.h>
32 #  endif
33 #  if HAVE_SYS_PARAM_H
34 #   include <sys/param.h>
35 #  endif
36 #  if HAVE_SYS_BUF_H
37 #   include <sys/buf.h>
38 #  endif
39 #  if HAVE_SYS_TPRINTF_H
40 #   include <sys/tprintf.h>
41 #  endif
42 #  include <sys/tape.h>
43 # else
44 #  if HAVE_SYS_MTIO_H
45 #   include <sys/ioctl.h>
46 #   if HAVE_SGTTY_H
47 #    include <sgtty.h>
48 #   endif
49 #   if HAVE_SYS_IO_TRIOCTL_H
50 #    include <sys/io/trioctl.h>
51 #   endif
52 #   include <sys/mtio.h>
53 #  endif
54 # endif
55 #endif