passenger 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +33 -1
- data/CONTRIBUTING.md +7 -311
- data/CONTRIBUTORS +1 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/bin/passenger +1 -1
- data/bin/passenger-config +1 -1
- data/bin/passenger-install-apache2-module +1 -1
- data/bin/passenger-install-nginx-module +4 -9
- data/bin/passenger-memory-stats +1 -1
- data/bin/passenger-status +1 -1
- data/build/agent.rb +13 -15
- data/build/apache2.rb +13 -16
- data/build/basics.rb +10 -13
- data/build/common_library.rb +5 -9
- data/build/cxx_tests.rb +37 -12
- data/build/integration_tests.rb +5 -2
- data/build/misc.rb +1 -1
- data/build/nginx.rb +1 -1
- data/build/node_tests.rb +1 -1
- data/build/oxt_tests.rb +6 -8
- data/build/packaging.rb +1 -1
- data/build/ruby_extension.rb +1 -1
- data/build/ruby_tests.rb +1 -1
- data/build/schema_printer.rb +13 -15
- data/build/support/cplusplus.rb +61 -69
- data/build/support/cxx_dependency_map.rb +2 -1
- data/build/support/general.rb +1 -1
- data/build/support/vendor/cxx_hinted_parser/LICENSE.md +1 -1
- data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +1 -1
- data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser.rb +1 -1
- data/build/support/vendor/cxxcodebuilder/LICENSE.md +1 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +1 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/initializer_builder.rb +1 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder.rb +1 -1
- data/build/test_basics.rb +1 -1
- data/dev/copy_boost_headers +1 -1
- data/dev/index_cxx_dependencies.rb +5 -1
- data/dev/libev-changes.patch +108 -0
- data/dev/nginx_version_sha256 +1 -1
- data/dev/ruby_server.rb +1 -6
- data/dev/upgrading_libuv.sh +16 -0
- data/doc/BasicArchitectureOverview.md +55 -0
- data/doc/BuildCaching.md +23 -0
- data/doc/BuildSystem.md +49 -0
- data/doc/DebuggingAndStressTesting.md +2 -0
- data/doc/DesignAspects/LimitedGemDependencies.md +1 -0
- data/doc/DevEnvironmentSetup.md +46 -0
- data/doc/DevHandbook.md +28 -0
- data/doc/Packaging.md +1 -1
- data/doc/RunningTests.md +88 -0
- data/doc/{TempFileHandling.md → SecureTempFileHandling.md} +1 -1
- data/doc/{CxxTestingGuide.md → WritingCxxTests.md} +1 -20
- data/src/agent/AgentMain.cpp +1 -1
- data/src/agent/Core/ApiServer.h +1 -1
- data/src/agent/Core/ApplicationPool/AbstractSession.h +1 -1
- data/src/agent/Core/ApplicationPool/BasicGroupInfo.h +1 -1
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +1 -1
- data/src/agent/Core/ApplicationPool/Common.h +1 -1
- data/src/agent/Core/ApplicationPool/Context.h +1 -1
- data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/Verification.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group.h +1 -1
- data/src/agent/Core/ApplicationPool/Implementation.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Options.h +1 -1
- data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool.h +1 -1
- data/src/agent/Core/ApplicationPool/Process.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Process.h +1 -1
- data/src/agent/Core/ApplicationPool/Session.h +1 -1
- data/src/agent/Core/ApplicationPool/Socket.h +1 -1
- data/src/agent/Core/ApplicationPool/TestSession.h +1 -1
- data/src/agent/Core/Config.h +3 -2
- data/src/agent/Core/ConfigChange.cpp +1 -1
- data/src/agent/Core/ConfigChange.h +1 -1
- data/src/agent/Core/Controller/AppResponse.h +1 -1
- data/src/agent/Core/Controller/BufferBody.cpp +1 -1
- data/src/agent/Core/Controller/CheckoutSession.cpp +8 -5
- data/src/agent/Core/Controller/Client.h +1 -1
- data/src/agent/Core/Controller/Config.cpp +1 -1
- data/src/agent/Core/Controller/Config.h +2 -2
- data/src/agent/Core/Controller/ForwardResponse.cpp +2 -2
- data/src/agent/Core/Controller/Hooks.cpp +12 -9
- data/src/agent/Core/Controller/Implementation.cpp +1 -1
- data/src/agent/Core/Controller/InitRequest.cpp +1 -1
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/Controller/InternalUtils.cpp +1 -1
- data/src/agent/Core/Controller/Miscellaneous.cpp +1 -1
- data/src/agent/Core/Controller/Request.h +1 -1
- data/src/agent/Core/Controller/SendRequest.cpp +1 -1
- data/src/agent/Core/Controller/StateInspection.cpp +1 -1
- data/src/agent/Core/Controller/TurboCaching.h +1 -1
- data/src/agent/Core/Controller.h +1 -1
- data/src/agent/Core/CoreMain.cpp +1 -1
- data/src/agent/Core/OptionParser.h +1 -1
- data/src/agent/Core/ResponseCache.h +1 -1
- data/src/agent/Core/SecurityUpdateChecker.h +1 -1
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +1 -1
- data/src/agent/Core/SpawningKit/Config.h +1 -1
- data/src/agent/Core/SpawningKit/Context.h +1 -1
- data/src/agent/Core/SpawningKit/DirectSpawner.h +1 -1
- data/src/agent/Core/SpawningKit/DummySpawner.h +1 -1
- data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
- data/src/agent/Core/SpawningKit/Exceptions.h +63 -2
- data/src/agent/Core/SpawningKit/Factory.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +3 -2
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Session.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
- data/src/agent/Core/SpawningKit/Journey.h +1 -1
- data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
- data/src/agent/Core/SpawningKit/README.md +3 -3
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +1 -1
- data/src/agent/Core/SpawningKit/Result.h +1 -1
- data/src/agent/Core/SpawningKit/SmartSpawner.h +17 -17
- data/src/agent/Core/SpawningKit/Spawner.h +1 -1
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +1 -1
- data/src/agent/Core/TelemetryCollector.h +1 -1
- data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
- data/src/agent/FileReadHelper/FileReadHelperMain.cpp +1 -1
- data/src/agent/MainFunctions.h +1 -1
- data/src/agent/Shared/ApiAccountUtils.h +4 -3
- data/src/agent/Shared/ApiServerUtils.h +1 -2
- data/src/agent/Shared/ApplicationPoolApiKey.h +1 -1
- data/src/agent/Shared/Fundamentals/AbortHandler.cpp +1 -1
- data/src/agent/Shared/Fundamentals/AbortHandler.h +1 -1
- data/src/agent/Shared/Fundamentals/Initialization.cpp +1 -1
- data/src/agent/Shared/Fundamentals/Initialization.h +1 -1
- data/src/agent/Shared/Fundamentals/Utils.cpp +1 -1
- data/src/agent/Shared/Fundamentals/Utils.h +1 -1
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
- data/src/agent/SystemMetrics/SystemMetricsMain.cpp +1 -1
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +1 -1
- data/src/agent/Watchdog/ApiServer.h +7 -6
- data/src/agent/Watchdog/Config.h +2 -2
- data/src/apache2_module/Bucket.cpp +1 -1
- data/src/apache2_module/Bucket.h +1 -1
- data/src/apache2_module/CBindings.cpp +1 -1
- data/src/apache2_module/Config.cpp +1 -1
- data/src/apache2_module/Config.h +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +104 -104
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +2 -2
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/ConfigGeneral/Common.h +1 -1
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +1 -1
- data/src/apache2_module/ConfigGeneral/SetterFuncs.h +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/apache2_module/DirectoryMapper.h +1 -1
- data/src/apache2_module/Hooks.cpp +8 -2
- data/src/apache2_module/Hooks.h +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/apache2_module/Utils.h +1 -1
- data/src/apache2_module/mod_passenger.c +1 -1
- data/src/cxx_supportlib/Algorithms/Hasher.cpp +1 -1
- data/src/cxx_supportlib/Algorithms/Hasher.h +1 -1
- data/src/cxx_supportlib/Algorithms/MovingAverage.h +1 -1
- data/src/cxx_supportlib/AppLocalConfigFileUtils.h +1 -1
- data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +1 -1
- data/src/cxx_supportlib/AppTypeDetector/CBindings.h +1 -1
- data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
- data/src/cxx_supportlib/BackgroundEventLoop.cpp +1 -1
- data/src/cxx_supportlib/BackgroundEventLoop.h +1 -1
- data/src/cxx_supportlib/ConfigKit/AsyncUtils.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Common.h +1 -1
- data/src/cxx_supportlib/ConfigKit/ConfigKit.h +1 -1
- data/src/cxx_supportlib/ConfigKit/DummyTranslator.h +1 -1
- data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +1 -3
- data/src/cxx_supportlib/ConfigKit/PrefixTranslator.h +3 -3
- data/src/cxx_supportlib/ConfigKit/Schema.h +1 -1
- data/src/cxx_supportlib/ConfigKit/SchemaUtils.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
- data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +1 -1
- data/src/cxx_supportlib/ConfigKit/TableTranslator.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Translator.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Utils.h +1 -1
- data/src/cxx_supportlib/Constants.h +2 -2
- data/src/cxx_supportlib/Constants.h.cxxcodebuilder +1 -1
- data/src/cxx_supportlib/DataStructures/HashedStaticString.h +1 -1
- data/src/cxx_supportlib/DataStructures/LString.cpp +1 -1
- data/src/cxx_supportlib/DataStructures/LString.h +1 -1
- data/src/cxx_supportlib/DataStructures/StringKeyTable.h +1 -1
- data/src/cxx_supportlib/DataStructures/StringMap.h +1 -1
- data/src/cxx_supportlib/Exceptions.cpp +1 -1
- data/src/cxx_supportlib/Exceptions.h +1 -1
- data/src/cxx_supportlib/FileDescriptor.h +1 -1
- data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
- data/src/cxx_supportlib/FileTools/FileManip.h +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.h +1 -1
- data/src/cxx_supportlib/FileTools/PathManipCBindings.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManipCBindings.h +1 -1
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.h +1 -1
- data/src/cxx_supportlib/Hooks.h +1 -1
- data/src/cxx_supportlib/IOTools/BufferedIO.h +1 -1
- data/src/cxx_supportlib/IOTools/IOUtils.cpp +10 -10
- data/src/cxx_supportlib/IOTools/IOUtils.h +1 -1
- data/src/cxx_supportlib/IOTools/MessageIO.h +1 -1
- data/src/cxx_supportlib/IOTools/MessageSerialization.h +1 -1
- data/src/cxx_supportlib/InstanceDirectory.h +1 -1
- data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +1 -1
- data/src/cxx_supportlib/JsonTools/Autocast.h +1 -1
- data/src/cxx_supportlib/JsonTools/CBindings.cpp +1 -1
- data/src/cxx_supportlib/JsonTools/CBindings.h +1 -1
- data/src/cxx_supportlib/JsonTools/JsonUtils.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Assert.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Config.h +2 -1
- data/src/cxx_supportlib/LoggingKit/Context.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Forward.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +11 -1
- data/src/cxx_supportlib/LoggingKit/Logging.h +1 -1
- data/src/cxx_supportlib/LoggingKit/LoggingKit.h +1 -1
- data/src/cxx_supportlib/LveLoggingDecorator.h +1 -1
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +1 -1
- data/src/cxx_supportlib/MemoryKit/mbuf.h +1 -1
- data/src/cxx_supportlib/MemoryKit/palloc.cpp +1 -1
- data/src/cxx_supportlib/MemoryKit/palloc.h +1 -1
- data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +1 -1
- data/src/cxx_supportlib/ProcessManagement/Ruby.h +1 -1
- data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +1 -1
- data/src/cxx_supportlib/ProcessManagement/Spawn.h +1 -1
- data/src/cxx_supportlib/ProcessManagement/Utils.cpp +1 -1
- data/src/cxx_supportlib/ProcessManagement/Utils.h +1 -1
- data/src/cxx_supportlib/RandomGenerator.h +1 -1
- data/src/cxx_supportlib/ResourceLocator.h +1 -1
- data/src/cxx_supportlib/SafeLibev.h +1 -1
- data/src/cxx_supportlib/SecurityKit/Crypto.cpp +9 -27
- data/src/cxx_supportlib/SecurityKit/Crypto.h +2 -2
- data/src/cxx_supportlib/SecurityKit/MemZeroGuard.h +1 -1
- data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +1 -1
- data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
- data/src/cxx_supportlib/ServerKit/Client.h +1 -1
- data/src/cxx_supportlib/ServerKit/ClientRef.h +1 -1
- data/src/cxx_supportlib/ServerKit/Config.h +1 -1
- data/src/cxx_supportlib/ServerKit/Context.h +1 -1
- data/src/cxx_supportlib/ServerKit/CookieUtils.h +1 -1
- data/src/cxx_supportlib/ServerKit/Errors.h +1 -1
- data/src/cxx_supportlib/ServerKit/FdSinkChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/FdSourceChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +54 -2
- data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/HeaderTable.h +1 -1
- data/src/cxx_supportlib/ServerKit/Hooks.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParserState.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpClient.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpRequest.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpServer.h +1 -1
- data/src/cxx_supportlib/ServerKit/Implementation.cpp +1 -1
- data/src/cxx_supportlib/ServerKit/Server.h +4 -2
- data/src/cxx_supportlib/StaticString.h +1 -1
- data/src/cxx_supportlib/StrIntTools/DateParsing.h +1 -1
- data/src/cxx_supportlib/StrIntTools/StrIntUtils.cpp +1 -1
- data/src/cxx_supportlib/StrIntTools/StrIntUtils.h +1 -1
- data/src/cxx_supportlib/StrIntTools/StrIntUtilsNoStrictAliasing.cpp +1 -1
- data/src/cxx_supportlib/StrIntTools/StringScanning.h +1 -1
- data/src/cxx_supportlib/StrIntTools/Template.h +1 -1
- data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +1 -1
- data/src/cxx_supportlib/SystemTools/ProcessMetricsCollector.h +1 -1
- data/src/cxx_supportlib/SystemTools/SystemMetricsCollector.h +1 -1
- data/src/cxx_supportlib/SystemTools/SystemTime.cpp +1 -1
- data/src/cxx_supportlib/SystemTools/SystemTime.h +1 -1
- data/src/cxx_supportlib/SystemTools/UserDatabase.cpp +1 -1
- data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
- data/src/cxx_supportlib/Utils/AnsiColorConstants.h +1 -1
- data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +1 -1
- data/src/cxx_supportlib/Utils/BlockingQueue.h +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.cpp +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.h +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.hpp +1 -1
- data/src/cxx_supportlib/Utils/ClassUtils.h +1 -1
- data/src/cxx_supportlib/Utils/Curl.h +1 -1
- data/src/cxx_supportlib/Utils/FastStringStream.h +1 -1
- data/src/cxx_supportlib/Utils/FileChangeChecker.h +1 -1
- data/src/cxx_supportlib/Utils/HttpConstants.h +1 -1
- data/src/cxx_supportlib/Utils/IniFile.h +1 -1
- data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
- data/src/cxx_supportlib/Utils/OptionParsing.h +1 -1
- data/src/cxx_supportlib/Utils/ReleaseableScopedPointer.h +1 -1
- data/src/cxx_supportlib/Utils/ScopeGuard.h +1 -1
- data/src/cxx_supportlib/Utils/SpeedMeter.h +1 -1
- data/src/cxx_supportlib/Utils/Timer.h +1 -1
- data/src/cxx_supportlib/Utils/VariantMap.h +1 -1
- data/src/cxx_supportlib/Utils.cpp +1 -1
- data/src/cxx_supportlib/Utils.h +1 -1
- data/src/cxx_supportlib/WatchdogLauncher.cpp +1 -1
- data/src/cxx_supportlib/WatchdogLauncher.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +1 -1
- data/src/cxx_supportlib/WrapperRegistry/CBindings.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/Entry.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
- data/src/cxx_supportlib/oxt/backtrace.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/backtrace_disabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/backtrace_enabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/context.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/tracable_exception_disabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/tracable_exception_enabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/dynamic_thread_group.hpp +1 -1
- data/src/cxx_supportlib/oxt/implementation.cpp +1 -1
- data/src/cxx_supportlib/oxt/initialize.hpp +1 -1
- data/src/cxx_supportlib/oxt/macros.hpp +1 -1
- data/src/cxx_supportlib/oxt/spin_lock.hpp +1 -1
- data/src/cxx_supportlib/oxt/system_calls.cpp +1 -1
- data/src/cxx_supportlib/oxt/system_calls.hpp +1 -1
- data/src/cxx_supportlib/oxt/thread.hpp +1 -1
- data/src/cxx_supportlib/oxt/tracable_exception.hpp +1 -1
- data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/AUTHORS +353 -3
- data/src/cxx_supportlib/vendor-copy/libuv/ChangeLog +3981 -2
- data/src/cxx_supportlib/vendor-copy/libuv/LICENSE +1 -28
- data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-docs +396 -0
- data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-extra +36 -0
- data/src/cxx_supportlib/vendor-copy/libuv/Makefile.am +275 -58
- data/src/cxx_supportlib/vendor-copy/libuv/Makefile.in +4380 -2125
- data/src/cxx_supportlib/vendor-copy/libuv/aclocal.m4 +425 -221
- data/src/cxx_supportlib/vendor-copy/libuv/ar-lib +30 -10
- data/src/cxx_supportlib/vendor-copy/libuv/compile +31 -14
- data/src/cxx_supportlib/vendor-copy/libuv/config.guess +1084 -690
- data/src/cxx_supportlib/vendor-copy/libuv/config.sub +1844 -1297
- data/src/cxx_supportlib/vendor-copy/libuv/configure +6935 -3664
- data/src/cxx_supportlib/vendor-copy/libuv/configure.ac +43 -19
- data/src/cxx_supportlib/vendor-copy/libuv/depcomp +12 -11
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-darwin.h → uv/darwin.h} +3 -3
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-errno.h → uv/errno.h} +119 -60
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-linux.h → uv/linux.h} +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv/os390.h +33 -0
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv/posix.h +31 -0
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-threadpool.h → uv/threadpool.h} +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/include/{tree.h → uv/tree.h} +3 -250
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-unix.h → uv/unix.h} +186 -60
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-version.h → uv/version.h} +3 -3
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv/win.h +703 -0
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv.h +528 -40
- data/src/cxx_supportlib/vendor-copy/libuv/install-sh +110 -70
- data/src/cxx_supportlib/vendor-copy/libuv/libuv-static.pc.in +12 -0
- data/src/cxx_supportlib/vendor-copy/libuv/libuv.pc.in +4 -2
- data/src/cxx_supportlib/vendor-copy/libuv/ltmain.sh +995 -619
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ax_pthread.m4 +485 -0
- data/src/cxx_supportlib/vendor-copy/libuv/m4/libtool.m4 +438 -289
- data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-flags.m4 +21 -4
- data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-versions.m4 +7 -0
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ltoptions.m4 +69 -39
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ltsugar.m4 +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ltversion.m4 +7 -6
- data/src/cxx_supportlib/vendor-copy/libuv/m4/lt~obsolete.m4 +2 -2
- data/src/cxx_supportlib/vendor-copy/libuv/missing +55 -34
- data/src/cxx_supportlib/vendor-copy/libuv/src/fs-poll.c +52 -20
- data/src/cxx_supportlib/vendor-copy/libuv/src/idna.c +560 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/idna.h +31 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/inet.c +5 -16
- data/src/cxx_supportlib/vendor-copy/libuv/src/queue.h +68 -86
- data/src/cxx_supportlib/vendor-copy/libuv/src/random.c +123 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.c +38 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.h +39 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.c +52 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.h +27 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/thread-common.c +175 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/threadpool.c +172 -57
- data/src/cxx_supportlib/vendor-copy/libuv/src/{unix/timer.c → timer.c} +57 -29
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix-common.c +89 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix.c +418 -256
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/async.c +168 -129
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-ifaddrs.c +163 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-proctitle.c +99 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/core.c +1312 -378
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/cygwin.c +93 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-proctitle.c +18 -32
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-stub.h +97 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-syscalls.h +17 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin.c +41 -139
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/freebsd.c +75 -235
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fs.c +1308 -299
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fsevents.c +150 -148
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getaddrinfo.c +58 -8
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getnameinfo.c +3 -2
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/haiku.c +172 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/hurd.c +172 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/ibmi.c +542 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/internal.h +297 -106
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/kqueue.c +325 -94
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux.c +2708 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop-watcher.c +11 -11
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop.c +105 -24
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/netbsd.c +51 -157
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-fsevents.c +42 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-proctitle.c +45 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/openbsd.c +42 -183
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-proctitle.c +136 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.c +536 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.h +75 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390.c +1070 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pipe.c +324 -55
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/poll.c +58 -11
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-hrtime.c +36 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-poll.c +385 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/process.c +795 -248
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/procfs-exepath.c +45 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/proctitle.c +77 -22
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/qnx.c +142 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-devurandom.c +93 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getentropy.c +57 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getrandom.c +86 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-sysctl-linux.c +99 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/signal.c +147 -39
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/stream.c +426 -474
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sunos.c +240 -98
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-loadavg.c +36 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-memory.c +42 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tcp.c +402 -91
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/thread.c +497 -145
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tty.c +269 -45
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/udp.c +695 -165
- data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.c +463 -61
- data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.h +248 -44
- data/src/cxx_supportlib/vendor-copy/libuv/src/uv-data-getter-setters.c +119 -0
- data/src/cxx_supportlib/vendor-copy/libuv/tsansupp.txt +2 -0
- data/src/cxx_supportlib/vendor-modified/libev/Changes +109 -0
- data/src/cxx_supportlib/vendor-modified/libev/Makefile.am +2 -1
- data/src/cxx_supportlib/vendor-modified/libev/Makefile.in +47 -33
- data/src/cxx_supportlib/vendor-modified/libev/README +2 -1
- data/src/cxx_supportlib/vendor-modified/libev/aclocal.m4 +1653 -1224
- data/src/cxx_supportlib/vendor-modified/libev/config.guess +376 -316
- data/src/cxx_supportlib/vendor-modified/libev/config.h.in +13 -2
- data/src/cxx_supportlib/vendor-modified/libev/config.sub +156 -154
- data/src/cxx_supportlib/vendor-modified/libev/configure +1431 -940
- data/src/cxx_supportlib/vendor-modified/libev/configure.ac +3 -3
- data/src/cxx_supportlib/vendor-modified/libev/depcomp +5 -5
- data/src/cxx_supportlib/vendor-modified/libev/ev++.h +109 -107
- data/src/cxx_supportlib/vendor-modified/libev/ev.c +807 -319
- data/src/cxx_supportlib/vendor-modified/libev/ev.h +111 -105
- data/src/cxx_supportlib/vendor-modified/libev/ev_epoll.c +42 -29
- data/src/cxx_supportlib/vendor-modified/libev/ev_iouring.c +694 -0
- data/src/cxx_supportlib/vendor-modified/libev/ev_kqueue.c +15 -9
- data/src/cxx_supportlib/vendor-modified/libev/ev_linuxaio.c +620 -0
- data/src/cxx_supportlib/vendor-modified/libev/ev_poll.c +19 -14
- data/src/cxx_supportlib/vendor-modified/libev/ev_port.c +8 -5
- data/src/cxx_supportlib/vendor-modified/libev/ev_select.c +6 -6
- data/src/cxx_supportlib/vendor-modified/libev/ev_vars.h +48 -3
- data/src/cxx_supportlib/vendor-modified/libev/ev_win32.c +2 -2
- data/src/cxx_supportlib/vendor-modified/libev/ev_wrap.h +72 -0
- data/src/cxx_supportlib/vendor-modified/libev/install-sh +23 -13
- data/src/cxx_supportlib/vendor-modified/libev/libev.m4 +6 -1
- data/src/cxx_supportlib/vendor-modified/libev/ltmain.sh +3581 -1993
- data/src/cxx_supportlib/vendor-modified/libev/missing +8 -8
- data/src/cxx_supportlib/vendor-modified/libev/mkinstalldirs +3 -3
- data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +1 -1
- data/src/helper-scripts/backtrace-sanitizer.rb +1 -1
- data/src/helper-scripts/crash-watch.rb +1 -1
- data/src/helper-scripts/download_binaries/extconf.rb +1 -1
- data/src/helper-scripts/meteor-loader.rb +1 -1
- data/src/helper-scripts/node-loader.js +1 -1
- data/src/helper-scripts/prespawn +1 -1
- data/src/helper-scripts/rack-loader.rb +1 -1
- data/src/helper-scripts/rack-preloader.rb +1 -1
- data/src/helper-scripts/wsgi-loader.py +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c.cxxcodebuilder +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c.cxxcodebuilder +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c.cxxcodebuilder +1 -1
- data/src/nginx_module/Configuration.c +1 -1
- data/src/nginx_module/Configuration.h +1 -1
- data/src/nginx_module/ContentHandler.c +1 -1
- data/src/nginx_module/ContentHandler.h +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/nginx_module/StaticContentHandler.c +1 -1
- data/src/nginx_module/StaticContentHandler.h +1 -1
- data/src/nginx_module/ngx_http_passenger_module.c +1 -1
- data/src/nginx_module/ngx_http_passenger_module.h +1 -1
- data/src/nodejs_supportlib/phusion_passenger/line_reader.js +1 -1
- data/src/ruby_native_extension/extconf.rb +1 -1
- data/src/ruby_native_extension/passenger_native_support.c +1 -1
- data/src/ruby_supportlib/phusion_passenger/abstract_installer.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +2 -12
- data/src/ruby_supportlib/phusion_passenger/admin_tools.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +8 -10
- data/src/ruby_supportlib/phusion_passenger/config/about_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/build_native_support_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/compile_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/detach_process_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/list_instances_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/main.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +3 -2
- data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +6 -1
- data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/system_metrics_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_channel.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_client.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +4 -3
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +195 -11
- data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/curl.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/pcre.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/zlib.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/plugin.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/public_api.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/out_of_band_gc.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack_handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +2 -7
- data/src/ruby_supportlib/phusion_passenger/request_handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/ruby_core_io_enhancements.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/simple_benchmarking.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/control_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/main.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +4 -8
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/ansi_colors.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/download.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/lock.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/progress_bar.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/strscan.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +3 -13
- data/src/ruby_supportlib/phusion_passenger/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/base.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/version.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb +8 -6
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/spawn.rb +4 -3
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/version.rb +6 -4
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +395 -579
- data/src/ruby_supportlib/phusion_passenger.rb +8 -8
- data/src/schema_printer/SchemaPrinterMain.cpp +1 -1
- data/src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder +1 -1
- metadata +69 -32
- data/doc/DeveloperQuickstart.md +0 -70
- data/src/README.md +0 -7
- data/src/cxx_supportlib/vendor-copy/libuv/README.md +0 -245
- data/src/cxx_supportlib/vendor-copy/libuv/checksparse.sh +0 -234
- data/src/cxx_supportlib/vendor-copy/libuv/common.gypi +0 -210
- data/src/cxx_supportlib/vendor-copy/libuv/gyp_uv.py +0 -93
- data/src/cxx_supportlib/vendor-copy/libuv/include/android-ifaddrs.h +0 -54
- data/src/cxx_supportlib/vendor-copy/libuv/include/pthread-fixes.h +0 -72
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/android-ifaddrs.c +0 -703
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/atomic-ops.h +0 -77
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-core.c +0 -899
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-inotify.c +0 -285
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.c +0 -471
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.h +0 -158
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pthread-fixes.c +0 -104
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/spinlock.h +0 -53
- data/src/cxx_supportlib/vendor-copy/libuv/uv.gyp +0 -508
- /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-aix.h → uv/aix.h} +0 -0
- /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-bsd.h → uv/bsd.h} +0 -0
- /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-sunos.h → uv/sunos.h} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
2
|
+
*
|
|
2
3
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3
4
|
* of this software and associated documentation files (the "Software"), to
|
|
4
5
|
* deal in the Software without restriction, including without limitation the
|
|
@@ -64,6 +65,19 @@
|
|
|
64
65
|
#define RDWR_BUF_SIZE 4096
|
|
65
66
|
#define EQ(a,b) (strcmp(a,b) == 0)
|
|
66
67
|
|
|
68
|
+
char* original_exepath = NULL;
|
|
69
|
+
uv_mutex_t process_title_mutex;
|
|
70
|
+
uv_once_t process_title_mutex_once = UV_ONCE_INIT;
|
|
71
|
+
static void* args_mem = NULL;
|
|
72
|
+
static char** process_argv = NULL;
|
|
73
|
+
static int process_argc = 0;
|
|
74
|
+
static char* process_title_ptr = NULL;
|
|
75
|
+
|
|
76
|
+
void init_process_title_mutex_once(void) {
|
|
77
|
+
uv_mutex_init(&process_title_mutex);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
67
81
|
int uv__platform_loop_init(uv_loop_t* loop) {
|
|
68
82
|
loop->fs_fd = -1;
|
|
69
83
|
|
|
@@ -91,33 +105,64 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
|
|
|
91
105
|
}
|
|
92
106
|
|
|
93
107
|
|
|
108
|
+
int uv__io_fork(uv_loop_t* loop) {
|
|
109
|
+
uv__platform_loop_delete(loop);
|
|
110
|
+
|
|
111
|
+
return uv__platform_loop_init(loop);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
int uv__io_check_fd(uv_loop_t* loop, int fd) {
|
|
116
|
+
struct poll_ctl pc;
|
|
117
|
+
|
|
118
|
+
pc.events = POLLIN;
|
|
119
|
+
pc.cmd = PS_MOD; /* Equivalent to PS_ADD if the fd is not in the pollset. */
|
|
120
|
+
pc.fd = fd;
|
|
121
|
+
|
|
122
|
+
if (pollset_ctl(loop->backend_fd, &pc, 1))
|
|
123
|
+
return UV__ERR(errno);
|
|
124
|
+
|
|
125
|
+
pc.cmd = PS_DELETE;
|
|
126
|
+
if (pollset_ctl(loop->backend_fd, &pc, 1))
|
|
127
|
+
abort();
|
|
128
|
+
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
94
133
|
void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
134
|
+
uv__loop_internal_fields_t* lfields;
|
|
95
135
|
struct pollfd events[1024];
|
|
96
136
|
struct pollfd pqry;
|
|
97
137
|
struct pollfd* pe;
|
|
98
138
|
struct poll_ctl pc;
|
|
99
|
-
|
|
139
|
+
struct uv__queue* q;
|
|
100
140
|
uv__io_t* w;
|
|
101
141
|
uint64_t base;
|
|
102
142
|
uint64_t diff;
|
|
143
|
+
int have_signals;
|
|
103
144
|
int nevents;
|
|
104
145
|
int count;
|
|
105
146
|
int nfds;
|
|
106
147
|
int i;
|
|
107
148
|
int rc;
|
|
108
149
|
int add_failed;
|
|
150
|
+
int user_timeout;
|
|
151
|
+
int reset_timeout;
|
|
109
152
|
|
|
110
153
|
if (loop->nfds == 0) {
|
|
111
|
-
assert(
|
|
154
|
+
assert(uv__queue_empty(&loop->watcher_queue));
|
|
112
155
|
return;
|
|
113
156
|
}
|
|
114
157
|
|
|
115
|
-
|
|
116
|
-
q = QUEUE_HEAD(&loop->watcher_queue);
|
|
117
|
-
QUEUE_REMOVE(q);
|
|
118
|
-
QUEUE_INIT(q);
|
|
158
|
+
lfields = uv__get_internal_fields(loop);
|
|
119
159
|
|
|
120
|
-
|
|
160
|
+
while (!uv__queue_empty(&loop->watcher_queue)) {
|
|
161
|
+
q = uv__queue_head(&loop->watcher_queue);
|
|
162
|
+
uv__queue_remove(q);
|
|
163
|
+
uv__queue_init(q);
|
|
164
|
+
|
|
165
|
+
w = uv__queue_data(q, uv__io_t, watcher_queue);
|
|
121
166
|
assert(w->pevents != 0);
|
|
122
167
|
assert(w->fd >= 0);
|
|
123
168
|
assert(w->fd < (int) loop->nwatchers);
|
|
@@ -137,7 +182,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
|
137
182
|
pqry.fd = pc.fd;
|
|
138
183
|
rc = pollset_query(loop->backend_fd, &pqry);
|
|
139
184
|
switch (rc) {
|
|
140
|
-
case -1:
|
|
185
|
+
case -1:
|
|
141
186
|
assert(0 && "Failed to query pollset for file descriptor");
|
|
142
187
|
abort();
|
|
143
188
|
case 0:
|
|
@@ -175,7 +220,27 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
|
175
220
|
base = loop->time;
|
|
176
221
|
count = 48; /* Benchmarks suggest this gives the best throughput. */
|
|
177
222
|
|
|
223
|
+
if (lfields->flags & UV_METRICS_IDLE_TIME) {
|
|
224
|
+
reset_timeout = 1;
|
|
225
|
+
user_timeout = timeout;
|
|
226
|
+
timeout = 0;
|
|
227
|
+
} else {
|
|
228
|
+
reset_timeout = 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
178
231
|
for (;;) {
|
|
232
|
+
/* Only need to set the provider_entry_time if timeout != 0. The function
|
|
233
|
+
* will return early if the loop isn't configured with UV_METRICS_IDLE_TIME.
|
|
234
|
+
*/
|
|
235
|
+
if (timeout != 0)
|
|
236
|
+
uv__metrics_set_provider_entry_time(loop);
|
|
237
|
+
|
|
238
|
+
/* Store the current timeout in a location that's globally accessible so
|
|
239
|
+
* other locations like uv__work_done() can determine whether the queue
|
|
240
|
+
* of events in the callback were waiting when poll was called.
|
|
241
|
+
*/
|
|
242
|
+
lfields->current_timeout = timeout;
|
|
243
|
+
|
|
179
244
|
nfds = pollset_poll(loop->backend_fd,
|
|
180
245
|
events,
|
|
181
246
|
ARRAY_SIZE(events),
|
|
@@ -188,6 +253,15 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
|
188
253
|
SAVE_ERRNO(uv__update_time(loop));
|
|
189
254
|
|
|
190
255
|
if (nfds == 0) {
|
|
256
|
+
if (reset_timeout != 0) {
|
|
257
|
+
timeout = user_timeout;
|
|
258
|
+
reset_timeout = 0;
|
|
259
|
+
if (timeout == -1)
|
|
260
|
+
continue;
|
|
261
|
+
if (timeout > 0)
|
|
262
|
+
goto update_timeout;
|
|
263
|
+
}
|
|
264
|
+
|
|
191
265
|
assert(timeout != -1);
|
|
192
266
|
return;
|
|
193
267
|
}
|
|
@@ -197,6 +271,11 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
|
197
271
|
abort();
|
|
198
272
|
}
|
|
199
273
|
|
|
274
|
+
if (reset_timeout != 0) {
|
|
275
|
+
timeout = user_timeout;
|
|
276
|
+
reset_timeout = 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
200
279
|
if (timeout == -1)
|
|
201
280
|
continue;
|
|
202
281
|
|
|
@@ -207,6 +286,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
|
207
286
|
goto update_timeout;
|
|
208
287
|
}
|
|
209
288
|
|
|
289
|
+
have_signals = 0;
|
|
210
290
|
nevents = 0;
|
|
211
291
|
|
|
212
292
|
assert(loop->watchers != NULL);
|
|
@@ -237,13 +317,37 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|
|
237
317
|
continue;
|
|
238
318
|
}
|
|
239
319
|
|
|
240
|
-
|
|
320
|
+
/* Run signal watchers last. This also affects child process watchers
|
|
321
|
+
* because those are implemented in terms of signal watchers.
|
|
322
|
+
*/
|
|
323
|
+
if (w == &loop->signal_io_watcher) {
|
|
324
|
+
have_signals = 1;
|
|
325
|
+
} else {
|
|
326
|
+
uv__metrics_update_idle_time(loop);
|
|
327
|
+
w->cb(loop, w, pe->revents);
|
|
328
|
+
}
|
|
329
|
+
|
|
241
330
|
nevents++;
|
|
242
331
|
}
|
|
243
332
|
|
|
333
|
+
uv__metrics_inc_events(loop, nevents);
|
|
334
|
+
if (reset_timeout != 0) {
|
|
335
|
+
timeout = user_timeout;
|
|
336
|
+
reset_timeout = 0;
|
|
337
|
+
uv__metrics_inc_events_waiting(loop, nevents);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (have_signals != 0) {
|
|
341
|
+
uv__metrics_update_idle_time(loop);
|
|
342
|
+
loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN);
|
|
343
|
+
}
|
|
344
|
+
|
|
244
345
|
loop->watchers[loop->nwatchers] = NULL;
|
|
245
346
|
loop->watchers[loop->nwatchers + 1] = NULL;
|
|
246
347
|
|
|
348
|
+
if (have_signals != 0)
|
|
349
|
+
return; /* Event loop should cycle now so don't poll again. */
|
|
350
|
+
|
|
247
351
|
if (nevents != 0) {
|
|
248
352
|
if (nfds == ARRAY_SIZE(events) && --count != 0) {
|
|
249
353
|
/* Poll for more events but don't block this time. */
|
|
@@ -271,104 +375,6 @@ update_timeout:
|
|
|
271
375
|
}
|
|
272
376
|
|
|
273
377
|
|
|
274
|
-
uint64_t uv__hrtime(uv_clocktype_t type) {
|
|
275
|
-
uint64_t G = 1000000000;
|
|
276
|
-
timebasestruct_t t;
|
|
277
|
-
read_wall_time(&t, TIMEBASE_SZ);
|
|
278
|
-
time_base_to_time(&t, TIMEBASE_SZ);
|
|
279
|
-
return (uint64_t) t.tb_high * G + t.tb_low;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
/*
|
|
284
|
-
* We could use a static buffer for the path manipulations that we need outside
|
|
285
|
-
* of the function, but this function could be called by multiple consumers and
|
|
286
|
-
* we don't want to potentially create a race condition in the use of snprintf.
|
|
287
|
-
* There is no direct way of getting the exe path in AIX - either through /procfs
|
|
288
|
-
* or through some libc APIs. The below approach is to parse the argv[0]'s pattern
|
|
289
|
-
* and use it in conjunction with PATH environment variable to craft one.
|
|
290
|
-
*/
|
|
291
|
-
int uv_exepath(char* buffer, size_t* size) {
|
|
292
|
-
int res;
|
|
293
|
-
char args[PATH_MAX];
|
|
294
|
-
char abspath[PATH_MAX];
|
|
295
|
-
size_t abspath_size;
|
|
296
|
-
struct procsinfo pi;
|
|
297
|
-
|
|
298
|
-
if (buffer == NULL || size == NULL || *size == 0)
|
|
299
|
-
return -EINVAL;
|
|
300
|
-
|
|
301
|
-
pi.pi_pid = getpid();
|
|
302
|
-
res = getargs(&pi, sizeof(pi), args, sizeof(args));
|
|
303
|
-
if (res < 0)
|
|
304
|
-
return -EINVAL;
|
|
305
|
-
|
|
306
|
-
/*
|
|
307
|
-
* Possibilities for args:
|
|
308
|
-
* i) an absolute path such as: /home/user/myprojects/nodejs/node
|
|
309
|
-
* ii) a relative path such as: ./node or ../myprojects/nodejs/node
|
|
310
|
-
* iii) a bare filename such as "node", after exporting PATH variable
|
|
311
|
-
* to its location.
|
|
312
|
-
*/
|
|
313
|
-
|
|
314
|
-
/* Case i) and ii) absolute or relative paths */
|
|
315
|
-
if (strchr(args, '/') != NULL) {
|
|
316
|
-
if (realpath(args, abspath) != abspath)
|
|
317
|
-
return -errno;
|
|
318
|
-
|
|
319
|
-
abspath_size = strlen(abspath);
|
|
320
|
-
|
|
321
|
-
*size -= 1;
|
|
322
|
-
if (*size > abspath_size)
|
|
323
|
-
*size = abspath_size;
|
|
324
|
-
|
|
325
|
-
memcpy(buffer, abspath, *size);
|
|
326
|
-
buffer[*size] = '\0';
|
|
327
|
-
|
|
328
|
-
return 0;
|
|
329
|
-
} else {
|
|
330
|
-
/* Case iii). Search PATH environment variable */
|
|
331
|
-
char trypath[PATH_MAX];
|
|
332
|
-
char *clonedpath = NULL;
|
|
333
|
-
char *token = NULL;
|
|
334
|
-
char *path = getenv("PATH");
|
|
335
|
-
|
|
336
|
-
if (path == NULL)
|
|
337
|
-
return -EINVAL;
|
|
338
|
-
|
|
339
|
-
clonedpath = uv__strdup(path);
|
|
340
|
-
if (clonedpath == NULL)
|
|
341
|
-
return -ENOMEM;
|
|
342
|
-
|
|
343
|
-
token = strtok(clonedpath, ":");
|
|
344
|
-
while (token != NULL) {
|
|
345
|
-
snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args);
|
|
346
|
-
if (realpath(trypath, abspath) == abspath) {
|
|
347
|
-
/* Check the match is executable */
|
|
348
|
-
if (access(abspath, X_OK) == 0) {
|
|
349
|
-
abspath_size = strlen(abspath);
|
|
350
|
-
|
|
351
|
-
*size -= 1;
|
|
352
|
-
if (*size > abspath_size)
|
|
353
|
-
*size = abspath_size;
|
|
354
|
-
|
|
355
|
-
memcpy(buffer, abspath, *size);
|
|
356
|
-
buffer[*size] = '\0';
|
|
357
|
-
|
|
358
|
-
uv__free(clonedpath);
|
|
359
|
-
return 0;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
token = strtok(NULL, ":");
|
|
363
|
-
}
|
|
364
|
-
uv__free(clonedpath);
|
|
365
|
-
|
|
366
|
-
/* Out of tokens (path entries), and no match found */
|
|
367
|
-
return -EINVAL;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
378
|
uint64_t uv_get_free_memory(void) {
|
|
373
379
|
perfstat_memory_total_t mem_total;
|
|
374
380
|
int result = perfstat_memory_total(NULL, &mem_total, sizeof(mem_total), 1);
|
|
@@ -389,6 +395,16 @@ uint64_t uv_get_total_memory(void) {
|
|
|
389
395
|
}
|
|
390
396
|
|
|
391
397
|
|
|
398
|
+
uint64_t uv_get_constrained_memory(void) {
|
|
399
|
+
return 0; /* Memory constraints are unknown. */
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
uint64_t uv_get_available_memory(void) {
|
|
404
|
+
return uv_get_free_memory();
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
|
|
392
408
|
void uv_loadavg(double avg[3]) {
|
|
393
409
|
perfstat_cpu_total_t ps_total;
|
|
394
410
|
int result = perfstat_cpu_total(NULL, &ps_total, sizeof(ps_total), 1);
|
|
@@ -403,23 +419,19 @@ void uv_loadavg(double avg[3]) {
|
|
|
403
419
|
|
|
404
420
|
|
|
405
421
|
#ifdef HAVE_SYS_AHAFS_EVPRODS_H
|
|
406
|
-
static char
|
|
407
|
-
|
|
408
|
-
char *dp = rindex(cp, '/');
|
|
422
|
+
static char* uv__rawname(const char* cp, char (*dst)[FILENAME_MAX+1]) {
|
|
423
|
+
char* dp;
|
|
409
424
|
|
|
425
|
+
dp = rindex(cp, '/');
|
|
410
426
|
if (dp == 0)
|
|
411
427
|
return 0;
|
|
412
428
|
|
|
413
|
-
*dp
|
|
414
|
-
|
|
415
|
-
*dp = '/';
|
|
416
|
-
strcat(rawbuf, "/r");
|
|
417
|
-
strcat(rawbuf, dp+1);
|
|
418
|
-
return rawbuf;
|
|
429
|
+
snprintf(*dst, sizeof(*dst), "%.*s/r%s", (int) (dp - cp), cp, dp + 1);
|
|
430
|
+
return *dst;
|
|
419
431
|
}
|
|
420
432
|
|
|
421
433
|
|
|
422
|
-
/*
|
|
434
|
+
/*
|
|
423
435
|
* Determine whether given pathname is a directory
|
|
424
436
|
* Returns 0 if the path is a directory, -1 if not
|
|
425
437
|
*
|
|
@@ -429,7 +441,7 @@ static char *uv__rawname(char *cp) {
|
|
|
429
441
|
static int uv__path_is_a_directory(char* filename) {
|
|
430
442
|
struct stat statbuf;
|
|
431
443
|
|
|
432
|
-
if (
|
|
444
|
+
if (uv__stat(filename, &statbuf) < 0)
|
|
433
445
|
return -1; /* failed: not a directory, assume it is a file */
|
|
434
446
|
|
|
435
447
|
if (statbuf.st_type == VDIR)
|
|
@@ -439,11 +451,12 @@ static int uv__path_is_a_directory(char* filename) {
|
|
|
439
451
|
}
|
|
440
452
|
|
|
441
453
|
|
|
442
|
-
/*
|
|
454
|
+
/*
|
|
443
455
|
* Check whether AHAFS is mounted.
|
|
444
456
|
* Returns 0 if AHAFS is mounted, or an error code < 0 on failure
|
|
445
457
|
*/
|
|
446
458
|
static int uv__is_ahafs_mounted(void){
|
|
459
|
+
char rawbuf[FILENAME_MAX+1];
|
|
447
460
|
int rv, i = 2;
|
|
448
461
|
struct vmount *p;
|
|
449
462
|
int size_multiplier = 10;
|
|
@@ -454,22 +467,22 @@ static int uv__is_ahafs_mounted(void){
|
|
|
454
467
|
|
|
455
468
|
p = uv__malloc(siz);
|
|
456
469
|
if (p == NULL)
|
|
457
|
-
return
|
|
470
|
+
return UV__ERR(errno);
|
|
458
471
|
|
|
459
472
|
/* Retrieve all mounted filesystems */
|
|
460
473
|
rv = mntctl(MCTL_QUERY, siz, (char*)p);
|
|
461
474
|
if (rv < 0)
|
|
462
|
-
return
|
|
475
|
+
return UV__ERR(errno);
|
|
463
476
|
if (rv == 0) {
|
|
464
477
|
/* buffer was not large enough, reallocate to correct size */
|
|
465
478
|
siz = *(int*)p;
|
|
466
479
|
uv__free(p);
|
|
467
480
|
p = uv__malloc(siz);
|
|
468
481
|
if (p == NULL)
|
|
469
|
-
return
|
|
482
|
+
return UV__ERR(errno);
|
|
470
483
|
rv = mntctl(MCTL_QUERY, siz, (char*)p);
|
|
471
484
|
if (rv < 0)
|
|
472
|
-
return
|
|
485
|
+
return UV__ERR(errno);
|
|
473
486
|
}
|
|
474
487
|
|
|
475
488
|
/* Look for dev in filesystems mount info */
|
|
@@ -477,7 +490,7 @@ static int uv__is_ahafs_mounted(void){
|
|
|
477
490
|
obj = vmt2dataptr(vmt, VMT_OBJECT); /* device */
|
|
478
491
|
stub = vmt2dataptr(vmt, VMT_STUB); /* mount point */
|
|
479
492
|
|
|
480
|
-
if (EQ(obj, dev) || EQ(uv__rawname(obj), dev) || EQ(stub, dev)) {
|
|
493
|
+
if (EQ(obj, dev) || EQ(uv__rawname(obj, &rawbuf), dev) || EQ(stub, dev)) {
|
|
481
494
|
uv__free(p); /* Found a match */
|
|
482
495
|
return 0;
|
|
483
496
|
}
|
|
@@ -498,7 +511,8 @@ static int uv__makedir_p(const char *dir) {
|
|
|
498
511
|
size_t len;
|
|
499
512
|
int err;
|
|
500
513
|
|
|
501
|
-
|
|
514
|
+
/* TODO(bnoordhuis) Check uv__strscpy() return value. */
|
|
515
|
+
uv__strscpy(tmp, dir, sizeof(tmp));
|
|
502
516
|
len = strlen(tmp);
|
|
503
517
|
if (tmp[len - 1] == '/')
|
|
504
518
|
tmp[len - 1] = 0;
|
|
@@ -506,7 +520,7 @@ static int uv__makedir_p(const char *dir) {
|
|
|
506
520
|
if (*p == '/') {
|
|
507
521
|
*p = 0;
|
|
508
522
|
err = mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
|
509
|
-
if(err != 0)
|
|
523
|
+
if (err != 0 && errno != EEXIST)
|
|
510
524
|
return err;
|
|
511
525
|
*p = '/';
|
|
512
526
|
}
|
|
@@ -514,7 +528,7 @@ static int uv__makedir_p(const char *dir) {
|
|
|
514
528
|
return mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
|
515
529
|
}
|
|
516
530
|
|
|
517
|
-
/*
|
|
531
|
+
/*
|
|
518
532
|
* Creates necessary subdirectories in the AIX Event Infrastructure
|
|
519
533
|
* file system for monitoring the object specified.
|
|
520
534
|
* Returns code from mkdir call
|
|
@@ -540,7 +554,7 @@ static int uv__make_subdirs_p(const char *filename) {
|
|
|
540
554
|
rc = uv__makedir_p(cmd);
|
|
541
555
|
|
|
542
556
|
if (rc == -1 && errno != EEXIST){
|
|
543
|
-
return
|
|
557
|
+
return UV__ERR(errno);
|
|
544
558
|
}
|
|
545
559
|
|
|
546
560
|
return rc;
|
|
@@ -567,7 +581,7 @@ static int uv__setup_ahafs(const char* filename, int *fd) {
|
|
|
567
581
|
sprintf(mon_file, "/aha/fs/modFile.monFactory");
|
|
568
582
|
|
|
569
583
|
if ((strlen(mon_file) + strlen(filename) + 5) > PATH_MAX)
|
|
570
|
-
return
|
|
584
|
+
return UV_ENAMETOOLONG;
|
|
571
585
|
|
|
572
586
|
/* Make the necessary subdirectories for the monitor file */
|
|
573
587
|
rc = uv__make_subdirs_p(filename);
|
|
@@ -582,7 +596,7 @@ static int uv__setup_ahafs(const char* filename, int *fd) {
|
|
|
582
596
|
/* Open the monitor file, creating it if necessary */
|
|
583
597
|
*fd = open(mon_file, O_CREAT|O_RDWR);
|
|
584
598
|
if (*fd < 0)
|
|
585
|
-
return
|
|
599
|
+
return UV__ERR(errno);
|
|
586
600
|
|
|
587
601
|
/* Write out the monitoring specifications.
|
|
588
602
|
* In this case, we are monitoring for a state change event type
|
|
@@ -602,8 +616,8 @@ static int uv__setup_ahafs(const char* filename, int *fd) {
|
|
|
602
616
|
sprintf(mon_file_write_string, "CHANGED=YES;WAIT_TYPE=WAIT_IN_SELECT;INFO_LVL=1");
|
|
603
617
|
|
|
604
618
|
rc = write(*fd, mon_file_write_string, strlen(mon_file_write_string)+1);
|
|
605
|
-
if (rc < 0)
|
|
606
|
-
return
|
|
619
|
+
if (rc < 0 && errno != EBUSY)
|
|
620
|
+
return UV__ERR(errno);
|
|
607
621
|
|
|
608
622
|
return 0;
|
|
609
623
|
}
|
|
@@ -632,7 +646,7 @@ static int uv__skip_lines(char **p, int n) {
|
|
|
632
646
|
/*
|
|
633
647
|
* Parse the event occurrence data to figure out what event just occurred
|
|
634
648
|
* and take proper action.
|
|
635
|
-
*
|
|
649
|
+
*
|
|
636
650
|
* The buf is a pointer to the buffer containing the event occurrence data
|
|
637
651
|
* Returns 0 on success, -1 if unrecoverable error in parsing
|
|
638
652
|
*
|
|
@@ -707,59 +721,51 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int
|
|
|
707
721
|
int bytes, rc = 0;
|
|
708
722
|
uv_fs_event_t* handle;
|
|
709
723
|
int events = 0;
|
|
710
|
-
int i = 0;
|
|
711
724
|
char fname[PATH_MAX];
|
|
712
725
|
char *p;
|
|
713
726
|
|
|
714
727
|
handle = container_of(event_watch, uv_fs_event_t, event_watcher);
|
|
715
728
|
|
|
716
|
-
/* Clean all the buffers*/
|
|
717
|
-
for(i = 0; i < PATH_MAX; i++) {
|
|
718
|
-
fname[i] = 0;
|
|
719
|
-
}
|
|
720
|
-
i = 0;
|
|
721
|
-
|
|
722
729
|
/* At this point, we assume that polling has been done on the
|
|
723
730
|
* file descriptor, so we can just read the AHAFS event occurrence
|
|
724
731
|
* data and parse its results without having to block anything
|
|
725
732
|
*/
|
|
726
733
|
bytes = pread(event_watch->fd, result_data, RDWR_BUF_SIZE, 0);
|
|
727
734
|
|
|
728
|
-
assert((bytes
|
|
735
|
+
assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file");
|
|
736
|
+
|
|
737
|
+
/* In file / directory move cases, AIX Event infrastructure
|
|
738
|
+
* produces a second event with no data.
|
|
739
|
+
* Ignore it and return gracefully.
|
|
740
|
+
*/
|
|
741
|
+
if(bytes == 0)
|
|
742
|
+
return;
|
|
729
743
|
|
|
730
744
|
/* Parse the data */
|
|
731
745
|
if(bytes > 0)
|
|
732
746
|
rc = uv__parse_data(result_data, &events, handle);
|
|
733
747
|
|
|
748
|
+
/* Unrecoverable error */
|
|
749
|
+
if (rc == -1)
|
|
750
|
+
return;
|
|
751
|
+
|
|
734
752
|
/* For directory changes, the name of the files that triggered the change
|
|
735
753
|
* are never absolute pathnames
|
|
736
754
|
*/
|
|
737
755
|
if (uv__path_is_a_directory(handle->path) == 0) {
|
|
738
756
|
p = handle->dir_filename;
|
|
739
|
-
while(*p != NULL){
|
|
740
|
-
fname[i]= *p;
|
|
741
|
-
i++;
|
|
742
|
-
p++;
|
|
743
|
-
}
|
|
744
757
|
} else {
|
|
745
|
-
|
|
746
|
-
if (
|
|
747
|
-
p =
|
|
758
|
+
p = strrchr(handle->path, '/');
|
|
759
|
+
if (p == NULL)
|
|
760
|
+
p = handle->path;
|
|
761
|
+
else
|
|
748
762
|
p++;
|
|
749
|
-
|
|
750
|
-
while(*p != NULL) {
|
|
751
|
-
fname[i]= *p;
|
|
752
|
-
i++;
|
|
753
|
-
p++;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
763
|
}
|
|
757
764
|
|
|
758
|
-
/*
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
handle->cb(handle, (const char*)&fname, events, 0);
|
|
765
|
+
/* TODO(bnoordhuis) Check uv__strscpy() return value. */
|
|
766
|
+
uv__strscpy(fname, p, sizeof(fname));
|
|
767
|
+
|
|
768
|
+
handle->cb(handle, fname, events, 0);
|
|
763
769
|
}
|
|
764
770
|
#endif
|
|
765
771
|
|
|
@@ -769,7 +775,7 @@ int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
|
|
|
769
775
|
uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
|
|
770
776
|
return 0;
|
|
771
777
|
#else
|
|
772
|
-
return
|
|
778
|
+
return UV_ENOSYS;
|
|
773
779
|
#endif
|
|
774
780
|
}
|
|
775
781
|
|
|
@@ -779,53 +785,37 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
|
|
779
785
|
const char* filename,
|
|
780
786
|
unsigned int flags) {
|
|
781
787
|
#ifdef HAVE_SYS_AHAFS_EVPRODS_H
|
|
782
|
-
int fd, rc,
|
|
788
|
+
int fd, rc, str_offset = 0;
|
|
783
789
|
char cwd[PATH_MAX];
|
|
784
790
|
char absolute_path[PATH_MAX];
|
|
785
|
-
char
|
|
786
|
-
|
|
791
|
+
char readlink_cwd[PATH_MAX];
|
|
792
|
+
struct timeval zt;
|
|
793
|
+
fd_set pollfd;
|
|
787
794
|
|
|
788
|
-
/* Clean all the buffers*/
|
|
789
|
-
for(i = 0; i < PATH_MAX; i++) {
|
|
790
|
-
cwd[i] = 0;
|
|
791
|
-
absolute_path[i] = 0;
|
|
792
|
-
fname[i] = 0;
|
|
793
|
-
}
|
|
794
|
-
i = 0;
|
|
795
795
|
|
|
796
796
|
/* Figure out whether filename is absolute or not */
|
|
797
|
-
if (filename[0] == '
|
|
798
|
-
/*
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
797
|
+
if (filename[0] == '\0') {
|
|
798
|
+
/* Missing a pathname */
|
|
799
|
+
return UV_ENOENT;
|
|
800
|
+
}
|
|
801
|
+
else if (filename[0] == '/') {
|
|
802
|
+
/* We have absolute pathname */
|
|
803
|
+
/* TODO(bnoordhuis) Check uv__strscpy() return value. */
|
|
804
|
+
uv__strscpy(absolute_path, filename, sizeof(absolute_path));
|
|
802
805
|
} else {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
snprintf(cwd, PATH_MAX-1, "/proc/%lu/cwd", (unsigned long) getpid());
|
|
817
|
-
res = readlink(cwd, absolute_path, sizeof(absolute_path) - 1);
|
|
818
|
-
if (res < 0)
|
|
819
|
-
return res;
|
|
820
|
-
p = strrchr(absolute_path, '/');
|
|
821
|
-
p++;
|
|
822
|
-
}
|
|
823
|
-
/* Copy to filename buffer */
|
|
824
|
-
while(filename[i] != NULL) {
|
|
825
|
-
*p = filename[i];
|
|
826
|
-
i++;
|
|
827
|
-
p++;
|
|
828
|
-
}
|
|
806
|
+
/* We have a relative pathname, compose the absolute pathname */
|
|
807
|
+
snprintf(cwd, sizeof(cwd), "/proc/%lu/cwd", (unsigned long) getpid());
|
|
808
|
+
rc = readlink(cwd, readlink_cwd, sizeof(readlink_cwd) - 1);
|
|
809
|
+
if (rc < 0)
|
|
810
|
+
return rc;
|
|
811
|
+
/* readlink does not null terminate our string */
|
|
812
|
+
readlink_cwd[rc] = '\0';
|
|
813
|
+
|
|
814
|
+
if (filename[0] == '.' && filename[1] == '/')
|
|
815
|
+
str_offset = 2;
|
|
816
|
+
|
|
817
|
+
snprintf(absolute_path, sizeof(absolute_path), "%s%s", readlink_cwd,
|
|
818
|
+
filename + str_offset);
|
|
829
819
|
}
|
|
830
820
|
|
|
831
821
|
if (uv__is_ahafs_mounted() < 0) /* /aha checks failed */
|
|
@@ -839,14 +829,24 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
|
|
839
829
|
/* Setup/Initialize all the libuv routines */
|
|
840
830
|
uv__handle_start(handle);
|
|
841
831
|
uv__io_init(&handle->event_watcher, uv__ahafs_event, fd);
|
|
842
|
-
handle->path = uv__strdup(
|
|
832
|
+
handle->path = uv__strdup(filename);
|
|
843
833
|
handle->cb = cb;
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
834
|
+
handle->dir_filename = NULL;
|
|
835
|
+
|
|
836
|
+
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
|
|
837
|
+
|
|
838
|
+
/* AHAFS wants someone to poll for it to start mointoring.
|
|
839
|
+
* so kick-start it so that we don't miss an event in the
|
|
840
|
+
* eventuality of an event that occurs in the current loop. */
|
|
841
|
+
do {
|
|
842
|
+
memset(&zt, 0, sizeof(zt));
|
|
843
|
+
FD_ZERO(&pollfd);
|
|
844
|
+
FD_SET(fd, &pollfd);
|
|
845
|
+
rc = select(fd + 1, &pollfd, NULL, NULL, &zt);
|
|
846
|
+
} while (rc == -1 && errno == EINTR);
|
|
847
847
|
return 0;
|
|
848
848
|
#else
|
|
849
|
-
return
|
|
849
|
+
return UV_ENOSYS;
|
|
850
850
|
#endif
|
|
851
851
|
}
|
|
852
852
|
|
|
@@ -871,7 +871,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) {
|
|
|
871
871
|
|
|
872
872
|
return 0;
|
|
873
873
|
#else
|
|
874
|
-
return
|
|
874
|
+
return UV_ENOSYS;
|
|
875
875
|
#endif
|
|
876
876
|
}
|
|
877
877
|
|
|
@@ -886,23 +886,126 @@ void uv__fs_event_close(uv_fs_event_t* handle) {
|
|
|
886
886
|
|
|
887
887
|
|
|
888
888
|
char** uv_setup_args(int argc, char** argv) {
|
|
889
|
-
|
|
889
|
+
char exepath[UV__PATH_MAX];
|
|
890
|
+
char** new_argv;
|
|
891
|
+
size_t size;
|
|
892
|
+
char* s;
|
|
893
|
+
int i;
|
|
894
|
+
|
|
895
|
+
if (argc <= 0)
|
|
896
|
+
return argv;
|
|
897
|
+
|
|
898
|
+
/* Save the original pointer to argv.
|
|
899
|
+
* AIX uses argv to read the process name.
|
|
900
|
+
* (Not the memory pointed to by argv[0..n] as on Linux.)
|
|
901
|
+
*/
|
|
902
|
+
process_argv = argv;
|
|
903
|
+
process_argc = argc;
|
|
904
|
+
|
|
905
|
+
/* Use argv[0] to determine value for uv_exepath(). */
|
|
906
|
+
size = sizeof(exepath);
|
|
907
|
+
if (uv__search_path(argv[0], exepath, &size) == 0) {
|
|
908
|
+
uv_once(&process_title_mutex_once, init_process_title_mutex_once);
|
|
909
|
+
uv_mutex_lock(&process_title_mutex);
|
|
910
|
+
original_exepath = uv__strdup(exepath);
|
|
911
|
+
uv_mutex_unlock(&process_title_mutex);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/* Calculate how much memory we need for the argv strings. */
|
|
915
|
+
size = 0;
|
|
916
|
+
for (i = 0; i < argc; i++)
|
|
917
|
+
size += strlen(argv[i]) + 1;
|
|
918
|
+
|
|
919
|
+
/* Add space for the argv pointers. */
|
|
920
|
+
size += (argc + 1) * sizeof(char*);
|
|
921
|
+
|
|
922
|
+
new_argv = uv__malloc(size);
|
|
923
|
+
if (new_argv == NULL)
|
|
924
|
+
return argv;
|
|
925
|
+
args_mem = new_argv;
|
|
926
|
+
|
|
927
|
+
/* Copy over the strings and set up the pointer table. */
|
|
928
|
+
s = (char*) &new_argv[argc + 1];
|
|
929
|
+
for (i = 0; i < argc; i++) {
|
|
930
|
+
size = strlen(argv[i]) + 1;
|
|
931
|
+
memcpy(s, argv[i], size);
|
|
932
|
+
new_argv[i] = s;
|
|
933
|
+
s += size;
|
|
934
|
+
}
|
|
935
|
+
new_argv[i] = NULL;
|
|
936
|
+
|
|
937
|
+
return new_argv;
|
|
890
938
|
}
|
|
891
939
|
|
|
892
940
|
|
|
893
941
|
int uv_set_process_title(const char* title) {
|
|
942
|
+
char* new_title;
|
|
943
|
+
|
|
944
|
+
/* If uv_setup_args wasn't called or failed, we can't continue. */
|
|
945
|
+
if (process_argv == NULL || args_mem == NULL)
|
|
946
|
+
return UV_ENOBUFS;
|
|
947
|
+
|
|
948
|
+
/* We cannot free this pointer when libuv shuts down,
|
|
949
|
+
* the process may still be using it.
|
|
950
|
+
*/
|
|
951
|
+
new_title = uv__strdup(title);
|
|
952
|
+
if (new_title == NULL)
|
|
953
|
+
return UV_ENOMEM;
|
|
954
|
+
|
|
955
|
+
uv_once(&process_title_mutex_once, init_process_title_mutex_once);
|
|
956
|
+
uv_mutex_lock(&process_title_mutex);
|
|
957
|
+
|
|
958
|
+
/* If this is the first time this is set,
|
|
959
|
+
* don't free and set argv[1] to NULL.
|
|
960
|
+
*/
|
|
961
|
+
if (process_title_ptr != NULL)
|
|
962
|
+
uv__free(process_title_ptr);
|
|
963
|
+
|
|
964
|
+
process_title_ptr = new_title;
|
|
965
|
+
|
|
966
|
+
process_argv[0] = process_title_ptr;
|
|
967
|
+
if (process_argc > 1)
|
|
968
|
+
process_argv[1] = NULL;
|
|
969
|
+
|
|
970
|
+
uv_mutex_unlock(&process_title_mutex);
|
|
971
|
+
|
|
894
972
|
return 0;
|
|
895
973
|
}
|
|
896
974
|
|
|
897
975
|
|
|
898
976
|
int uv_get_process_title(char* buffer, size_t size) {
|
|
899
|
-
|
|
900
|
-
|
|
977
|
+
size_t len;
|
|
978
|
+
if (buffer == NULL || size == 0)
|
|
979
|
+
return UV_EINVAL;
|
|
980
|
+
|
|
981
|
+
/* If uv_setup_args wasn't called, we can't continue. */
|
|
982
|
+
if (process_argv == NULL)
|
|
983
|
+
return UV_ENOBUFS;
|
|
984
|
+
|
|
985
|
+
uv_once(&process_title_mutex_once, init_process_title_mutex_once);
|
|
986
|
+
uv_mutex_lock(&process_title_mutex);
|
|
987
|
+
|
|
988
|
+
len = strlen(process_argv[0]);
|
|
989
|
+
if (size <= len) {
|
|
990
|
+
uv_mutex_unlock(&process_title_mutex);
|
|
991
|
+
return UV_ENOBUFS;
|
|
901
992
|
}
|
|
993
|
+
|
|
994
|
+
memcpy(buffer, process_argv[0], len);
|
|
995
|
+
buffer[len] = '\0';
|
|
996
|
+
|
|
997
|
+
uv_mutex_unlock(&process_title_mutex);
|
|
998
|
+
|
|
902
999
|
return 0;
|
|
903
1000
|
}
|
|
904
1001
|
|
|
905
1002
|
|
|
1003
|
+
void uv__process_title_cleanup(void) {
|
|
1004
|
+
uv__free(args_mem); /* Keep valgrind happy. */
|
|
1005
|
+
args_mem = NULL;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
|
|
906
1009
|
int uv_resident_set_memory(size_t* rss) {
|
|
907
1010
|
char pp[64];
|
|
908
1011
|
psinfo_t psinfo;
|
|
@@ -913,10 +1016,10 @@ int uv_resident_set_memory(size_t* rss) {
|
|
|
913
1016
|
|
|
914
1017
|
fd = open(pp, O_RDONLY);
|
|
915
1018
|
if (fd == -1)
|
|
916
|
-
return
|
|
1019
|
+
return UV__ERR(errno);
|
|
917
1020
|
|
|
918
1021
|
/* FIXME(bnoordhuis) Handle EINTR. */
|
|
919
|
-
err =
|
|
1022
|
+
err = UV_EINVAL;
|
|
920
1023
|
if (read(fd, &psinfo, sizeof(psinfo)) == sizeof(psinfo)) {
|
|
921
1024
|
*rss = (size_t)psinfo.pr_rssize * 1024;
|
|
922
1025
|
err = 0;
|
|
@@ -932,6 +1035,7 @@ int uv_uptime(double* uptime) {
|
|
|
932
1035
|
size_t entries = 0;
|
|
933
1036
|
time_t boot_time;
|
|
934
1037
|
|
|
1038
|
+
boot_time = 0;
|
|
935
1039
|
utmpname(UTMP_FILE);
|
|
936
1040
|
|
|
937
1041
|
setutent();
|
|
@@ -946,7 +1050,7 @@ int uv_uptime(double* uptime) {
|
|
|
946
1050
|
endutent();
|
|
947
1051
|
|
|
948
1052
|
if (boot_time == 0)
|
|
949
|
-
return
|
|
1053
|
+
return UV_ENOSYS;
|
|
950
1054
|
|
|
951
1055
|
*uptime = time(NULL) - boot_time;
|
|
952
1056
|
return 0;
|
|
@@ -962,30 +1066,31 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
|
|
|
962
1066
|
|
|
963
1067
|
result = perfstat_cpu_total(NULL, &ps_total, sizeof(ps_total), 1);
|
|
964
1068
|
if (result == -1) {
|
|
965
|
-
return
|
|
1069
|
+
return UV_ENOSYS;
|
|
966
1070
|
}
|
|
967
1071
|
|
|
968
1072
|
ncpus = result = perfstat_cpu(NULL, NULL, sizeof(perfstat_cpu_t), 0);
|
|
969
1073
|
if (result == -1) {
|
|
970
|
-
return
|
|
1074
|
+
return UV_ENOSYS;
|
|
971
1075
|
}
|
|
972
1076
|
|
|
973
1077
|
ps_cpus = (perfstat_cpu_t*) uv__malloc(ncpus * sizeof(perfstat_cpu_t));
|
|
974
1078
|
if (!ps_cpus) {
|
|
975
|
-
return
|
|
1079
|
+
return UV_ENOMEM;
|
|
976
1080
|
}
|
|
977
1081
|
|
|
978
|
-
|
|
1082
|
+
/* TODO(bnoordhuis) Check uv__strscpy() return value. */
|
|
1083
|
+
uv__strscpy(cpu_id.name, FIRST_CPU, sizeof(cpu_id.name));
|
|
979
1084
|
result = perfstat_cpu(&cpu_id, ps_cpus, sizeof(perfstat_cpu_t), ncpus);
|
|
980
1085
|
if (result == -1) {
|
|
981
1086
|
uv__free(ps_cpus);
|
|
982
|
-
return
|
|
1087
|
+
return UV_ENOSYS;
|
|
983
1088
|
}
|
|
984
1089
|
|
|
985
1090
|
*cpu_infos = (uv_cpu_info_t*) uv__malloc(ncpus * sizeof(uv_cpu_info_t));
|
|
986
1091
|
if (!*cpu_infos) {
|
|
987
1092
|
uv__free(ps_cpus);
|
|
988
|
-
return
|
|
1093
|
+
return UV_ENOMEM;
|
|
989
1094
|
}
|
|
990
1095
|
|
|
991
1096
|
*count = ncpus;
|
|
@@ -1008,40 +1113,44 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
|
|
|
1008
1113
|
}
|
|
1009
1114
|
|
|
1010
1115
|
|
|
1011
|
-
|
|
1012
|
-
int i;
|
|
1013
|
-
|
|
1014
|
-
for (i = 0; i < count; ++i) {
|
|
1015
|
-
uv__free(cpu_infos[i].model);
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
uv__free(cpu_infos);
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
int uv_interface_addresses(uv_interface_address_t** addresses,
|
|
1023
|
-
int* count) {
|
|
1116
|
+
int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
|
|
1024
1117
|
uv_interface_address_t* address;
|
|
1025
|
-
int sockfd, size = 1;
|
|
1118
|
+
int sockfd, sock6fd, inet6, i, r, size = 1;
|
|
1026
1119
|
struct ifconf ifc;
|
|
1027
1120
|
struct ifreq *ifr, *p, flg;
|
|
1121
|
+
struct in6_ifreq if6;
|
|
1122
|
+
struct sockaddr_dl* sa_addr;
|
|
1028
1123
|
|
|
1124
|
+
ifc.ifc_req = NULL;
|
|
1125
|
+
sock6fd = -1;
|
|
1126
|
+
r = 0;
|
|
1029
1127
|
*count = 0;
|
|
1128
|
+
*addresses = NULL;
|
|
1030
1129
|
|
|
1031
1130
|
if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) {
|
|
1032
|
-
|
|
1131
|
+
r = UV__ERR(errno);
|
|
1132
|
+
goto cleanup;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
if (0 > (sock6fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_IP))) {
|
|
1136
|
+
r = UV__ERR(errno);
|
|
1137
|
+
goto cleanup;
|
|
1033
1138
|
}
|
|
1034
1139
|
|
|
1035
1140
|
if (ioctl(sockfd, SIOCGSIZIFCONF, &size) == -1) {
|
|
1036
|
-
|
|
1037
|
-
|
|
1141
|
+
r = UV__ERR(errno);
|
|
1142
|
+
goto cleanup;
|
|
1038
1143
|
}
|
|
1039
1144
|
|
|
1040
1145
|
ifc.ifc_req = (struct ifreq*)uv__malloc(size);
|
|
1146
|
+
if (ifc.ifc_req == NULL) {
|
|
1147
|
+
r = UV_ENOMEM;
|
|
1148
|
+
goto cleanup;
|
|
1149
|
+
}
|
|
1041
1150
|
ifc.ifc_len = size;
|
|
1042
1151
|
if (ioctl(sockfd, SIOCGIFCONF, &ifc) == -1) {
|
|
1043
|
-
|
|
1044
|
-
|
|
1152
|
+
r = UV__ERR(errno);
|
|
1153
|
+
goto cleanup;
|
|
1045
1154
|
}
|
|
1046
1155
|
|
|
1047
1156
|
#define ADDR_SIZE(p) MAX((p).sa_len, sizeof(p))
|
|
@@ -1059,8 +1168,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
|
|
|
1059
1168
|
|
|
1060
1169
|
memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
|
|
1061
1170
|
if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) {
|
|
1062
|
-
|
|
1063
|
-
|
|
1171
|
+
r = UV__ERR(errno);
|
|
1172
|
+
goto cleanup;
|
|
1064
1173
|
}
|
|
1065
1174
|
|
|
1066
1175
|
if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING))
|
|
@@ -1069,12 +1178,14 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
|
|
|
1069
1178
|
(*count)++;
|
|
1070
1179
|
}
|
|
1071
1180
|
|
|
1181
|
+
if (*count == 0)
|
|
1182
|
+
goto cleanup;
|
|
1183
|
+
|
|
1072
1184
|
/* Alloc the return interface structs */
|
|
1073
|
-
*addresses = (
|
|
1074
|
-
uv__malloc(*count * sizeof(uv_interface_address_t));
|
|
1185
|
+
*addresses = uv__calloc(*count, sizeof(**addresses));
|
|
1075
1186
|
if (!(*addresses)) {
|
|
1076
|
-
|
|
1077
|
-
|
|
1187
|
+
r = UV_ENOMEM;
|
|
1188
|
+
goto cleanup;
|
|
1078
1189
|
}
|
|
1079
1190
|
address = *addresses;
|
|
1080
1191
|
|
|
@@ -1088,11 +1199,11 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
|
|
|
1088
1199
|
p->ifr_addr.sa_family == AF_INET))
|
|
1089
1200
|
continue;
|
|
1090
1201
|
|
|
1202
|
+
inet6 = (p->ifr_addr.sa_family == AF_INET6);
|
|
1203
|
+
|
|
1091
1204
|
memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
|
|
1092
|
-
if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1)
|
|
1093
|
-
|
|
1094
|
-
return -ENOSYS;
|
|
1095
|
-
}
|
|
1205
|
+
if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1)
|
|
1206
|
+
goto syserror;
|
|
1096
1207
|
|
|
1097
1208
|
if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING))
|
|
1098
1209
|
continue;
|
|
@@ -1101,23 +1212,72 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
|
|
|
1101
1212
|
|
|
1102
1213
|
address->name = uv__strdup(p->ifr_name);
|
|
1103
1214
|
|
|
1104
|
-
if (
|
|
1215
|
+
if (inet6)
|
|
1105
1216
|
address->address.address6 = *((struct sockaddr_in6*) &p->ifr_addr);
|
|
1106
|
-
|
|
1217
|
+
else
|
|
1107
1218
|
address->address.address4 = *((struct sockaddr_in*) &p->ifr_addr);
|
|
1108
|
-
}
|
|
1109
1219
|
|
|
1110
|
-
|
|
1220
|
+
if (inet6) {
|
|
1221
|
+
memset(&if6, 0, sizeof(if6));
|
|
1222
|
+
r = uv__strscpy(if6.ifr_name, p->ifr_name, sizeof(if6.ifr_name));
|
|
1223
|
+
if (r == UV_E2BIG)
|
|
1224
|
+
goto cleanup;
|
|
1225
|
+
r = 0;
|
|
1226
|
+
memcpy(&if6.ifr_Addr, &p->ifr_addr, sizeof(if6.ifr_Addr));
|
|
1227
|
+
if (ioctl(sock6fd, SIOCGIFNETMASK6, &if6) == -1)
|
|
1228
|
+
goto syserror;
|
|
1229
|
+
address->netmask.netmask6 = *((struct sockaddr_in6*) &if6.ifr_Addr);
|
|
1230
|
+
/* Explicitly set family as the ioctl call appears to return it as 0. */
|
|
1231
|
+
address->netmask.netmask6.sin6_family = AF_INET6;
|
|
1232
|
+
} else {
|
|
1233
|
+
if (ioctl(sockfd, SIOCGIFNETMASK, p) == -1)
|
|
1234
|
+
goto syserror;
|
|
1235
|
+
address->netmask.netmask4 = *((struct sockaddr_in*) &p->ifr_addr);
|
|
1236
|
+
/* Explicitly set family as the ioctl call appears to return it as 0. */
|
|
1237
|
+
address->netmask.netmask4.sin_family = AF_INET;
|
|
1238
|
+
}
|
|
1111
1239
|
|
|
1112
1240
|
address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0;
|
|
1113
1241
|
|
|
1114
1242
|
address++;
|
|
1115
1243
|
}
|
|
1116
1244
|
|
|
1245
|
+
/* Fill in physical addresses. */
|
|
1246
|
+
ifr = ifc.ifc_req;
|
|
1247
|
+
while ((char*)ifr < (char*)ifc.ifc_req + ifc.ifc_len) {
|
|
1248
|
+
p = ifr;
|
|
1249
|
+
ifr = (struct ifreq*)
|
|
1250
|
+
((char*)ifr + sizeof(ifr->ifr_name) + ADDR_SIZE(ifr->ifr_addr));
|
|
1251
|
+
|
|
1252
|
+
if (p->ifr_addr.sa_family != AF_LINK)
|
|
1253
|
+
continue;
|
|
1254
|
+
|
|
1255
|
+
address = *addresses;
|
|
1256
|
+
for (i = 0; i < *count; i++) {
|
|
1257
|
+
if (strcmp(address->name, p->ifr_name) == 0) {
|
|
1258
|
+
sa_addr = (struct sockaddr_dl*) &p->ifr_addr;
|
|
1259
|
+
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
|
|
1260
|
+
}
|
|
1261
|
+
address++;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1117
1265
|
#undef ADDR_SIZE
|
|
1266
|
+
goto cleanup;
|
|
1118
1267
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1268
|
+
syserror:
|
|
1269
|
+
uv_free_interface_addresses(*addresses, *count);
|
|
1270
|
+
*addresses = NULL;
|
|
1271
|
+
*count = 0;
|
|
1272
|
+
r = UV_ENOSYS;
|
|
1273
|
+
|
|
1274
|
+
cleanup:
|
|
1275
|
+
if (sockfd != -1)
|
|
1276
|
+
uv__close(sockfd);
|
|
1277
|
+
if (sock6fd != -1)
|
|
1278
|
+
uv__close(sock6fd);
|
|
1279
|
+
uv__free(ifc.ifc_req);
|
|
1280
|
+
return r;
|
|
1121
1281
|
}
|
|
1122
1282
|
|
|
1123
1283
|
|
|
@@ -1132,6 +1292,7 @@ void uv_free_interface_addresses(uv_interface_address_t* addresses,
|
|
|
1132
1292
|
uv__free(addresses);
|
|
1133
1293
|
}
|
|
1134
1294
|
|
|
1295
|
+
|
|
1135
1296
|
void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
|
|
1136
1297
|
struct pollfd* events;
|
|
1137
1298
|
uintptr_t i;
|
|
@@ -1139,6 +1300,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
|
|
|
1139
1300
|
struct poll_ctl pc;
|
|
1140
1301
|
|
|
1141
1302
|
assert(loop->watchers != NULL);
|
|
1303
|
+
assert(fd >= 0);
|
|
1142
1304
|
|
|
1143
1305
|
events = (struct pollfd*) loop->watchers[loop->nwatchers];
|
|
1144
1306
|
nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
|