Charles Steaderman charlies at
Fri Apr 11 20:05:10 UTC 2003

Well, I got ping to at least ping  :-) . Unfortunately, I can only do 
one ping at a time (-c 1), since I don't have the signal handling 
implemented. I would appreciate any guidance that could be provided. For 
example, when the SIGALRM signal expires, how do I get the handler 
previously registered with the signal() function?

Here is my wrapper rtems_ping.c file. VERY crude, but I didn't need to 
touch a single line from the OpenBSD ping.c file ;-) . I did need to 
grab the getopt.h file also. I am not sure where it comes from, but 
there is an implementation somewhere and I couldn't find an include file 
for it.

#include <rtems.h>
#include <sys/select.h>
#include "getopt.h"
typedef unsigned long quad_t;
typedef unsigned long in_addr_t;
size_t strlcpy(char *, const char *, size_t); /* safe strcpy */

#define main(argc, argv) rtems_ping(argc, argv)
#define in_cksum(addr, len) rtems_in_cksum(addr, len)
#define seteuid(i)
#define exit(rc)

#define lint
#include "ping.c"

rtems_timer_service_routine itimerhandler(rtems_id timer_id, void 
if(yyy != SIG_IGN)
call yyy;

int setitimer(int which, const struct itimerval *value, struct itimerval 
return 0;

Joel Sherrill wrote:

>If the signals are defined at all to a number then yes.  SIGALARM
>works because alarm() works.  SIGVTALRM and SIGPROF are not defined
>in the rtems part of newlib's sys/signal.h.  Which signal does ping use?
>Eric N and I reworked this set recently for some stuff he needed to 
>support (ncurses?).  Maybe he has thoughts here also.

Charlie Steaderman
charlies at
VP Engineering
Poliac Research Corporation
Phone: 952.707.6245
Cel: 612.242.6364

More information about the users mailing list