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.

classification
Title: [Patch] posixmodule: Make the presence of os.getpid() optional
Type: Stage: resolved
Components: Extension Modules Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: EdSchouten, berker.peksag, python-dev
Priority: normal Keywords:

Created on 2016-09-14 16:53 by EdSchouten, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch-no-getpid EdSchouten, 2016-09-14 16:53 Patch to provide os.getpid() conditionally review
Messages (3)
msg276470 - (view) Author: Ed Schouten (EdSchouten) * Date: 2016-09-14 16:53
CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html) does not provide getpid(). Though this may sound quite silly at first, there is quite a good reason for this. One of the things that CloudABI wants to achieve is making large scale (cluster/cloud) computing easier. In such an environment there is rarely a need for having machine-local unique process identifiers. They have to be globally unique and preferably not recycled.

POSIX requires that pid_t is a signed integer that must have a positive value. Most C compilers only provide full support for integers up to 64 bits in size. This means that CloudABI could only provide 63-bit process identifiers, which is far smaller than, say, a UUID. For this reason we've decided to omit getpid() altogether.

Attached is a patch that makes use of the already existing HAVE_GETPID definition in pyconfig.h to disable the os.getpid() function that is part of the posixmodule.
msg276579 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-15 17:46
New changeset d17ff867580f by Berker Peksag in branch '3.6':
Issue #28156: Export os.getpid() conditionally
https://hg.python.org/cpython/rev/d17ff867580f

New changeset 33834105048e by Berker Peksag in branch 'default':
Issue #28156: Merge from 3.6
https://hg.python.org/cpython/rev/33834105048e
msg276580 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-15 17:47
Thanks!
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72343
2016-09-15 17:47:11berker.peksagsetstatus: open -> closed

versions: + Python 3.7
nosy: + berker.peksag

messages: + msg276580
resolution: fixed
stage: resolved
2016-09-15 17:46:34python-devsetnosy: + python-dev
messages: + msg276579
2016-09-14 16:53:50EdSchoutencreate