Skip to main content

sys_prctl: Linux syscall prctl setting the process name and the thread name

Project description

sys_prctl: Linux syscall prctl setting the process name and the thread name

# @Time    : 2021/11/18 20:06
# @Author  : tk
# @FileName: test_prctl.py

import sys_prctl
import time
import os
'''
    sys_prctl: Linux syscall prctl setting the process name and the thread name
    
    sys_prctl had test pass at linux python3.6,python3.7,python3.8,python3.9
    
    support only for linux
'''


def test_prctl():
    # 参见linux prctl
    # sys_prctl.prctl
    pass
#set current process id
def test_process():
    #get process name
    name = sys_prctl.getprocname()
    print(name)

    # set process name
    name = "my_process"
    sys_prctl.setprocname(name)

    #get process name
    name = sys_prctl.getprocname()
    print(name)

    print(os.getpid())
    time.sleep(10 * 60)
    #ps -ef | grep my_process

def test_process_with_tid():
    #pthread_id is not thread id , it is c pthread id
    pthread_id = -1
    print('pthread_id:',pthread_id)
    # get process name
    name = sys_prctl.getprocname(pthread_id=pthread_id)
    print(name)

    # set process name
    name = "my_process"
    # tid thread id
    sys_prctl.setprocname(name, pthread_id=pthread_id)

    # get process name
    name = sys_prctl.getprocname(pthread_id=pthread_id)
    print(name)

    print(os.getpid())
    time.sleep(10 * 60)



    #ps -ef | grep my_process

if __name__ == '__main__':
    test_process()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

sys_prctl-0.0.4-cp310-cp310-manylinux2014_x86_64.whl (64.4 kB view details)

Uploaded CPython 3.10

sys_prctl-0.0.4-cp310-cp310-manylinux2014_aarch64.whl (62.4 kB view details)

Uploaded CPython 3.10

sys_prctl-0.0.4-cp39-cp39-manylinux2014_x86_64.whl (63.6 kB view details)

Uploaded CPython 3.9

sys_prctl-0.0.4-cp39-cp39-manylinux2014_aarch64.whl (62.5 kB view details)

Uploaded CPython 3.9

sys_prctl-0.0.4-cp38-cp38-manylinux2014_x86_64.whl (63.5 kB view details)

Uploaded CPython 3.8

sys_prctl-0.0.4-cp38-cp38-manylinux2014_aarch64.whl (62.4 kB view details)

Uploaded CPython 3.8

sys_prctl-0.0.4-cp37-cp37m-manylinux2014_x86_64.whl (63.2 kB view details)

Uploaded CPython 3.7m

sys_prctl-0.0.4-cp37-cp37m-manylinux2014_aarch64.whl (62.8 kB view details)

Uploaded CPython 3.7m

sys_prctl-0.0.4-cp36-cp36m-manylinux2014_x86_64.whl (63.2 kB view details)

Uploaded CPython 3.6m

sys_prctl-0.0.4-cp36-cp36m-manylinux2014_aarch64.whl (62.9 kB view details)

Uploaded CPython 3.6m

File details

Details for the file sys_prctl-0.0.4-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp310-cp310-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 64.4 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for sys_prctl-0.0.4-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1847d092bfec4f1092beea9fea804c3fb22fbcd5db529d2a29735289807af3b1
MD5 7ad13bb2b7388402e57b12154bdf9acc
BLAKE2b-256 86456db88de68eddfe4c1023339d8525f7b4d88645e37d7d018ce388ef328b8a

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp310-cp310-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 62.4 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for sys_prctl-0.0.4-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 63d80b56d1e7ac6a49e49bb5cf27f55a183032751a7b80289cf4c31ddf2c5daf
MD5 3cb59ab23f25b69cf754a6982e779def
BLAKE2b-256 9b05ec514724e10812552216a4b5ae9e1a516dc7c5861fe7b501d75c641a7102

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8ce085eee2118e9c969f891b1a035fa746ef0d4ec8f7748eb2dddcb907eebd9f
MD5 dd89dca8ceaf55d9027399212fbb3245
BLAKE2b-256 13e9c493f8773638a3bade3047a3d55e31a02b60bf98650f63b1d1cce4f3f79c

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp39-cp39-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 62.5 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aff15a3bfe973418b10d20e52e0da35b9fac8425cca5b714718805acad72e363
MD5 dcd85640b78c874c870987a94b2a5622
BLAKE2b-256 e4541cc9d46e0ccde5b07afff068371c5060002bae95e5cd96ae8113f69dedaa

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 63.5 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5a603b292400eee2e06bfbeaf0887b58425df9e1d4e88f9e98ec10f0dd6a09f
MD5 d4f112c83f194a284f8461d2d83b7a81
BLAKE2b-256 ddb37ac36264b7790bec8ce3e2adb532d0664158bffa43e8572072a863bba78a

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp38-cp38-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 62.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3777ee09f9707b3098e35bc1d2f0d1b344520ef5783127a2de897d86824b686d
MD5 20555bf31fe237c8ef8744b48e9ed21e
BLAKE2b-256 f488272c76e18170945dbaff22e91a79fdf731c9ee7b0552907bed73501e15d1

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 63.2 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 087ca6e2c2a718f44ace063d1bfbe49c6cc0051810cea28c8ed9f24cba34cc35
MD5 03468286a167f1480a4b81f070692e0a
BLAKE2b-256 345395ee9438e6564bb8fc38162df022bda0af242dce1a84cd5e81cbc23a1c78

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp37-cp37m-manylinux2014_aarch64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp37-cp37m-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 62.8 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 caca769dbef52bc95b94fa53b0ce152affa45c07073cf919e278381a7491ebbf
MD5 ecda1338ac7fc9a6a32839f5d2049280
BLAKE2b-256 045d85d5e8af56534a5a2bf827c1b3ee13479ef2f398110a3d39aafe37480596

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 63.2 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b69c4e124fe29eebbf5b1ea23c1d30259904893f57ada019d9e10916bcec1fb6
MD5 5374d0e2a525019691be4396505b9376
BLAKE2b-256 d743418478dc6b3d3f7875b25f8bd94b241ff8fb333bb9539a0436746e22401d

See more details on using hashes here.

File details

Details for the file sys_prctl-0.0.4-cp36-cp36m-manylinux2014_aarch64.whl.

File metadata

  • Download URL: sys_prctl-0.0.4-cp36-cp36m-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 62.9 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sys_prctl-0.0.4-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 59309164702abd55a5ae321746fbf7cf5c57c18978ff09ffa650b2166440fc5d
MD5 c70874537d666a1fcf8ae6b74ae598c6
BLAKE2b-256 75bbb1f1e459e833f66aba28acb25a9478a8e93cfba87c52b15729dad2da2e5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page