aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix/sys.c
AgeCommit message (Collapse)Author
2017-03-14erts: Fix signal pipeBjörn-Egil Dahlberg
2017-02-20Merge branch 'master' into sverker/enif_selectSverker Eriksson
Conflicts: erts/emulator/beam/erl_binary.h erts/emulator/beam/erl_monitors.c erts/emulator/beam/erl_nif.c erts/emulator/beam/global.h erts/emulator/test/nif_SUITE_data/nif_SUITE.c
2017-02-09erts: Change return value for enif_selectSverker Eriksson
to negative int as error and positive as success.
2017-02-09erts: Add pid argument to enif_selectSverker Eriksson
2017-02-03Merge branch 'master' into sverker/enif_selectSverker Eriksson
2017-02-02erts: Do not handle SIGILLBjörn-Egil Dahlberg
* Remove SIGILL from signal whitelist
2017-02-02erts: Fix thread suspend in crashdumpBjörn-Egil Dahlberg
* move signal handler setup
2017-02-02erts: Do not enable SIGINTBjörn-Egil Dahlberg
2017-02-02erts: Use generic signal handlerBjörn-Egil Dahlberg
2017-01-19erts: Handle SIGUSR1 via signal service insteadBjörn-Egil Dahlberg
2017-01-19erts: Handle SIGTERM via signal service insteadBjörn-Egil Dahlberg
2017-01-05erts: Add SIGHUP signal handlerBjörn-Egil Dahlberg
A received SIGHUP signal to beam will generate a '{notify, sighup}' message to the registered process 'erl_signal_server'. 'erl_signal_server' is a gen_event process.
2017-01-05erts: Remove whitespace errorsBjörn-Egil Dahlberg
* and some minor refactoring
2016-12-19Add ErlNifSelectReturnSverker Eriksson
2016-12-15Merge branch 'egil/erts/handle-sigterm-nicely/OTP-14085' into maintBjörn-Egil Dahlberg
* egil/erts/handle-sigterm-nicely/OTP-14085: erts: Document SIGTERM handler erts: Add SIGTERM signal handler
2016-12-07erts: Add SIGTERM signal handlerBjörn-Egil Dahlberg
A received SIGTERM signal to beam will generate a {'stop','stop'} message to the init process and terminate the beam nicely.
2016-11-30erts: Add enif_select & enif_open_resource_type_xSverker Eriksson
2016-11-25Merge branch 'rickard/init-bug/OTP-13911' into maintRickard Green
* rickard/init-bug/OTP-13911: Fix initialization dependencies between time, lock-check and lcnt Conflicts: erts/emulator/sys/unix/sys.c
2016-11-22Merge branch 'sverker/erts/crash-dump-limit/OTP-14046' into maintSverker Eriksson
* sverker/erts/crash-dump-limit: erts: Add env variable ERL_CRASH_DUMP_BYTES erts: Add ErtsStrToSint64 erts: Refactor crash dumping with cbprintf erts: Add cbprintf for Callback Printing erts: Remove unused erl_crash_dump()
2016-11-16erts: Remove unused erl_crash_dump()Sverker Eriksson
2016-11-09Merge branch 'maint-19' into maintBjörn-Egil Dahlberg
2016-11-01erts: Fix SIGUSR1 crashdump generationBjörn-Egil Dahlberg
Do not generate a core when a crashdump is asked for. Regression introduced in 56090db3ea417157a749bdd810fc61d117493f1f
2016-09-27erts: Rename __errno in order to avoid conflict on openbsdLukas Larsson
2016-09-26Fix initialization dependencies between time, lock-check and lcntRickard Green
2016-09-02erts: Fix child setup signal hander bugLukas Larsson
When running the signal handler, the errno has to be restored to its original value, otherwise code running in the same thread may misbehave.
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-18Merge branch 'lukas/erts/fix_scheduler_suspend/ERL-94/PR-978/OTP-13425'Lukas Larsson
* lukas/erts/fix_scheduler_suspend/ERL-94/PR-978/OTP-13425: erts: Fix install of suspend handler Conflicts: erts/emulator/sys/unix/erl_unix_sys.h erts/emulator/sys/unix/sys.c
2016-03-15update copyright-yearHenrik Nord
2016-02-24Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson
2016-02-24erts: Change erl_exit into erts_exitSverker Eriksson
This is mostly a pure refactoring. Except for the buggy cases when calling erlang:halt() with a positive integer in the range -(INT_MIN+2) to -INT_MIN that got confused with ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT. Outcome OLD erl_exit(n, ) NEW erts_exit(n, ) ------- ------------------- ------------------------------------------- exit(Status) n = -Status <= 0 n = Status >= 0 crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0 The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and ERTS_DUMP_EXIT are the same as before (even though their values have changed).
2016-02-23erts: Fix install of suspend handlerLukas Larsson
This commit makes sure to setup the suspend handler to matter what +B option is given at the command line.
2015-12-15erts: Create forker process for spawn driverLukas Larsson
Instead of forking from the beam process, we create a separate process in which all forks are done. This has several advantages: 1) performance: * don't have to close all fd's in the world * fork only has to copy stuff from a small process * work is done in a completely seperate process * a 3x performance increase has been measured, can be made even greater (10x) if we cache the environment in child setup 2) stability * the exec is done in another process than beam, which means that if the file that we exec to is on an nfs that is not available right now we will not block a scheduler until the nfs returns. 3) simplicity * don't have to deal with SIGCHLD in the erts Unfortunately, this solution also implies some badness. 1) There will always be a seperate process running together with beam on unix. This could be confusing and undesirable. 2) We have to transfer the entire environment to child_setup for each command. OTP-13088
2015-12-15erts: Move sys drivers to another fileLukas Larsson
2015-12-15erts: Change name of child_setup to erl_child_setupLukas Larsson
2015-12-15erts: Rename sys driver structsLukas Larsson
2015-08-18Handle ERRNO_BLOCK in fd_driver async functionsSteve Vinoski
Several users on erlang-questions have reported problems with recent releases where output to standard_error causes standard_error_sup to die from receiving an unexpected eagain error. In the fd_driver, change the fd_async() function to handle EINTR, and change fd_ready_async() to handle ERRNO_BLOCK. Add a new test to standard_error_SUITE to generate output to standard_error and ensure that standard_error_sup does not die. Thanks to Kota Uenishi for contributing the test case.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-03-24Merge branch 'rickard/time_api/OTP-11997'Rickard Green
* rickard/time_api/OTP-11997: Better OS system time implementation Documentation adjustments Fix zero timout timers erts_sys_hrtime() for lcnt Better support for poor os monotonic sources Conflicts: erts/preloaded/ebin/erlang.beam
2015-03-23erts_sys_hrtime() for lcntRickard Green
2015-03-21Merge branch 'rickard/time_api/OTP-11997'Rickard Green
* rickard/time_api/OTP-11997: Unbreak lcnt
2015-03-21Unbreak lcntRickard Green
2015-03-20Merge branch 'rickard/time_api/OTP-11997'Rickard Green
* rickard/time_api/OTP-11997: (22 commits) Update primary bootstrap inets: Suppress deprecated warning on erlang:now/0 inets: Cleanup of multiple copies of functions Add inets_lib with common functions used by multiple modules inets: Update comments Suppress deprecated warning on erlang:now/0 Use new time API and be back-compatible in inets Remove unused functions and removed redundant test asn1 test SUITE: Eliminate use of now/0 Disable deprecated warning on erlang:now/0 in diameter_lib Use new time API and be back-compatible in ssh Replace all calls to now/0 in CT with new time API functions test_server: Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API otp_SUITE: Warn for calls to erlang:now/0 Replace usage of erlang:now() with usage of new API Multiple timer wheels Erlang based BIF timer implementation for scalability Implement ethread events with timeout ... Conflicts: bootstrap/bin/start.boot bootstrap/bin/start_clean.boot bootstrap/lib/compiler/ebin/beam_asm.beam bootstrap/lib/compiler/ebin/compile.beam bootstrap/lib/kernel/ebin/auth.beam bootstrap/lib/kernel/ebin/dist_util.beam bootstrap/lib/kernel/ebin/global.beam bootstrap/lib/kernel/ebin/hipe_unified_loader.beam bootstrap/lib/kernel/ebin/inet_db.beam bootstrap/lib/kernel/ebin/inet_dns.beam bootstrap/lib/kernel/ebin/inet_res.beam bootstrap/lib/kernel/ebin/os.beam bootstrap/lib/kernel/ebin/pg2.beam bootstrap/lib/stdlib/ebin/dets.beam bootstrap/lib/stdlib/ebin/dets_utils.beam bootstrap/lib/stdlib/ebin/erl_tar.beam bootstrap/lib/stdlib/ebin/escript.beam bootstrap/lib/stdlib/ebin/file_sorter.beam bootstrap/lib/stdlib/ebin/otp_internal.beam bootstrap/lib/stdlib/ebin/qlc.beam bootstrap/lib/stdlib/ebin/random.beam bootstrap/lib/stdlib/ebin/supervisor.beam bootstrap/lib/stdlib/ebin/timer.beam erts/aclocal.m4 erts/emulator/beam/bif.c erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_db_hash.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_thr_progress.c erts/emulator/beam/utils.c erts/emulator/sys/unix/sys.c erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/init.beam erts/preloaded/src/erts_internal.erl lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl lib/diameter/src/base/diameter_lib.erl lib/kernel/src/os.erl lib/ssh/test/ssh_basic_SUITE.erl system/doc/efficiency_guide/advanced.xml
2015-03-20Introduce a new time APIRickard Green
The old time API is based on erlang:now/0. The major issue with erlang:now/0 is that it was intended to be used for so many unrelated things. This tied these unrelated operations together and unnecessarily caused performance, scalability as well as accuracy, and precision issues for operations that do not need to have such issues. The new API spreads different functionality over multiple functions in order to improve on this. The new API consists of a number of new BIFs: - erlang:convert_time_unit/3 - erlang:monotonic_time/0 - erlang:monotonic_time/1 - erlang:system_time/0 - erlang:system_time/1 - erlang:time_offset/0 - erlang:time_offset/1 - erlang:timestamp/0 - erlang:unique_integer/0 - erlang:unique_integer/1 - os:system_time/0 - os:system_time/1 and a number of extensions of existing BIFs: - erlang:monitor(time_offset, clock_service) - erlang:system_flag(time_offset, finalize) - erlang:system_info(os_monotonic_time_source) - erlang:system_info(time_offset) - erlang:system_info(time_warp_mode) - erlang:system_info(time_correction) - erlang:system_info(start_time) See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
2015-02-04fix faulty mergeHenrik Nord
2015-02-03Merge branch 'maint'Zandra Hird
Conflicts: OTP_VERSION erts/emulator/sys/unix/sys.c erts/vsn.mk
2015-01-30Merge branch 'egil/fix-child_setup-close/OTP-12446' into maint-17Erlang/OTP
* egil/fix-child_setup-close/OTP-12446: erts: Use closefrom() if available when closing fds erts: Don't close all fds twice in child_setup
2015-01-27erts: Use closefrom() if available when closing fdsBjörn-Egil Dahlberg
closefrom() was only used in the vfork() case before, now also used in the fork() case.
2015-01-23erts: Reserve a file descriptor for the crashdump fileBjörn-Egil Dahlberg
2015-01-23erts: Use emergency close to close epmdBjörn-Egil Dahlberg
Closes all open socket before writing crashdump to file.
2014-12-19Merge branch 'lukas/erts/crashdump_improvements/OTP-12377'Lukas Larsson
* lukas/erts/crashdump_improvements/OTP-12377: erts: Make main thread safe from pipe closed event erts: Improve crash dumps erts: Rename sys_sigset to sys_signal erts: Introduce thread suspend functions erts: Remove usage of QUANTIFY signal erts: Add support for thread names ets: Increase data available in crash dumps and ets:info erts: Start compilation of beam_emu earlier