os/ossrv/genericopenlibs/openenvcore/libc/src/psignal.c
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 #include <signal.h>
    20 #include <stdio.h>
    21 
    22 EXPORT_C void psignal(int sig, const char *s)
    23 	{
    24 	if (sig < 1 || sig >= NSIG)  //What about RT signal(RTMAX)
    25 		{
    26 		if(s)
    27 			fprintf(stderr,"%s: Unknown signal %d\n",s,sig);
    28 		else
    29 			fprintf(stderr,"Unknown signal %d\n",sig);
    30 		}
    31 	else
    32 		{
    33 		if(s)
    34 			fprintf(stderr,"%s: %s\n",s,sys_siglist[sig]);
    35 		else
    36 			fprintf(stderr,"%s\n",sys_siglist[sig]);
    37 		}
    38 	return;
    39 	}