pyldb: avoid segfault when adding an element with no name
[sfrench/samba-autobuild/.git] / lib / util / util_process.c
1 /*
2  *  Unix SMB/CIFS implementation.
3  *
4  *  Process utils.
5  *
6  *  Copyright (c) 2013      Andreas Schneider <asn@samba.org>
7  *
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.
12  *
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.
17  *
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/>.
20  */
21
22 #include "util_process.h"
23 #include "config.h"
24
25 #ifdef HAVE_SYS_PRCTL_H
26 #include <sys/prctl.h>
27 #endif
28
29 int prctl_set_comment(const char *comment)
30 {
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;
35 }