aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
AgeCommit message (Collapse)Author
2010-12-03Merge branch 'ks/erl_bif_types-cleanup/OTP-8961' into devPatrik Nyblom
* ks/erl_bif_types-cleanup/OTP-8961: Fix type information of 'file' and 'code' modules Conflicts: lib/hipe/cerl/erl_bif_types.erl
2010-11-30Corrected testcases broken by unicode filenamesPatrik Nyblom
Also corrected type-info for bifs
2010-11-30Teach file to accept codepoints beyond 255.Patrik Nyblom
2010-11-30Handle binary file names and conversion of unicode stringsPatrik Nyblom
2010-11-29Teach filename to accept raw data and add filename enc option to emuPatrik Nyblom
2010-11-29Fix type information of 'file' and 'code' modulesKostis Sagonas
Dialyzer for a long time now has had hard-coded type information about key functions of the 'file' and 'code' modules in 'erl_bif_types'. Some of this information was not up-to-date according to the published Erlang/OTP documentation, while some other part contained small errors. Now that specs are available, this information should be moved to the corresponding files, not be hard-coded in erl_bif_types. This change takes out all information for the 'file' module and fixes some small errors in type information for the 'code' module.
2010-11-26Merge branch 'ta/fix-native-looping' into devBjörn Gustavsson
* ta/fix-native-looping: error_handler: add no_native compiler directive
2010-11-22Merge branch 'ks/file_open-mode' into devBjörn Gustavsson
* ks/file_open-mode: Add the {encoding, _} options to file:open/2's modes
2010-11-09Implement basic inet:getifaddrs/0Raimo Niskanen
2010-10-21Merge branch 'maint-r14' into devBjörn Gustavsson
* maint-r14: Prepare release Fix that the documentation top index generator can handle an Ericsson internal application group Teach -init_debug to print info about on_load handlers begin run Fix hang in on_load handlers in embedded mode Conflicts: erts/vsn.mk lib/kernel/vsn.mk
2010-10-20Fix hang in on_load handlers in embedded modeBjörn Gustavsson
In embedded mode, all on_load handlers will be called after loading all modules but before starting any servers. Therefore, if an on_load handler calls any function in the code module that calls the code server (such as code:priv_dir/1), there will be a deadlock because the code server has not yet been started. Fix this problem by invoking the on_load handlers after having started most servers in the kernel application.
2010-10-14Add the {encoding, _} options to file:open/2's modesKostis Sagonas
Although the {encoding, encoding()} set of options is documented in the manual page of the 'file' module, they do not appear in the Mode description on that page nor in the mode() type declaration. The patch adds this information in both the code of the module and the documentation of the module. To avoid duplication, the declaration of the encoding() type is added to the 'unicode' module where it most probably belongs. While at it, added a proper declaration for posix(), took out the now superfluous information about the types of file:open/2 from the erl_bif_types module, and corrected the return type of file:open/2 so that it corresponds to the published documentation.
2010-10-05error_handler: add no_native compiler directiveTuncer Ayaz
As suggested by Mikael Pettersson: "I agree there _may_ be a recursion between the native-traps-to-beam mechanism and the error_handler module. However, the real problem is that the chosen mechanism (point to target MFA's BEAM code) isn't flexible enough to handle newer features like on_load or (apparently) a native-mode error_handler. My planned fix is to make remote calls link to the target's Export* instead, just like BEAM does, which should solve the problems. This will however require HiPE to use different kinds of trap-to-beam stubs for remote and local calls, since local calls must not and often cannot go via Export entries. A simpler workaround for the error_handler issue (which I couldn't reproduce) is to just never compile error_handler to native code. It's not like there's a lot to gain by doing that. Please try the patch below." Patch has been tested and confirmed to make --enable-native-libs useable. Signed-off-by: Mikael Pettersson <[email protected]> Acked-by: Tuncer Ayaz <[email protected]>
2010-09-13Merge branch 'pan/epmd-vulnerabilities/OTP-8780' into devPatrik Nyblom
* pan/epmd-vulnerabilities/OTP-8780: Teach testcases to survive TIME_WAIT overload Update erl_interface doc and testsuite for epmd changes Restore null termination of input buffer Teach testcase epmd_SUITE:too_large to accept econnaborted Teach epmd_cli.c to not respond 'Killed' when killing denied Calculate minimal packet size for ALIVE2 requests correctly Document epmd and it's options properly and fixup help text Fix anomalies in epmd not yet reported as security issues Remove two buffer overflow vulnerabilities in EPMD Remove all support for ancient EPMD protocol Remove very old protocol from EPMD Conflicts: lib/erl_interface/src/epmd/epmd_port.c
2010-09-10Remove warnings for clashes with new autoimported BIFsPatrik Nyblom
2010-09-07Merge branch 'ph/auto_recognize_ipv6' into devBjörn Gustavsson
* ph/auto_recognize_ipv6: Add tests Let an 8-tuple given as ip_address() for gen_tcp/gen_udp/gen_sctp imply 'inet6' OTP-8822
2010-09-06Let an 8-tuple given as ip_address() for gen_tcp/gen_udp/gen_sctp imply 'inet6'Per Hedeland
Currently an 8-tuple representing an IPv6 address is not accepted by gen_tcp:listen/2, gen_tcp:connect/3,4, gen_udp:open/2, or gen_sctp:open/1,2, unless the 'inet6' option is also given. This means that an application that has obtained the address, e.g. from configuration that allows for either IPv4 or IPv6, must always check the type of the address before passing it to these functions. Letting the functions infer 'inet6' from the 8-tuple, in case other options do not override this choice, improves usability.
2010-09-02Merge branch 'maint-r13' into devHans Bolinder
Conflicts: lib/kernel/doc/src/notes.xml lib/kernel/vsn.mk
2010-09-02Merge branch 'rani/sctp-sndrcvinfo/OTP-8795' into devRaimo Niskanen
* rani/sctp-sndrcvinfo/OTP-8795: Fix xfer_active close expection for Solaris behaviour Keep default #sctp_sndrcvinfo{} fields on gen_sctp:send/4 Fill in sinfo_assoc_id in struct sctp_sndrcvinfo for getopt() Conflicts: lib/kernel/test/gen_sctp_SUITE.erl
2010-08-31Keep default #sctp_sndrcvinfo{} fields on gen_sctp:send/4Raimo Niskanen
2010-08-31Remove all support for ancient EPMD protocolPatrik Nyblom
2010-08-25Fix a bug that could cause the net_kernel process to crash.Hans Bolinder
A bug introduced in kernel-2.13.5.3 has been fixed. If running net_kernel:set_net_ticktime/1 twice within the TransitionPerod the second call caused the net_kernel process to crash with a badmatch.
2010-08-20kernel: Patch 1124Hans Bolinder
OTP-8686 A bug introduced in kernel-2.13.5.3 has been fixed.
2010-08-20kernel: Patch 1121Hans Bolinder
OTP-8643 Under certain circumstances the net kernel could hang. (Thanks to Scott Lystig Fritchie.)
2010-08-20kernel: Patch 1109Rickard Green
OTP-8502 A race condition in <c>os:cmd/1</c> could cause the caller to get stuck in <c>os:cmd/1</c> forever.
2010-07-28Load native code for modules loaded before the code serverPaul Guyot
When configuring erlang with --enable-native-libs, some core modules are compiled with hipe, yet because they are loaded before the code server, their native code is not loaded. The fix consists in quietly trying to load the native code for all loaded modules just after the code server is started.
2010-07-07Merge branch 'ks/auth-specs' into devRaimo Niskanen
* ks/auth-specs: auth: Fix types and specs
2010-06-09Merge branch 'pan/otp_8698_file_typespecs' into devErlang/OTP
* pan/otp_8698_file_typespecs: Change typespecs for file.erl to match reality
2010-06-09auth: Fix types and specsKostis Sagonas
2010-06-08Change typespecs for file.erl to match realityPatrik Nyblom
2010-06-08OTP-8686 Bugfix net_kernelHans Bolinder
A bug introduced in kernel-2.13.5.3 has been fixed.
2010-06-07Merge branch 'ms/file-exclusive-mode' into devErlang/OTP
* ms/file-exclusive-mode: Update preloaded modules Support opening files in exclusive mode OTP-8670 ms/file-exclusive-mode There is a new option 'exclusive' to file:open/2 that uses the OS O_EXCL flag where supported to open the file in exclusive mode.
2010-06-04Support opening files in exclusive modeMichael Santos
Add an option that atomically tests for the existence of a file and creates it if the file does not exist, by passing the O_EXCL flag to open() on Unix and CREATE_NEW flag on Windows. Support for O_EXCL varies across platforms and filesystems. {ok, Fd} = file:open("/tmp/foo", [write,exclusive]), {error, eexist} = file:open("/tmp/foo", [write,exclusive]).
2010-06-03kernel: Add declaration for exported typesKostis Sagonas
2010-06-03Merge branch 'pan/otp_8611_standard_io' into devErlang/OTP
* pan/otp_8611_standard_io: Teach file:write/read/read_line about named io_servers OTP-8611 file:write,read and read_line on named io_device() The file module's functions write,read and read_line now handles named io_servers like 'standard_io' and 'standard_error' correctly.
2010-06-03Merge branch 'pan/otp_3626_win_find_executable' into devErlang/OTP
* pan/otp_3626_win_find_executable: Teach os.erl to find executable names with extension (i.e. .exe) on windows OTP-3626 os:find_executable bug on Windows os:find_executable can now be fed with the complete name of the executable on Windows and still find it. I.e os:find_executable("werl.exe") will work as os:find_executable("werl").
2010-06-02Teach os.erl to find executable names with extension (i.e. .exe) on windowsPatrik Nyblom
2010-06-02Merge branch 'am/net_kernel_catchall' into devErlang/OTP
* am/net_kernel_catchall: Add catch all handle_call to net_kernel
2010-06-02Merge branch 'rn/resolver-leaking-ports' into devErlang/OTP
* rn/resolver-leaking-ports: Resolver: make inet_dns decode ugly truncated reply Resolver: stop inet_res leaking ports OTP-8652 inet_res leaking ports The kernel DNS resolver was leaking one or two ports if the DNS reply could not be parsed or if the resolver(s) caused noconnection type errors. Bug now fixed. A DNS specification borderline truncated reply triggering the port leakage bug has also been fixed.
2010-06-01Add catch all handle_call to net_kernelAntonio SJ Musumeci
Of the core networking apps only net_kernel fails to have a catchall for unknown gen_server:call messages causing it to exit and eventually bring down kernal_sup and beam if it had not been manually started. For stability and consistancy it has been altered to include a catchall which does not reply.
2010-06-01Teach file:write/read/read_line about named io_serversPatrik Nyblom
2010-06-01OTP-8643 Improvements of net_kernelHans Bolinder
Under certain circumstances the net kernel could hang. (Thanks to Scott Lystig Fritchie.)
2010-06-01Merge branch 'bg/dist_utils' into devErlang/OTP
* bg/dist_utils: dist_utils: Eliminate crash when list_to_existing_atom/1 fails
2010-06-01Resolver: make inet_dns decode ugly truncated replyRaimo Niskanen
Bugfix: a DNS reply with the truncation bit set containing misleading section length (i.e header claimed length greater than what was actually in the reply section) in the header caused decode error in inet_dns.
2010-06-01Resolver: stop inet_res leaking portsRaimo Niskanen
Bugfix: when all nameservers return a reply causing decode errors or when errors enetunreach or econnrefused occured while contacting them, one or two UDP ports was leaked i.e left open and forgotten.
2010-06-01dist_utils: Eliminate crash when list_to_existing_atom/1 failsBjörn Gustavsson
In the following scenario list_to_existing_atom/1 may crash during handshake: Start a node in one window: erl -sname adam@localhost Start another node in another window: erl -sname bertil In this node, ping the first node (use the actual hostname in the command): net:ping(adam@hostname). There will be an error report similar to: =ERROR REPORT==== 27-May-2010::15:03:14 === Error in process <0.40.0> on node 'bertil@hostname' with exit value: {badarg,[{erlang,list_to_existing_atom, ["adam@localhost"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]} Eliminate the crash and the error report by catching the call to list_to_existing_atom/1 and do a clean shutdown if it fails.
2010-05-31OTP-8653 pg2: bug fixHans Bolinder
When exchanging groups between nodes pg2 did not remove duplicated members. This bug was introduced in R13B03 (kernel-2.13.4).
2010-05-24Merge branch 'fm/file-operations' into devErlang/OTP
* fm/file-operations: Update preloaded modules Add file:advise/4 - a wrapper to the POSIX syscall posix_fadvise Add file:datasync/1 for syncing file contents only sys.h: Correct the get_int64() macro OTP-8637 fm/file-operations The functions file:advise/4 and file:datasync/1 have been added. (Thanks to Filipe David Manana.)
2010-05-20Add file:advise/4 - a wrapper to the POSIX syscall posix_fadviseFilipe David Manana
Useful for informing the Operating System about the access pattern for a file's data, so that it can adapt the caching strategy to maximize disk IO performance.
2010-05-20Add file:datasync/1 for syncing file contents onlyFilipe David Manana
file:datasync/1 invokes the POSIX system call "int fdatasync(int fd)". This system call is similar to "fsync" but, unlike fsync, it does not update the metadata associated with the file (like the access time for example). It's used by many DBMSs (MySQL and SQLite of example) to increase disk IO performance, as it avoids disk seeks and disk write operations compared to fsync. More details on it at: http://linux.die.net/man/2/fdatasync An example, from the MySQL source: http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1-telco-6.1/annotate/head%3A/mysys/my_sync.c#L61 This new function just calls fsync on systems not implementing fdatasync.