Project

General

Profile

Bug #6136

sysmacros.h unnecessarily pollutes the namespace

Added by Josef Sipek about 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Low
Assignee:
Category:
kernel
Start date:
2015-08-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

sysmacros.h contains all sort of questionable content. The following macros can be safely removed.

  • major - provided by the DDI/libc
  • minor - provided by the DDI/libc
  • makedev - provided by the DDI/libc
  • bmajor - unused
  • emajor - unused
  • eminor - unused

A comment in sysmacros.h states:

/*
 * WARNING: The device number macros defined here should not be used by device
 * drivers or user software. Device drivers should use the device functions
 * defined in the DDI/DKI interface (see also ddi.h). Application software
 * should make use of the library routines available in makedev(3). A set of
 * new device macros are provided to operate on the expanded device number
 * format supported in SVR4. Macro versions of the DDI device functions are
 * provided for use by kernel proper routines only. Macro routines bmajor(),
 * major(), minor(), emajor(), eminor(), and makedev() will be removed or
 * their definitions changed at the next major release following SVR4.
 */

So, having these macros for kernel proper use only causes us to:

  • keep code that's been slated for removal for a long time
  • get either the functions or macros based on which headers are included (and if both are included the order determines what we end up using)

Related issues

Related to illumos gate - Bug #6469: sendmail shouldn't use major/minorNew2015-11-20

Actions

History

#1

Updated by Josef Sipek about 5 years ago

  • Subject changed from sysmacros.h unnecessarily polutes the namespace to sysmacros.h unnecessarily pollutes the namespace
#2

Updated by Josef Sipek almost 5 years ago

  • % Done changed from 80 to 100
#3

Updated by Josef Sipek almost 5 years ago

  • Related to Bug #6469: sendmail shouldn't use major/minor added

Also available in: Atom PDF