Blame sysdeps/unix/sysv/linux/device-nrs.h

Packit 6c4009
/* Device numbers of devices used in the implementation.  Linux version.
Packit 6c4009
   Copyright (C) 2000-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _DEVICE_NRS_H
Packit 6c4009
#define _DEVICE_NRS_H	1
Packit 6c4009
Packit 6c4009
#include <sys/sysmacros.h>
Packit 6c4009
Packit 6c4009
/* /dev/null is (1,3).  */
Packit 6c4009
#define DEV_NULL_MAJOR	1
Packit 6c4009
#define DEV_NULL_MINOR	3
Packit 6c4009
Packit 6c4009
/* /dev/full is (1,7).  */
Packit 6c4009
#define DEV_FULL_MAJOR	1
Packit 6c4009
#define DEV_FULL_MINOR	7
Packit 6c4009
Packit 6c4009
/* Pseudo tty slaves.  For Linux we use the Unix98 ttys.  We could
Packit 6c4009
   also include the old BSD-style tty buts they should not be used and
Packit 6c4009
   the extra test would only slow down correctly set up systems.  If a
Packit 6c4009
   system still uses those device the slower tests performed (using
Packit 6c4009
   isatty) will catch it.  */
Packit 6c4009
#define DEV_TTY_LOW_MAJOR	136
Packit 6c4009
#define DEV_TTY_HIGH_MAJOR	143
Packit 6c4009
Packit 6c4009
/* Test whether given device is a tty.  */
Packit 6c4009
#define DEV_TTY_P(statp) \
Packit 6c4009
  ({ int __dev_major = __gnu_dev_major ((statp)->st_rdev);		      \
Packit 6c4009
     __dev_major >= DEV_TTY_LOW_MAJOR && __dev_major <= DEV_TTY_HIGH_MAJOR; })
Packit 6c4009
Packit 6c4009
#endif	/* device-nrs.h */