Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sysmacros.h « sys « include « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1bc39941b34c38d2d4d21b4d24b8929cb3f2b2c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* sys/sysmacros.h

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#ifndef _SYS_SYSMACROS_H
#define _SYS_SYSMACROS_H

#include <sys/types.h>

_ELIDABLE_INLINE int gnu_dev_major(dev_t);
_ELIDABLE_INLINE int gnu_dev_minor(dev_t);
_ELIDABLE_INLINE dev_t gnu_dev_makedev(int, int);

_ELIDABLE_INLINE int
gnu_dev_major(dev_t dev)
{
	return (int)(((dev) >> 16) & 0xffff);
}

_ELIDABLE_INLINE int
gnu_dev_minor(dev_t dev)
{
	return (int)((dev) & 0xffff);
}

_ELIDABLE_INLINE dev_t
gnu_dev_makedev(int maj, int min)
{
	return (((maj) << 16) | ((min) & 0xffff));
}

#define major(dev) gnu_dev_major(dev)
#define minor(dev) gnu_dev_minor(dev)
#define makedev(maj, min) gnu_dev_makedev(maj, min)

#endif /* _SYS_SYSMACROS_H */