Nmap Development mailing list archives

Re: mmap source compile error on make for macosx 10.9


From: Daniel Miller <bonsaiviking () gmail com>
Date: Wed, 4 Jun 2014 21:37:48 -0500

Brian,

Thank you so much for this bug report! I believe the issue should be
addressed in r32940, but please tell us if Nmap's new signal handling
causes further problems on OS X!

Dan

r32940 | dmiller | 2014-06-05 02:35:06 +0000 (Thu, 05 Jun 2014) | 10 lines

Fix compilation on Mac OS X (and probably other *BSD)

http://seclists.org/nmap-dev/2014/q2/404

Introduced in r32873, which failed to include signal.h for sigaction and
friends. Doesn't break Linux because sys/wait.h is included. POSIX
(http://pubs.opengroup.org/onlinepubs/007904975/basedefs/sys/wait.h.html)
says "Inclusion of the <sys/wait.h> header *may* also make visible all
symbols from <signal.h> and <sys/resource.h>." (emphasis mine.)

Index: nmap_tty.cc
===================================================================
--- nmap_tty.cc    (revision 32939)
+++ nmap_tty.cc    (revision 32940)
@@ -163,7 +163,8 @@
         FlushConsoleInputBuffer(stdinput);
 }

-#else
+#else  //!win32
+#include <signal.h>
 #if !defined(O_NONBLOCK) && defined(O_NDELAY)
 #define O_NONBLOCK            O_NDELAY
 #endif



On Wed, Jun 4, 2014 at 8:07 PM, Brian Taylor <ontodevelop () me com> wrote:

Applications/Xcode.app/Contents/Developer/usr/bin/make nmap build-zenmap
build-ndiff build-nping
g++ -c -I./liblinear -I./liblua -I./libdnet-stripped/include -I./libpcre
-I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\"
-DNMAP_URL=\"http://nmap.org\";
-DNMAP_PLATFORM=\"x86_64-apple-darwin13.2.0\"
-DNMAPDATADIR=\"/usr/local/share/nmap\" -D_FORTIFY_SOURCE=2 -no-cpp-precomp
-g -O2 -Wall -fno-strict-aliasing nmap_tty.cc -o nmap_tty.o
nmap_tty.cc:234:9: error: use of undeclared identifier 'sigfillset'
sigfillset(&sa.sa_mask); /* block all signals during handler exe...
^
nmap_tty.cc:236:9: error: no matching constructor for initialization of
'sigaction'
sigaction(signo, &sa, NULL);
^ ~~~~~~~~~~~~~~~~
/usr/include/sys/signal.h:283:8: note: candidate constructor (the implicit
default constructor) not viable: requires 0 arguments, but 3 were provided
struct sigaction {
^
/usr/include/sys/signal.h:283:8: note: candidate constructor (the implicit
copy
constructor) not viable: requires 1 argument, but 3 were provided
nmap_tty.cc:248:9: error: use of undeclared identifier 'sigemptyset'
sigemptyset(&set);
^
nmap_tty.cc:249:9: error: use of undeclared identifier 'sigaddset'
sigaddset(&set, signo);
^
nmap_tty.cc:250:9: error: use of undeclared identifier 'sigprocmask'
sigprocmask(SIG_UNBLOCK, &set, NULL);
^
nmap_tty.cc:251:9: error: use of undeclared identifier 'raise'
raise(signo); /* This should kill us /
^
6 errors generated.
make[1]: ** [nmap_tty.o] Error 1
make: *** [all] Error 2
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: