[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

STINNER Victor report at bugs.python.org
Mon Sep 9 04:33:37 EDT 2019


STINNER Victor <vstinner at python.org> added the comment:

> FreeBSD has a similar concept using /dev/fd "file-descriptor file system". (...) I'm not sure how it is supposed to work.

Sadly, on my FreeBSD VM, it seems like /dev/fd/ is not mounted with fdescfs by default, but as a regular directory with 3 hardcoded files 0, 1 and 2 which are character devices.

I had to mount fdescfs filesystem manually at /dev/fd/ :-(

$ cat /etc/fstab 
# Custom /etc/fstab for FreeBSD VM images
/dev/gpt/rootfs   /       ufs     rw      1       1
/dev/gpt/swapfs  none    swap    sw      0       0

Maybe it's an issue with "FreeBSD VM images" that I chose.

--

The FreeBSD CURRENT buildbot worker mounts /dev/fd:

CURRENT-amd64% cat /etc/fstab
# Device	Mountpoint	FStype	Options	Dump	Pass#
/dev/da0p2	none		swap	sw	0	0
/dev/da0p3	/		ufs	rw	1	1
fdescfs		/dev/fd		fdescfs	rw	0	0

CURRENT-amd64% mount|grep fd
fdescfs on /dev/fd (fdescfs)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38061>
_______________________________________


More information about the Python-bugs-list mailing list