Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   On kill and Raspbian (http://angband.oook.cz/forum/showthread.php?t=8860)

konijn_ March 22, 2018 18:29

On kill and Raspbian
 
Greetings,

Hellband will compile on Raspbian, but it throws a warning on

Code:

files.c:4633:8: warning: implicit declaration of function �kill’ [-Wimplicit-function-declaration]
  (void)kill(0, SIGSTOP);

I thought to solve this with typecasting the parameters since forcing zero into a structure seems arcane, but still had the exact same warning
Code:

  (void)kill((pid_t)0, (int)SIGSTOP);
I checked the man page, and I do have the proper include.
So then I went to read signals.h and found the following
Code:

/* Send signal SIG to process number PID.  If PID is zero,
  send SIG to all processes in the current process's process group.
  If PID is < -1, send SIG to all processes in process group - PID.  */
#ifdef __USE_POSIX
extern int kill (__pid_t __pid, int __sig) __THROW;
#endif /* Use POSIX.  */

There is no reference to POSIX anywhere in hellband header files, so what do I do? Just add the __USE_POSIX flag to the makefile for Raspbian? Am I missing something?

I dont run in to this at all when compiling for Ternux.

Gwarl April 1, 2018 16:08

I can't answer this directly, but I can attempt to provide some oblique answers.

Hellband as a Cthangband fork has some opinionated alterations to system-level stuff, I believe cthangband was designed to be run primarily on windows machines. If you get a reference copy of unaltered angband (probably the version cthang forked from, I'd guess a 2.8 or 2.9) all the system level stuff will be exhaustively commented on and there will be a __USE_POSIX flag somewhere I'm pretty sure. I know I've seen them in some variants.

Possibly related, possibly unrelated, occasionally on live the hellband process don't respond to the kill signal and I have to reptyr them. This happened a few times one day but I'm not sure what or why is the problem, I think it was in-game crashes on that day.

t4nk April 1, 2018 19:47

Quote:

Originally Posted by konijn_ (Post 128675)
Greetings,

Code:

files.c:4633:8: warning: implicit declaration of function �kill’ [-Wimplicit-function-declaration]
  (void)kill(0, SIGSTOP);

I thought to solve this with typecasting the parameters since forcing zero into a structure seems arcane

It just complains about missing prototype for kill(). pid_t is not a structure, it's an int.
Anyway, you probably just need to define _GNU_SOURCE before including Unix headers. See features.h and the man page for feature_test_macros.


All times are GMT +1. The time now is 19:29.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.