1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/glue/ProcessUtils_bsd.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "ProcessUtils.h" 1.9 + 1.10 +#include <pthread.h> 1.11 + 1.12 +#if !defined(OS_NETBSD) 1.13 +#include <pthread_np.h> 1.14 +#endif 1.15 + 1.16 +namespace mozilla { 1.17 +namespace ipc { 1.18 + 1.19 +void SetThisProcessName(const char *aName) 1.20 +{ 1.21 +#if defined(OS_NETBSD) 1.22 + pthread_setname_np(pthread_self(), "%s", (void *)aName); 1.23 +#else 1.24 + pthread_set_name_np(pthread_self(), aName); 1.25 +#endif 1.26 +} 1.27 + 1.28 +} // namespace ipc 1.29 +} // namespace mozilla