From f6505d9a0170c262c54269071aa3b19f08889660 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 26 Feb 2026 05:55:17 +0545 Subject: [PATCH] feat(utils): add set_process_name utility and adjust imports New Features - Added `set_process_name` function to set the process name via `prctl`. Enhancements - Replaced `loguru` logger import with `fabric.utils.logger` and removed the unused dependency. - Added explicit imports of `ctypes`, `html`, and `json` for clarity and future use. Bug Fixes - No bug fixes included in this change. --- utils/functions.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/functions.py b/utils/functions.py index 7226ca9..ac1b847 100644 --- a/utils/functions.py +++ b/utils/functions.py @@ -1,10 +1,17 @@ +import ctypes import html import json -import os import threading from typing import Dict, List, Optional -from loguru import logger +from fabric.utils import logger, os + + +# Function to set the process name +def set_process_name(name: str): + libc = ctypes.CDLL("libc.so.6") + libc.prctl(15, name.encode("utf-8"), 0, 0, 0) + # Threading helper functions