This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients koobs, vstinner
Date 2017-07-27.14:16:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501165000.79.0.0927133153098.issue31044@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is more the major(), minor() and makedev() commands:

CURRENT-amd64% ./python       
Python 3.7.0a0 (heads/master:d5ed47dea2, Jul 28 2017, 00:10:54) 
[GCC 4.2.1 Compatible FreeBSD Clang 5.0.0 (trunk 308421)] on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> dev=954774858155; os.makedev(os.major(dev), os.minor(dev))
1292118443

"makedev, major, minor -- device number conversion" doc on FreeBSD CURRENT:

https://www.freebsd.org/cgi/man.cgi?query=makedev&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html



SYNOPSIS
     #include <sys/types.h>

     dev_t
     makedev(int major,	int minor);

     int
     major(dev_t dev);

     int
     minor(dev_t dev);

DESCRIPTION
     The makedev() macro allows	a unique device	number to be generated based
     on	its major and minor number.  The major() and minor() macros can	be
     used to obtain the	original numbers from the device number	dev.

     In	previous implementations of FreeBSD all	block and character devices
     were uniquely identified by a pair	of major and minor numbers.  The major
     number referred to	a certain device class (e.g. disks, TTYs) while	the
     minor number identified an	instance within	the device class.  Later ver-
     sions of FreeBSD automatically generate a unique device number for	each
     character device visible in /dev/.	 These numbers are not divided in
     device classes.

     On	FreeBSD	these macros are only used by utilities	that need to exchange
     numbers with other	operating systems that may use different encodings for
     dev_t, but	also applications that present these numbers to	the user in a
     more conventional way.

RETURN VALUES
     The major() macro returns a device	major number that has a	value between
     0 and 255.	 The minor() macro returns a device minor number whose value
     can span the complete range of an int.
History
Date User Action Args
2017-07-27 14:16:40vstinnersetrecipients: + vstinner, koobs
2017-07-27 14:16:40vstinnersetmessageid: <1501165000.79.0.0927133153098.issue31044@psf.upfronthosting.co.za>
2017-07-27 14:16:40vstinnerlinkissue31044 messages
2017-07-27 14:16:40vstinnercreate