Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5bb414d1
Kaydet (Commit)
5bb414d1
authored
Ara 08, 2013
tarafından
Christian Heimes
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19343: Expose FreeBSD-specific APIs in resource module. Original patch by Koobs.
üst
ead8d085
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
0 deletions
+51
-0
resource.rst
Doc/library/resource.rst
+28
-0
test_resource.py
Lib/test/test_resource.py
+6
-0
NEWS
Misc/NEWS
+3
-0
resource.c
Modules/resource.c
+14
-0
No files found.
Doc/library/resource.rst
Dosyayı görüntüle @
5bb414d1
...
...
@@ -217,6 +217,34 @@ platform.
.. versionadded:: 3.4
.. data:: RLIMIT_SBSIZE
The maximum size (in bytes) of socket buffer usage for this user.
This limits the amount of network memory, and hence the amount of mbufs,
that this user may hold at any time.
Availability: FreeBSD 9 or later.
.. versionadded:: 3.4
.. data:: RLIMIT_SWAP
The maximum size (in bytes) of the swap space that may be reserved or
used by all of this user id's processes.
This limit is enforced only if bit 1 of the vm.overcommit sysctl is set.
Please see :manpage:`tuning(7)` for a complete description of this sysctl.
Availability: FreeBSD 9 or later.
.. versionadded:: 3.4
.. data:: RLIMIT_NPTS
The maximum number of pseudo-terminals created by this user id.
Availability: FreeBSD 9 or later.
.. versionadded:: 3.4
Resource Usage
--------------
...
...
Lib/test/test_resource.py
Dosyayı görüntüle @
5bb414d1
...
...
@@ -138,6 +138,12 @@ class ResourceTest(unittest.TestCase):
with
contextlib
.
suppress
(
AttributeError
):
self
.
assertIsInstance
(
getattr
(
resource
,
'RLIMIT_'
+
attr
),
int
)
@support.requires_freebsd_version
(
9
)
def
test_freebsd_contants
(
self
):
for
attr
in
[
'SWAP'
,
'SBSIZE'
,
'NPTS'
]:
with
contextlib
.
suppress
(
AttributeError
):
self
.
assertIsInstance
(
getattr
(
resource
,
'RLIMIT_'
+
attr
),
int
)
@unittest.skipUnless
(
hasattr
(
resource
,
'prlimit'
),
'no prlimit'
)
@support.requires_linux_version
(
2
,
6
,
36
)
def
test_prlimit
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
5bb414d1
...
...
@@ -18,6 +18,9 @@ Core and Builtins
Library
-------
- Issue #19343: Expose FreeBSD-specific APIs in resource module. Original
patch by Koobs.
- Issue #19506: Use a memoryview to avoid a data copy when piping data
to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
...
...
Modules/resource.c
Dosyayı görüntüle @
5bb414d1
...
...
@@ -424,6 +424,20 @@ PyInit_resource(void)
PyModule_AddIntMacro
(
m
,
RUSAGE_THREAD
);
#endif
/* FreeBSD specific */
#ifdef RLIMIT_SWAP
PyModule_AddIntMacro
(
m
,
RLIMIT_SWAP
);
#endif
#ifdef RLIMIT_SBSIZE
PyModule_AddIntMacro
(
m
,
RLIMIT_SBSIZE
);
#endif
#ifdef RLIMIT_NPTS
PyModule_AddIntMacro
(
m
,
RLIMIT_NPTS
);
#endif
#if defined(HAVE_LONG_LONG)
if
(
sizeof
(
RLIM_INFINITY
)
>
sizeof
(
long
))
{
v
=
PyLong_FromLongLong
((
PY_LONG_LONG
)
RLIM_INFINITY
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment