您好,登錄后才能下訂單哦!
#include <stdlib.h> #include <stdio.h> #include <sys/resource.h> #include<sys/prctl.h> #include <string.h> int main() { struct rlimit rl; if(getrlimit(RLIMIT_CORE,&rl) != 0){ perror("getrlimit failed"); } printf("RLIMIT_CORE:\n"); printf("cur:%d,max:%d\n\n",rl.rlim_cur,rl.rlim_max); if(prctl(PR_SET_DUMPABLE,1) != 0){ perror("prctl error."); } int a = 0; printf("PR_GET_DUMPABLE:%d\n",prctl(PR_GET_DUMPABLE,&a)); printf("%d\n",a); char pName[16] = {0}; prctl(PR_GET_NAME,pName); printf("pName before: %s\n",pName); strcpy(pName,"Process_t1"); if(prctl(PR_SET_NAME,pName) != 0){ perror("PR_SET_NAME Failed."); } printf("pName after: %s\n",pName); return 0; }
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。