summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct3
-rw-r--r--src/mongo/base/parse_number_test.cpp2
-rw-r--r--src/mongo/db/repl/isself.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/dur.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp4
-rw-r--r--src/mongo/db/storage/storage_engine_lock_file_posix.cpp8
-rw-r--r--src/mongo/platform/backtrace.cpp4
-rw-r--r--src/mongo/platform/backtrace.h2
-rw-r--r--src/mongo/platform/posix_fadvise.cpp4
-rw-r--r--src/mongo/platform/posix_fadvise.h2
-rw-r--r--src/mongo/platform/random.cpp4
-rw-r--r--src/mongo/platform/strcasestr.cpp16
-rw-r--r--src/mongo/platform/strcasestr.h2
-rw-r--r--src/mongo/util/file_allocator.cpp8
-rw-r--r--src/mongo/util/mmap_posix.cpp6
-rw-r--r--src/mongo/util/net/listen.cpp4
-rw-r--r--src/mongo/util/net/message_port.cpp2
-rw-r--r--src/mongo/util/net/sock.cpp2
-rw-r--r--src/mongo/util/net/sock.h2
-rw-r--r--src/mongo/util/options_parser/options_parser_test.cpp12
-rw-r--r--src/mongo/util/time_support.cpp2
-rw-r--r--src/third_party/pcre-8.30/config.h2
-rw-r--r--src/third_party/s2/base/definer.h2
-rw-r--r--src/third_party/s2/base/port.h10
24 files changed, 53 insertions, 56 deletions
diff --git a/SConstruct b/SConstruct
index 1456ac071f5..d9e6bb2aaec 100644
--- a/SConstruct
+++ b/SConstruct
@@ -927,20 +927,17 @@ elif linux:
env.Append( LINKFLAGS=" -static " )
elif solaris:
- env.Append( CPPDEFINES=[ "__sunos__" ] )
env.Append( LIBS=["socket","resolv","lgrp"] )
elif freebsd:
env.Append( LIBS=[ "kvm" ] )
env.Append( EXTRACPPPATH=[ "/usr/local/include" ] )
env.Append( EXTRALIBPATH=[ "/usr/local/lib" ] )
- env.Append( CPPDEFINES=[ "__freebsd__" ] )
env.Append( CCFLAGS=[ "-fno-omit-frame-pointer" ] )
elif openbsd:
env.Append( EXTRACPPPATH=[ "/usr/local/include" ] )
env.Append( EXTRALIBPATH=[ "/usr/local/lib" ] )
- env.Append( CPPDEFINES=[ "__openbsd__" ] )
env.Append( LIBS=[ "kvm" ] )
elif windows:
diff --git a/src/mongo/base/parse_number_test.cpp b/src/mongo/base/parse_number_test.cpp
index 3f30448d26d..952e1cc3866 100644
--- a/src/mongo/base/parse_number_test.cpp
+++ b/src/mongo/base/parse_number_test.cpp
@@ -297,7 +297,7 @@ namespace {
ASSERT_PARSES(double, "12e-8", 12e-8);
ASSERT_PARSES(double, "-485.381e-8", -485.381e-8);
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// Parse hexadecimal representations of a double. Hex literals not supported by MSVC, and
// not parseable by the Windows SDK libc or the Solaris libc in the mode we build.
// See SERVER-14131.
diff --git a/src/mongo/db/repl/isself.cpp b/src/mongo/db/repl/isself.cpp
index 423d3025a1e..4746ff01a28 100644
--- a/src/mongo/db/repl/isself.cpp
+++ b/src/mongo/db/repl/isself.cpp
@@ -47,7 +47,7 @@
#include "mongo/util/scopeguard.h"
#include "mongo/util/log.h"
-#if defined(__linux__) || defined(__APPLE__) || defined(__freebsd__) || defined(__sunos__) || defined(__openbsd__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__)
#define FASTPATH_UNIX 1
#endif
@@ -60,7 +60,7 @@
#include <ifaddrs.h>
#include <netdb.h>
-#ifdef __freebsd__
+#ifdef __FreeBSD__
#include <netinet/in.h>
#endif
diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp
index 09a3c995acf..dd7391b350d 100644
--- a/src/mongo/db/storage/mmap_v1/dur.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur.cpp
@@ -325,7 +325,7 @@ namespace {
// See SERVER-5723 for performance improvement.
// See SERVER-5680 to see why this code is necessary on Windows.
// See SERVER-8795 to see why this code is necessary on Solaris.
-#if defined(_WIN32) || defined(__sunos__)
+#if defined(_WIN32) || defined(__sun)
LockMongoFilesExclusive lk;
#else
LockMongoFilesShared lk;
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
index 29119c7116d..f84f7810bc3 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
@@ -61,7 +61,7 @@ namespace mongo {
namespace {
-#if !defined(__sunos__)
+#if !defined(__sun)
// if doingRepair is true don't consider unclean shutdown an error
void acquirePathLock(MMAPV1Engine* storageEngine,
bool doingRepair,
@@ -153,7 +153,7 @@ namespace {
uasserted(13618, "can't start without --journal enabled when journal/ files are present");
}
}
-#endif // !defined(__sunos__)
+#endif // !defined(__sun)
/// warn if readahead > 256KB (gridfs chunk size)
diff --git a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp
index c37990e3c12..93227bbaf9a 100644
--- a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp
+++ b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp
@@ -102,14 +102,14 @@ namespace {
<< _filespec << ' ' << errnoWithDescription(errorcode)
<< " Is a mongod instance already running?");
}
-#if !defined(__sunos__)
+#if !defined(__sun)
int ret = ::flock(lockFile, LOCK_EX | LOCK_NB);
#else
struct flock fileLockInfo = {0};
fileLockInfo.l_type = F_WRLCK;
fileLockInfo.l_whence = SEEK_SET;
int ret = ::fcntl(lockFile, F_SETLK, &fileLockInfo);
-#endif // !defined(__sunos__)
+#endif // !defined(__sun)
if (ret != 0) {
int errorcode = errno;
::close(lockFile);
@@ -179,14 +179,14 @@ namespace {
int errorcode = errno;
log() << "couldn't remove fs lock " << errnoWithDescription(errorcode);
}
-#if !defined(__sunos__)
+#if !defined(__sun)
::flock(_lockFileHandle->_fd, LOCK_UN);
#else
struct flock fileLockInfo = {0};
fileLockInfo.l_type = F_UNLCK;
fileLockInfo.l_whence = SEEK_SET;
::fcntl(_lockFileHandle->_fd, F_SETLK, &fileLockInfo);
-#endif // !defined(__sunos__)
+#endif // !defined(__sun)
}
} // namespace mongo
diff --git a/src/mongo/platform/backtrace.cpp b/src/mongo/platform/backtrace.cpp
index 431a9bf1bd9..e8efed8191d 100644
--- a/src/mongo/platform/backtrace.cpp
+++ b/src/mongo/platform/backtrace.cpp
@@ -26,7 +26,7 @@
*/
#if !defined(_WIN32)
-#if defined(__sunos__) || !defined(MONGO_HAVE_EXECINFO_BACKTRACE)
+#if defined(__sun) || !defined(MONGO_HAVE_EXECINFO_BACKTRACE)
#include "mongo/platform/backtrace.h"
@@ -223,5 +223,5 @@ namespace {
} // namespace mongo
-#endif // #if defined(__sunos__)
+#endif // #if defined(__sun)
#endif // #if !defined(_WIN32)
diff --git a/src/mongo/platform/backtrace.h b/src/mongo/platform/backtrace.h
index fd29622982f..ddb695b2ba8 100644
--- a/src/mongo/platform/backtrace.h
+++ b/src/mongo/platform/backtrace.h
@@ -28,7 +28,7 @@
#pragma once
#if !defined(_WIN32)
-#if defined(__sunos__) || !defined(MONGO_HAVE_EXECINFO_BACKTRACE)
+#if defined(__sun) || !defined(MONGO_HAVE_EXECINFO_BACKTRACE)
namespace mongo {
namespace pal {
diff --git a/src/mongo/platform/posix_fadvise.cpp b/src/mongo/platform/posix_fadvise.cpp
index 11079eb8fb8..b7787c55b0a 100644
--- a/src/mongo/platform/posix_fadvise.cpp
+++ b/src/mongo/platform/posix_fadvise.cpp
@@ -25,7 +25,7 @@
* then also delete it in the license file.
*/
-#if defined(__sunos__)
+#if defined(__sun)
#include "mongo/platform/posix_fadvise.h"
@@ -65,4 +65,4 @@ namespace pal {
} // namespace mongo
-#endif // #if defined(__sunos__)
+#endif // #if defined(__sun)
diff --git a/src/mongo/platform/posix_fadvise.h b/src/mongo/platform/posix_fadvise.h
index c266562541c..dc0a539c6c9 100644
--- a/src/mongo/platform/posix_fadvise.h
+++ b/src/mongo/platform/posix_fadvise.h
@@ -31,7 +31,7 @@
#include <fcntl.h>
-#if defined(__sunos__)
+#if defined(__sun)
#include <sys/types.h>
diff --git a/src/mongo/platform/random.cpp b/src/mongo/platform/random.cpp
index e00fab107ca..dcbd6f66ffc 100644
--- a/src/mongo/platform/random.cpp
+++ b/src/mongo/platform/random.cpp
@@ -117,7 +117,7 @@ namespace mongo {
return new WinSecureRandom();
}
-#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__freebsd__)
+#elif defined(__linux__) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__)
class InputStreamSecureRandom : public SecureRandom {
public:
@@ -150,7 +150,7 @@ namespace mongo {
return new InputStreamSecureRandom( "/dev/urandom" );
}
-#elif defined(__openbsd__)
+#elif defined(__OpenBSD__)
class Arc4SecureRandom : public SecureRandom {
public:
diff --git a/src/mongo/platform/strcasestr.cpp b/src/mongo/platform/strcasestr.cpp
index 7de541d5a03..2f91386b8e5 100644
--- a/src/mongo/platform/strcasestr.cpp
+++ b/src/mongo/platform/strcasestr.cpp
@@ -27,21 +27,21 @@
#include "mongo/platform/strcasestr.h"
-#if defined(__sunos__)
+#if defined(__sun)
#include <dlfcn.h>
#include "mongo/base/init.h"
#include "mongo/base/status.h"
#endif
-#if defined(_WIN32) || defined(__sunos__)
+#if defined(_WIN32) || defined(__sun)
#include <algorithm>
#include <cctype>
#include <cstring>
#include <string>
-#if defined(__sunos__)
+#if defined(__sun)
#define STRCASESTR_EMULATION_NAME strcasestr_emulation
#else
#define STRCASESTR_EMULATION_NAME strcasestr
@@ -79,7 +79,7 @@ namespace pal {
return location ? (haystack + (location - haystackLowerStart)) : NULL;
}
-#if defined(__sunos__)
+#if defined(__sun)
typedef const char* (*StrCaseStrFunc)(const char* haystack, const char* needle);
static StrCaseStrFunc strcasestr_switcher = mongo::pal::strcasestr_emulation;
@@ -88,14 +88,14 @@ namespace pal {
return strcasestr_switcher(haystack, needle);
}
-#endif // #if defined(__sunos__)
+#endif // #if defined(__sun)
} // namespace pal
} // namespace mongo
-#endif // #if defined(_WIN32) || defined(__sunos__)
+#endif // #if defined(_WIN32) || defined(__sun)
-#if defined(__sunos__)
+#if defined(__sun)
namespace mongo {
@@ -114,4 +114,4 @@ namespace mongo {
} // namespace mongo
-#endif // __sunos__
+#endif // __sun
diff --git a/src/mongo/platform/strcasestr.h b/src/mongo/platform/strcasestr.h
index 7ce2b1b3653..cdc2564c21e 100644
--- a/src/mongo/platform/strcasestr.h
+++ b/src/mongo/platform/strcasestr.h
@@ -27,7 +27,7 @@
#pragma once
-#if defined(_WIN32) || defined(__sunos__)
+#if defined(_WIN32) || defined(__sun)
namespace mongo {
namespace pal {
diff --git a/src/mongo/util/file_allocator.cpp b/src/mongo/util/file_allocator.cpp
index 2adbba1a020..cf60e1cdadb 100644
--- a/src/mongo/util/file_allocator.cpp
+++ b/src/mongo/util/file_allocator.cpp
@@ -38,7 +38,7 @@
#include <errno.h>
#include <fcntl.h>
-#if defined(__freebsd__)
+#if defined(__FreeBSD__)
# include <sys/param.h>
# include <sys/mount.h>
#endif
@@ -182,7 +182,7 @@ namespace mongo {
// TODO: pull this out to per-OS files once they exist
static bool useSparseFiles(int fd) {
-#if defined(__linux__) || defined(__freebsd__)
+#if defined(__linux__) || defined(__FreeBSD__)
struct statfs fs_stats;
int ret = fstatfs(fd, &fs_stats);
uassert(16062, "fstatfs failed: " + errnoWithDescription(), ret == 0);
@@ -197,13 +197,13 @@ namespace mongo {
|| (fs_stats.f_type == TMPFS_MAGIC)
;
-#elif defined(__freebsd__)
+#elif defined(__FreeBSD__)
return (str::equals(fs_stats.f_fstypename, "zfs") ||
str::equals(fs_stats.f_fstypename, "nfs") ||
str::equals(fs_stats.f_fstypename, "oldnfs"));
-#elif defined(__sunos__)
+#elif defined(__sun)
// assume using ZFS which is copy-on-write so no benefit to zero-filling
// TODO: check which fs we are using like we do elsewhere
return true;
diff --git a/src/mongo/util/mmap_posix.cpp b/src/mongo/util/mmap_posix.cpp
index 6236962a9d8..0c55cde7547 100644
--- a/src/mongo/util/mmap_posix.cpp
+++ b/src/mongo/util/mmap_posix.cpp
@@ -124,7 +124,7 @@ namespace mongo {
} pageAlignTest;
}
-#if defined(__sunos__)
+#if defined(__sun)
MAdvise::MAdvise(void *,unsigned, Advice) { }
MAdvise::~MAdvise() { }
#else
@@ -187,7 +187,7 @@ namespace mongo {
}
-#if defined(__sunos__)
+#if defined(__sun)
#warning madvise not supported on solaris yet
#else
if ( options & SEQUENTIAL ) {
@@ -238,7 +238,7 @@ namespace mongo {
}
void* MemoryMappedFile::remapPrivateView(void *oldPrivateAddr) {
-#if defined(__sunos__) // SERVER-8795
+#if defined(__sun) // SERVER-8795
LockMongoFilesExclusive lockMongoFiles;
#endif
diff --git a/src/mongo/util/net/listen.cpp b/src/mongo/util/net/listen.cpp
index d15161645ac..f260573039e 100644
--- a/src/mongo/util/net/listen.cpp
+++ b/src/mongo/util/net/listen.cpp
@@ -47,7 +47,7 @@
#ifndef _WIN32
-# ifndef __sunos__
+# ifndef __sun
# include <ifaddrs.h>
# endif
# include <sys/resource.h>
@@ -61,7 +61,7 @@
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
-#ifdef __openbsd__
+#ifdef __OpenBSD__
# include <sys/uio.h>
#endif
diff --git a/src/mongo/util/net/message_port.cpp b/src/mongo/util/net/message_port.cpp
index 2748c61fa67..1ab8355dc05 100644
--- a/src/mongo/util/net/message_port.cpp
+++ b/src/mongo/util/net/message_port.cpp
@@ -48,7 +48,7 @@
#include "mongo/util/time_support.h"
#ifndef _WIN32
-# ifndef __sunos__
+# ifndef __sun
# include <ifaddrs.h>
# endif
# include <sys/resource.h>
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp
index 48296a83cef..88b73e1eea0 100644
--- a/src/mongo/util/net/sock.cpp
+++ b/src/mongo/util/net/sock.cpp
@@ -42,7 +42,7 @@
# include <arpa/inet.h>
# include <errno.h>
# include <netdb.h>
-# if defined(__openbsd__)
+# if defined(__OpenBSD__)
# include <sys/uio.h>
# endif
#endif
diff --git a/src/mongo/util/net/sock.h b/src/mongo/util/net/sock.h
index c86729b5471..43221338bf2 100644
--- a/src/mongo/util/net/sock.h
+++ b/src/mongo/util/net/sock.h
@@ -38,7 +38,7 @@
#include <sys/un.h>
#include <errno.h>
-#ifdef __openbsd__
+#ifdef __OpenBSD__
# include <sys/uio.h>
#endif
diff --git a/src/mongo/util/options_parser/options_parser_test.cpp b/src/mongo/util/options_parser/options_parser_test.cpp
index cde7f4b2896..e8de6d1e25e 100644
--- a/src/mongo/util/options_parser/options_parser_test.cpp
+++ b/src/mongo/util/options_parser/options_parser_test.cpp
@@ -4166,7 +4166,7 @@ namespace {
// Hex values
argv = std::vector<std::string>();
argv.push_back("binaryname");
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// Hex doubles are not parseable by the Windows SDK libc or the Solaris libc in the mode we
// build, so we cannot read hex doubles from the command line on those platforms.
// See SERVER-14131.
@@ -4185,7 +4185,7 @@ namespace {
environment = moe::Environment();
ASSERT_OK(parser.run(testOpts, argv, env_map, &environment));
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// See SERVER-14131.
ASSERT_OK(environment.get(moe::Key("doubleVal"), &value));
ASSERT_OK(value.get(&doubleVal));
@@ -4317,7 +4317,7 @@ namespace {
argv.push_back("binaryname");
argv.push_back("--config");
argv.push_back("config.ini");
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// Hex doubles are not parseable by the Windows SDK libc or the Solaris libc in the mode we
// build, so we cannot read hex doubles from a config file on those platforms.
// See SERVER-14131.
@@ -4331,7 +4331,7 @@ namespace {
environment = moe::Environment();
ASSERT_OK(parser.run(testOpts, argv, env_map, &environment));
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// See SERVER-14131.
ASSERT_OK(environment.get(moe::Key("doubleVal"), &value));
ASSERT_OK(value.get(&doubleVal));
@@ -4463,7 +4463,7 @@ namespace {
argv.push_back("binaryname");
argv.push_back("--config");
argv.push_back("config.yaml");
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// Hex doubles are not parseable by the Windows SDK libc or the Solaris libc in the mode we
// build, so we cannot read hex doubles from a config file on those platforms.
// See SERVER-14131.
@@ -4477,7 +4477,7 @@ namespace {
environment = moe::Environment();
ASSERT_OK(parser.run(testOpts, argv, env_map, &environment));
-#if !(defined(_WIN32) || defined(__sunos__))
+#if !(defined(_WIN32) || defined(__sun))
// See SERVER-14131.
ASSERT_OK(environment.get(moe::Key("doubleVal"), &value));
ASSERT_OK(value.get(&doubleVal));
diff --git a/src/mongo/util/time_support.cpp b/src/mongo/util/time_support.cpp
index 0a06af6cc0c..69369582058 100644
--- a/src/mongo/util/time_support.cpp
+++ b/src/mongo/util/time_support.cpp
@@ -55,7 +55,7 @@
#endif
#endif
-#ifdef __sunos__
+#ifdef __sun
// Some versions of Solaris do not have timegm defined, so fall back to our implementation when
// building on Solaris. See SERVER-13446.
extern "C" time_t
diff --git a/src/third_party/pcre-8.30/config.h b/src/third_party/pcre-8.30/config.h
index 182c5f9a0f5..41d8c3c5e28 100644
--- a/src/third_party/pcre-8.30/config.h
+++ b/src/third_party/pcre-8.30/config.h
@@ -189,7 +189,7 @@ them both to 0; an emulation function will be used. */
--disable-stack-for-recursion). */
/* #undef NO_RECURSE */
/* mongodb: don't recurse, don't want to use much stack or blow stack */
-#ifndef __sunos__
+#ifndef __sun
/* TODO this doesn't compile on sunos?? */
#define NO_RECURSE 1
#endif
diff --git a/src/third_party/s2/base/definer.h b/src/third_party/s2/base/definer.h
index a99f7c05ed0..f3a3eaf013b 100644
--- a/src/third_party/s2/base/definer.h
+++ b/src/third_party/s2/base/definer.h
@@ -7,7 +7,7 @@
# define OS_LINUX
#elif defined _WIN32
# define OS_WINDOWS
-#elif defined __freebsd__ || defined __openbsd__
+#elif defined __FreeBSD__ || defined __OpenBSD__
# define OS_FREEBSD
#endif
diff --git a/src/third_party/s2/base/port.h b/src/third_party/s2/base/port.h
index 92f2d7b876d..25d3d2fcf3c 100644
--- a/src/third_party/s2/base/port.h
+++ b/src/third_party/s2/base/port.h
@@ -102,7 +102,7 @@ typedef uint16_t u_int16_t;
#endif
-#if defined __sunos__ || defined __freebsd__ || defined __openbsd__
+#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__
#ifdef _LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN
#elif defined _BIG_ENDIAN
@@ -124,17 +124,17 @@ typedef uint16_t u_int16_t;
#define bswap_16(x) OSSwapInt16(x)
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)
-#elif defined __sunos__
+#elif defined __sun
#include <sys/byteorder.h>
#define bswap_16(x) BSWAP_16(x)
#define bswap_32(x) BSWAP_32(x)
#define bswap_64(x) BSWAP_64(x)
-#elif defined __freebsd__
+#elif defined __FreeBSD__
#include <sys/endian.h>
#define bswap_16(x) bswap16(x)
#define bswap_32(x) bswap32(x)
#define bswap_64(x) bswap64(x)
-#elif defined __openbsd__
+#elif defined __OpenBSD__
#include <sys/endian.h>
#define bswap_16(x) swap16(x)
#define bswap_32(x) swap32(x)
@@ -685,7 +685,7 @@ extern inline void prefetch(const char *x) {}
#endif // !HAVE_ATTRIBUTE_SECTION
-#if defined __sunos__ || defined _WIN32
+#if defined __sun || defined _WIN32
inline double drem(double x, double y) {
double quot = x/y;
int iquot;