lib: Add "pid/unique" format for server_id_from_string
[Samba.git] / lib / util / util_process.c
blobbde6060597eae5ae96d22414a80b490aa2db962f
1 /*
2 * Unix SMB/CIFS implementation.
4 * Process utils.
6 * Copyright (c) 2013 Andreas Schneider <asn@samba.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 #include "util_process.h"
23 #include "config.h"
25 #ifdef HAVE_SYS_PRCTL_H
26 #include <sys/prctl.h>
27 #endif
29 int prctl_set_comment(const char *comment)
31 #if defined(HAVE_PRCTL) && defined(PR_SET_NAME)
32 return prctl(PR_SET_NAME, (unsigned long) comment, 0, 0, 0);
33 #endif
34 return 0;