]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/psignal.c
SourceFormat Enforcement
[thirdparty/squid.git] / compat / psignal.c
CommitLineData
2ccf2eb2 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
37be9888
AJ
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
2ccf2eb2 7 */
37be9888 8
f7f3304a 9#include "squid.h"
2ccf2eb2
AJ
10#include "psignal.h"
11
6b7b32cd 12#if _SQUID_AIX_ || _SQUID_ANDROID_ || _SQUID_MINGW_
2ccf2eb2
AJ
13extern const char* const sys_siglist[];
14#define _sys_nsig 64
15#define _sys_siglist sys_siglist
16#endif
17
18/// purpose: print message, colon, space, signal name and LF.
19/// paramtr: sig (IN): signal number
20/// msg (IN): message to prepend
21void
22psignal( int sig, const char* msg )
23{
24 if ( msg && *msg ) fprintf( stderr, "%s: ", msg );
25 if ( sig > 0 && sig < _sys_nsig )
26 fprintf( stderr, "%s\n", _sys_siglist[sig] );
27 else
28 fputs( "(unknown)\n", stderr );
29}
f53969cc 30