XMMS2
thread_name_prctl.c
Go to the documentation of this file.
1/* XMMS2 - X Music Multiplexer System
2 * Copyright (C) 2003-2011 XMMS2 Team
3 *
4 * PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 */
16
17#include <sys/prctl.h>
18#include <string.h>
19
21#include "xmms/xmms_log.h"
22
23
24void
25xmms_set_thread_name (const gchar *name)
26{
27 g_return_if_fail (name != NULL && strlen (name) <= 15);
28
29 if (prctl (PR_SET_NAME, (unsigned long) name, 0, 0, 0) != 0) {
30 xmms_log_error ("Could not set thread name: %s", name);
31 }
32}
void xmms_set_thread_name(const gchar *name)
#define xmms_log_error(fmt,...)
Definition: xmms_log.h:35