aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
AgeCommit message (Collapse)Author
2011-12-02Fix undefined datetimesBjörn-Egil Dahlberg
2011-12-02Teach file.erl datetime conversionsBjörn-Egil Dahlberg
2011-12-02Merge branch 'ta/sendfile/OTP-9240'Lukas Larsson
* ta/sendfile/OTP-9240: (31 commits) Add sendfile server printouts Skip recv/send during tests for fallback platforms Remove header/trailer support Remove windows implementation Expand sendfile documentation Only allow tcp sockets as target for sendfile Move sendfile api to file module Preliminary work on header/trailer Use free_sendfile explicitly for non-async Remove debug printouts Add tests for send/recv/sendfile interactions Remove tests for file_server sendfile sendfile caller now has to be the controlling_process Remove support for file_server, sendfile has to be raw Set chunk size to 3 GB Change type of fd to be ErlDrvEvent Add ifdef's for HAVE_SENDFILE Fix freebsd support for sendfile Change nbytes to 64 bit Implement ignorefd for TCP ...
2011-12-02Remove header/trailer supportLukas Larsson
Since the API for headers/trailers seem to be very awkward to work with when using non-blocking io the feature is dropped for now. See unix_efile.c for more details.
2011-12-02Expand sendfile documentationLukas Larsson
2011-12-02Move sendfile api to file moduleLukas Larsson
Since sendfile could in theory be used to send to any type of file descriptor in *nix, it is a better fit to have it in file.
2011-12-01Preliminary work on header/trailerLukas Larsson
Have to figure out how to represent progress in header writing when using non-blocking, not sure how to do this.
2011-12-01sendfile caller now has to be the controlling_processLukas Larsson
This is needed because otherwise there could be scenarios when the efile driver blocks a fd and then crashes without the inet driver ever finding out. Now when the process crashes the port will close and we can cleanup in the inet driver.
2011-12-01Remove support for file_server, sendfile has to be rawLukas Larsson
Because the sending process has to be the controlling process of the tcp socket used to send data it is not possible to use the file_server
2011-12-01Implement ignorefd for TCPLukas Larsson
Ignore fd is a feature used by sendfile to temporarily remove all driver_select calls on that fd so that another driver can select on it. It also delays all actions which sends or receives data in that fd until in the fd is no longer ignored. Only the controlling_process should use the feature as it is otherwise possible that the ignore will never be cleaned up and hence create a memory leak in the driver. An ignored driver will not detect that an fd has been closed until it is unignored.
2011-12-01Implement blocking calls for sendfileLukas Larsson
Move sendfile data to invoke data instead of file_descr. Remove usage of ready_output when doing a send. If told to send 0 bytes, file_sendfile now sends the entire file for linux.
2011-12-01Implement sendfile using blocking io in asynch threadsLukas Larsson
Move the command handling to outputv in preparation for header and trailer inclusion in the sendfile api. Use the standard efile communication functions for sendfile.
2011-12-01Create erlang fallback for sendfileLukas Larsson
Created erlang fallback for sendfile in gen_tcp and moved sendfile from file to gen_tcp. Also created testcases for testing all different options to sendfile. For info about how sendfile should work see the BSD man pages as they contain a more complete API than other *nixes.
2011-12-01Correct callback spec in application moduleStavros Aronis
2011-11-29Implement file:sendfileTuncer Ayaz
Allow Erlang code to use sendfile() where available by wrapping it as file:sendfile/4 and file:sendfile/2. sendfile(2) - Linux man page: "sendfile() copies data between one file descriptor and another. Because this copying is done within the kernel, sendfile() is more efficient than the combination of read(2) and write(2), which would require transferring data to and from user space."
2011-11-29user_sup: Eliminate use of tuple funBjörn Gustavsson
2011-11-26code: Clean up loading of code_server prerequisitesBjörn Gustavsson
Reorganize in a systematic way the code that loads the modules needed by the code_server process. While at it, remove the useless hipe_unified_loader:load_hipe_modules/0 function.
2011-11-23Avoid slow code loading of BEAM code in a hipe-enabled emulatorBjörn Gustavsson
On my Linux computer, building the entire Erlang/OTP system with hipe disabled took about 8 minutes. With hipe enabled, but without any native code, the build took about 23 minutes, i.e. more than 3 times slower. (The computer has 4 cores, and I used 'make -j6'.) On my eight-core Mac (running 'make -j10') there was only a slight slowdown when hipe was enabled. The culprit is hipe_unified_loader:post_beam_load/1, which will be called every time a module is loaded (even if the module contains no native code). If post_beam_load/1 is called in a hipe-enabled emulator, it will block multi-scheduling, even if no work needs to be done. Apparently the cost for blocking multi-scheduling can vary greatly, depending on the operating system and system load. As a quick and conservative fix, don't call post_beam_load/1 unless some native code has been previously loaded.
2011-11-18Merge branch 'siri/sasl/upgrade-erts/OTP-9438'Siri Hansen
* siri/sasl/upgrade-erts/OTP-9438: Fix bug in erts upgrade on windows Add release vsn info to erts_vsn_changed warning Check for sasl application in systools:make_script and make_relup Add syntax check of relup to check_install_release and install_release Add documentation for upgrade from pre R15 to post R15 sasl Handle upgrade from pre R15 to post R15 sasl Step version of sasl to 2.2 for R15 Document upgrade instructions restart_new_emulator and restart_emulator Wait for two restarts in upgrade_restart test Add restart_new_emulator instruction to kernel, stdlib and sasl appups Distinguish restart_new_emulator from restart_emulator in upgrade instructions Upgrade erts: merge sys.config for tmp release instead of using old Allow regexp for version in .appup Restart emulator before running upgrade script when erts is upgraded Conflicts: lib/sasl/src/release_handler.erl lib/sasl/test/release_handler_SUITE.erl
2011-11-17Add restart_new_emulator instruction to kernel, stdlib and sasl appupsSiri Hansen
The appup files for kernel, stdlib and sasl did not contain any UpFromVsn and DownToVsn. This means that it was not possible to create a relup file with systool:make_relup if any of these applications had changed. This commit adds entries in the appup files for a maximum of two major releases back - all with only one upgrade instruction: restart_new_emulator. The point is to allow relups to be generated, but ensure that no soft upgrade is done for these three applications - i.e. they will always cause a restart of the emulator prior to all other upgrade instructions from other applications. Test cases (appup_test) are added to kernel_SUITE, stdlib_SUITE and sasl_SUITE. These all check that expected versions are matched in the appups, and illegal versions (older than two major releases, or in any other way illegal) do not match. The test is written in a general way where it is assumed that the version of these applications are stepped according the the rule that major releases step the second number, maintenance releases step the third number and patches step the fourth number.
2011-11-17Merge branch 'siri/kernel/application-shutdown-timeout/OTP-9540'Siri Hansen
* siri/kernel/application-shutdown-timeout/OTP-9540: Add documentation and test for kernel env var shutdown_timeout Add env var shutdown_timeout to kernel to avoid deadlock on node shutdown
2011-11-17kernel: Bugfix - SCTP connect with sndrcvinfo in assoc_change eventRaimo Niskanen
On some platforms (FreeBSD) the #sctp_assoc_change{state=comm_up} event arriving during gen_sctp:connect/4,5 contains ancillary data #sctp_sndrcvinfo{}. That was not expected by the code.
2011-11-17erts,kernel: Implement gen_sctp:peeloff/2Raimo Niskanen
2011-11-17erts,kernel: Add type stream sockets to SCTPRaimo Niskanen
2011-11-16erts,kernel: Rename operations common to TCP and SCTPRaimo Niskanen
2011-11-15Add env var shutdown_timeout to kernel to avoid deadlock on node shutdownSiri Hansen
When a node is shutting down, application_controller will do exit(Pid,shutdown) on all application masters, and wait for {'EXIT',Pid,_}. If, for some reason, the application master does not terminate then application_controller will hang forever waiting for this 'EXIT' message. To overcome this problem, a configurable timer is added to kernel - the enviroment variable 'shutdown_timeout'. If this variable is set to a positive integer T, application_controller will do exit(Pid,kill) after T milli seconds if no 'EXIT' message is received.
2011-11-14Remove the undocumented function global:safe_whereis_name/1Hans Bolinder
2011-11-14Remove all use of global:safe_whereis_name/1Hans Bolinder
Calls to global:whereis_name/1 have been substituted for calls to global:safe_whereis_name/1 since the latter is not safe at all. The reason for not doing this earlier is that setting a global lock masked out a bug concerning the restart of supervised children. The bug has now been fixed by a modification of global:whereis_name/1. (Thanks to Ulf Wiger for code contribution.)
2011-11-01Fix a crash when file:change_time/2,3 are called with invalid datesAhmed Omar
Calling file:change_time/2,3 with an invalid date tuple (e.g file:change_time("file.txt", {undefined, undefined})) will cause file_server_2 to crash. error_logger will shutdown and the whole VM will stop. Change behavior to validate given dates on system boundaries. (i.e before issuing a server call).
2011-11-01Merge branch 'rc/remote-shell-completion'Henrik Nord
OTP-9673
2011-10-10Merge branch 'hb/kernel/fix_disk_log/OTP-9508'Hans Bolinder
* hb/kernel/fix_disk_log/OTP-9508: Fix two minor disk_log bugs
2011-10-07Add callback specs into 'application' module in kernelStavros Aronis
2011-09-29Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Update copyright years
2011-09-29Update copyright yearsBjörn-Egil Dahlberg
2011-09-20Merge branch 'dev' into majorHenrik Nord
Conflicts: erts/aclocal.m4 erts/include/internal/ethread_header_config.h.in
2011-09-15Specify file name and error on create_cookie failureMagnus Henoch
The error message for failing to create a cookie file is much more helpful when it specifies the actual file it tried to use and the error that occurred.
2011-09-15Fix misspelling of successfulTuncer Ayaz
2011-09-13Merge branch 'pan/move-dist-headers/OTP-9510' into majorIngela Anderton Andin
* pan/move-dist-headers/OTP-9510: Update bootstrap (manually) Move distribution headers from kernel/src to kernel/include
2011-09-02Merge branch 'dev' into majorHans Bolinder
* dev: Fix a couple of minor bugs with hook priority Update to reflect addition of CTH priority addition Update CTH priority default to be 0 Update to reflect new cth callback api Update the return from init/2 to be {ok, NewState} or {ok,NewState,Priority} instead of NewState. Add priority functionality and tests for ct hooks Update internal hooks state to use a record instead of tuples Improve and correct types and specifications in Kernel and STDLIB
2011-09-02Merge branch 'hb/spec_improvements/OTP-9485' into devHans Bolinder
* hb/spec_improvements/OTP-9485: Improve and correct types and specifications in Kernel and STDLIB
2011-09-01Merge branch 'dev' into majorHenrik Nord
2011-09-01Move distribution headers from kernel/src to kernel/includePatrik Nyblom
2011-09-01Fix two minor disk_log bugsHans Bolinder
disk_log:reopen/2,3 and disk_log:breopen/3 could return the error reason from file:rename/2 rather than the reason {file_error, Filename, Reason}. The message {disk_log, Node, {error, disk_log_stopped}} which according the documentation is sent upon failure to truncate or reopen a disk log was sometimes turned into a reply.
2011-08-31Improve and correct types and specifications in Kernel and STDLIBHans Bolinder
Running Dialyzer on the test suites revealed a few type errors.
2011-08-27Fix type of Packet arg of gen_tcp:send/2 and gen_udp:send/4Filipe David Manana
The type is marked as a binary() or a string() but in practice it can be an iodata(). The test suite was updated to confirm the gen_tcp/2 and gen_udp:send/4 functions accept iodata() (iolists) packets.
2011-08-26Merge branch 'dev' into majorHans Bolinder
* dev: Improve types and specifications of the inet modules
2011-08-26Merge branch 'hb/inet_types_and_specs/OTP-9260' into devHans Bolinder
* hb/inet_types_and_specs/OTP-9260: Improve types and specifications of the inet modules
2011-08-26Merge branch 'dev' into majorBjörn Gustavsson
* dev: code: Optimize purge/1 and soft_purge/1 using check_old_code/1 Add erlang:check_old_code/1 check_process_code/2: Quickly return 'false' if there is no old code
2011-08-26code: Optimize purge/1 and soft_purge/1 using check_old_code/1Björn Gustavsson
While at it, eliminate an unnecessary use of throw/catch in the implementation of soft_purge/1.
2011-08-25Improve types and specifications of the inet modulesHans Bolinder