aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
AgeCommit message (Collapse)Author
2013-02-11Make prim_file skip invalid filenames in unicode modePatrik Nyblom
The fix affects list_dir and read_link. Raw filenames are now never produced, just consumed even if +fnu or +fna is used on Linux etc. This also adds the options to get error return or error handler warning messages with +fn{u|a}{i|w|e} as an option to erl. This is still not documented and there needs to be other versions of read_dir and read_link to facilitate reading of all types of filenames and links. A check that we will not change to an invalid directory is also needed.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-21Text representation of a float formatted using given options.Serge Aleynikov
This BIF solves a problem of float_to_list/1 that doesn't allow specifying the number of digits after the decimal point when formatting floats. float_to_list(Float, Options) -> string() Float = float() Options = [Option] Option = {decimals, Decimals::0..249} | {scientific, Decimals::0..249} | compact Returns a string which corresponds to the text representation of a `Float` formatted using given options. When decimals option is specified the returned value will contain at most `Decimals` number of digits past the decimal point. When `compact` option is provided the trailing zeros at the end of the list are truncated (this option is only meaningful together with the `decimals` option). When `scientific` option is provided, the float will be formatted using scientific notation with `Decimals` digits of precision. If `Options` is `[]` the function behaves like `float_to_list/1`. When using `decimals` option and the number doesn't fit in the static internal buffer of 256 bytes the function throws `badarg`.
2012-12-14Merge branch 'sverk/egil/r16/new-alloc-header-scheme/OTP-10273'Björn-Egil Dahlberg
OTP-10415 * sverk/egil/r16/new-alloc-header-scheme/OTP-10273: (42 commits) erts: Make ll main mbc fit into 2pow size erts: Clear entire mseg cache upon request erts: Reduce max heap sizes tests: Refactor away ?line macro in beam_SUITE tests: Fix heap_sizes check tests: Refactor away ?line macro in process_SUITE tests: Use new correct min_bin_vheap_size in test erts: Set super alignment (256kb) and limits for sbct (8Mb) and lmbcs (128Mb) erts: Do not cache segments that are misaligned erts: Add mseg cache for large sbc segments erts: Reintroduce mseg options amcbf and rmcbf erts: Optimize erl_alloc_util.c by substitute MBC_BLK_SZ erts: Fix bug when allocating size near sbc_threshold erts: Make gc sizes fit into MB Carrier blocks erts: Force sbmbc to be disabled in a crude way erts: Fix new header scheme for win64 erts: Fix mseg cache. Malplaced NULL pointer erts: Remove unused mseg options amcbf and rmcbf erts: Use aligned bits as constant in mseg_alloc erts: Don't let zero be considered a power of two ... Conflicts: erts/emulator/test/process_SUITE.erl
2012-12-14erts: Clear entire mseg cache upon requestBjörn-Egil Dahlberg
2012-12-14erts: Set super alignment (256kb) and limits for sbct (8Mb) and lmbcs (128Mb)Sverker Eriksson
2012-12-14erts: Do not cache segments that are misalignedBjörn-Egil Dahlberg
* SBC may realloc carriers to misaligned addresses which is perfectly fine. However, those segments may not be cached because MBC allocations might find them and MBC's *needs* correct alignment.
2012-12-14erts: Add mseg cache for large sbc segmentsBjörn-Egil Dahlberg
* Not a power of two (unpowered) segements
2012-12-14erts: Reintroduce mseg options amcbf and rmcbfBjörn-Egil Dahlberg
Used with new sbc cache
2012-12-14erts: Fix mseg cache. Malplaced NULL pointerBjörn-Egil Dahlberg
2012-12-14erts: Remove unused mseg options amcbf and rmcbfBjörn-Egil Dahlberg
2012-12-14erts: Use aligned bits as constant in mseg_allocBjörn-Egil Dahlberg
HAVE_SUPER_ALIGNED_MB_CARRIERS is always true with mmap and thus aligned bits is a constant and so is "page" size for mmap. Conflicts: erts/emulator/sys/common/erl_mseg.h
2012-12-07Merge branch 'rickard/port-optimizations/OTP-10336' into ↵Rickard Green
rickard/r16/port-optimizations/OTP-10336 * rickard/port-optimizations/OTP-10336: Change annotate level for emacs-22 in cerl Update etp-commands Add documentation on communication in Erlang Add support for busy port message queue Add driver callback epilogue Implement true asynchronous signaling between processes and ports Add erl_drv_[send|output]_term Move busy port flag Use rwlock for driver list Optimize management of port tasks Improve configuration of process and port tables Remove R9 compatibility features Use ptab functionality also for ports Prepare for use of ptab functionality also for ports Atomic port state Generalize process table implementation Implement functionality for delaying thread progress from unmanaged threads Conflicts: erts/doc/src/erl_driver.xml erts/doc/src/erlang.xml erts/emulator/beam/beam_bif_load.c erts/emulator/beam/beam_bp.c erts/emulator/beam/beam_emu.c erts/emulator/beam/bif.c erts/emulator/beam/copy.c erts/emulator/beam/erl_alloc.c erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_message.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process_lock.c erts/emulator/beam/erl_trace.c erts/emulator/beam/export.h erts/emulator/beam/global.h erts/emulator/beam/io.c erts/emulator/sys/unix/sys.c erts/emulator/sys/vxworks/sys.c erts/emulator/test/port_SUITE.erl erts/etc/unix/cerl.src erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/src/prim_inet.erl lib/hipe/cerl/erl_bif_types.erl lib/kernel/doc/src/inet.xml lib/kernel/src/inet.erl
2012-12-06Merge branch 'maint'Ingela Anderton Andin
Conflicts: erts/emulator/sys/vxworks/sys.c erts/vsn.mk lib/ssl/src/ssl_connection.erl lib/ssl/test/ssl_basic_SUITE.erl
2012-12-03Add erl_drv_[send|output]_termRickard Green
2012-12-03Optimize management of port tasksRickard Green
2012-12-03Use ptab functionality also for portsRickard Green
2012-12-03Prepare for use of ptab functionality also for portsRickard Green
2012-12-03Atomic port stateRickard Green
2012-11-30erts: Change default of erl_crash.dumpBjörn-Egil Dahlberg
* Create an erl_crash.dump if no heart exists and no ERL_CRASH_DUMP_SECONDS is set (behaviour changed) * Don't create an erl_crash.dump if heart do exists and no ERL_CRASH_DUMP_SECONDS is set (behaviour not changed) This changes the behaviour back to the R15B02 default considering if a beam was running with no heart. The motivation is that we want a fast heart to fast restart erlang if it crashes but to be able to get non-truncated erl_crash.dumps via setting ERL_CRASH_DUMP_SECONDS if we so desire.
2012-11-28Merge branch 'sverk/crypto-unloading'Sverker Eriksson
* sverk/crypto-unloading: crypto: Link crypto_callback statically crypto: Add debug print macros crypto: Enable runtime upgrade of crypto crypto: Make unloading of crypto safer OTP-10596
2012-11-21erts: Don't let zero be considered a power of twoBjörn-Egil Dahlberg
2012-11-21erts: Use MSEG_ALIGN_BITS and MSEG_ALIGNED_SIZEBjörn-Egil Dahlberg
* Don't redfine ALIGN_BITS or ALIGNED_SIZE, the global defined MSEG_* constants are just as good.
2012-11-15erts: Add carrier pointer to header of free blockSverker Eriksson
2012-11-15erts: Move carrier alignment define to erl_msg.hSverker Eriksson
2012-11-15erts: Add carrier offset to internal allocation headersSverker Eriksson
2012-11-13erts: New mseg allocator cacheBjörn-Egil Dahlberg
* utilize the power of two
2012-11-13erts: Teach mseg alloc the value of halfword beamBjörn-Egil Dahlberg
2012-11-13erts: Let mseg allocate larger alignmentsBjörn-Egil Dahlberg
2012-10-31erts: Remove faked MSEG_ALLOCBjörn-Egil Dahlberg
* Not used except in valgrind but there mseg is disabled completely via Meamin.
2012-10-24Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: erts/etc/common/heart.c
2012-10-24Merge branch 'egil/ensure-erl_crash.dump/OTP-10422' into maintBjörn-Egil Dahlberg
* egil/ensure-erl_crash.dump/OTP-10422: test: Relax timeouts for heart_SUITE erts: Fix crash dump write to port hack erts: Fix lock check assertion doc: Document ERL_CRASH_DUMP_SECONDS behaviour test: Add test for heart restart on crash test: Add test for heart restart on crash erts: Change ERL_CRASH_DUMP_SECONDS behaviour test: Refactor away ?line macros in heart_SUITE erts: Search for heart in ports that are alive heart: Refactor heart debugging erts, heart: Ensure erl_crash.dump is written
2012-10-23erts: Fix crash dump write to port hackBjörn-Egil Dahlberg
More future proof with R16
2012-10-16erts: Change ERL_CRASH_DUMP_SECONDS behaviourBjörn-Egil Dahlberg
Not setting ERL_CRASH_DUMP_SECONDS will now terminate beam immediately on a crash without writing a crash dump file. Setting ERL_CRASH_DUMP_SECONDS to 0 will also terminate beam immediately on a crash without writing a crash dump file, i.e. same as not setting ERL_CRASH_DUMP_SECONDS environment variable. Setting ERL_CRASH_DUMP_SECONDS to a negative value will let the beam wait indefinitely on the crash dump file being written. Setting ERL_CRASH_DUMP_SECONDS to a positive value will let the beam wait that many seconds on the crash dump file being written. A positive value will set both an alarm in beam AND a heart timeout for restart if heart is running. This is due to the change of 'heart' behavior when 'heart' is listening for a crash.
2012-10-15erts, heart: Ensure erl_crash.dump is writtenBjörn-Egil Dahlberg
When a crash dump is about to be written and we have heartbeat enabled on a system. We need time to write it before heart explicitly kills the beam.
2012-10-09crypto: Make unloading of crypto saferSverker Eriksson
Facts: crypto nif-lib registers callback functions that openssl uses for memory management and thread synchronization. The callback functions can only be set once, openssl does not allow changing the callback functions. Problem: If openssl is dynamicly linked to crypto, you might get s scenario where the crypto lib is unloaded while leaving openssl loaded with its old pointers to the unloaded crypto code intact. If crypto is then reloaded (by init:restart() for example), the crypto nif-lib might get relocated at a different address. crypto calls openssl which in turn calls the old invalid callback functions...kaboom. Solution: Break apart the callback functions into a separate dynamic lib that crypto loads with dlopen. When crypto is unloaded the callback lib is left in place to be reused if/when crypto is loaded again.
2012-09-25Merge branch 'egil/r16/strengthen-buffer-copies'Björn-Egil Dahlberg
* egil/r16/strengthen-buffer-copies: Replace sprintf with erts_snprintf in beam Replace sprintf with erts_snprintf in epmd Replace sprintf with erts_snprintf in inet_gethost
2012-09-10Merge branch 'maint'Lukas Larsson
* maint: Make sure io is flushed when driver is closed
2012-09-07Replace sprintf with erts_snprintf in beamBjörn-Egil Dahlberg
2012-09-05Make sure io is flushed when driver is closedLukas Larsson
Sometime when executing an tty io operation just before the emulator terminated, the io message would get lost. This commit makes sure that there is no io in the fd driver before shutting down.
2012-08-31Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: lib/diameter/autoconf/vxworks/sed.general xcomp/README.md
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-27Merge branch 'maint'Fredrik Gustafsson
2012-08-27Merge branch 'jkl/erlsrv-graceful-shutdown/OTP-10228' into maintFredrik Gustafsson
* jkl/erlsrv-graceful-shutdown/OTP-10228: erlsrv: gracefully stop emulator on Windows shutdown
2012-08-20Merge branch 'maint'Patrik Nyblom
Conflicts: erts/doc/src/erlang.xml erts/preloaded/ebin/init.beam lib/kernel/doc/src/os.xml lib/stdlib/test/filename_SUITE.erl
2012-08-14Make get/putenv and erlexec understand UnicodePatrik Nyblom
Putenv and getenv needs to convert to the proper environment strings in Unicode depending on platform and user settings for filename encoding. Also erlexec needs to pass environment strings in an appropriate way for kernel to pick up. All environment strings on the command line, as well as home directory, is now passed in UTF8 on windows and in whatever encoding you have on Unix, kernel tries to convert all parameters and environments from UTF8 before making strings.
2012-07-31erlsrv: gracefully stop emulator on Windows shutdownJan Kloetzke
Windows will send the SERVICE_CONTROL_SHUTDOWN event to the service control handler when shutting down the system. Instead of ignoring the event, erlsrv will now invoke the stop action. Likewise, the Erlang emulator (and it's port drivers) must not quit upon reception of the CTRL_SHUTDOWN_EVENT event in the console control handler.
2012-07-19erts: Remove VxWorks sub-directoryBjörn-Egil Dahlberg
2012-07-18erts: Remove VxWorks support from beamBjörn-Egil Dahlberg
2012-06-18Revert conceptually wrong little fix as part of check_io optSverker Eriksson