aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
AgeCommit message (Collapse)Author
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-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.
2010-05-19Merge branch 'dp/shell-line-editing' into devErlang/OTP
* dp/shell-line-editing: Readline-style line edit history OTP-8635 dp/shell-line-editing The shell's line editing has been improved to more resemble the behaviour of readline and other shells. (Thanks to Dave Peticolas)
2010-04-29Merge branch 'ks/kernel' into devErlang/OTP
* ks/kernel: kernel: Clean up as suggested by tidier OTP-8606 ks/kernel
2010-04-28kernel: Clean up as suggested by tidierKostis Sagonas
2010-04-19code:clash/0: match correct return value from erl_prim_loader:list_dir/1Tuncer Ayaz
erl_prim_loader:list_dir/1 returns error on failure and not {error,_}. Also update tests in code_SUITE:clash/1. Defect was introduced with fix for listing .ez archives in 49da83de4b. Initial code:clash/0 tests added in 79194d5fa7. Signed-off-by: Tuncer Ayaz <[email protected]>
2010-04-14Merge branch 'jb/inet6-dist' into devErlang/OTP
* jb/inet6-dist: Support IPv6 addresses in long host names Fix implementation of IPv6 TCP distribution protocol Fix compilation of epmd with IPv6 enabled OTP-8575 jb/inet6-dist
2010-04-13Support IPv6 addresses in long host namesJohn-Mark Bell
When distributing over IPv4, node@<IPv4-address> (e.g. [email protected]) works correctly. Permit node@<IPv6-address> (e.g. node@::1) when distributing over IPv6.
2010-03-23Fix implementation of IPv6 TCP distribution protocolJohn-Mark Bell
TCP distribution over IPv6 did not work. The TCP socket was forcibly closed before any communication could take place. The following changes resolve this: * Make the kernel use the inet6 variant of accept. * Use inet6 variants of TCP socket functions. * Ensure that the inet6 address family is used in all cases.
2010-03-19OTP-8527 Global no longer supports R11B nodesHans Bolinder
As of this version, the global name server no longer supports nodes running Erlang/OTP R11B.
2010-03-10OTP-8502 os:cmd hangRickard Green
A race condition in os:cmd/1 could cause the caller to get stuck in os:cmd/1 forever.
2010-03-09Readline-style line edit historyDave Peticolas
Change the shell's line buffer mechanism to more closely match readline-based shells. New behavior: 1. Blank lines are not added to the line buffer. 2. Pressing the down arrow on the last line causes no change. The previous behavior erased the line. 3. The new line is temporarily added to the line buffer so the user can move to previous lines with up arrows and then back to the new line with down arrows. The previous behavior discarded the partially written new line. 4. Changes made to previous lines while exploring the line buffer history are preserved. The previous behavior discarded changes made to older lines.
2010-03-09Merge branch 'ks/types' into devErlang/OTP
* ks/types: file.hrl: Move out type declarations kernel: Add types and specs OTP-8494 ks/types
2010-03-07file.hrl: Move out type declarationsKostis Sagonas
Having various type declarations in the file.hrl file was once upon a time necessary since the system could not really handle remote types. Now it can and these declarations should not be there but appear in file.erl instead. This means that files that need to use these types can refer to them using a remote type reference, and not having to include file.hrl - at least not for this reason.
2010-03-07kernel: Add types and specsKostis Sagonas
2010-02-14file.erl: Add a type to be used from other modulesKostis Sagonas
2010-02-10OTP-8418 user.erl (used in oldshell) is updated to handle unicode inPatrik Nyblom
prompt strings (io:get_line/{1,2}). io_lib is also updated to format prompts with the 't' modifier (i.e. ~ts instead of ~s).
2010-02-10Support the configure option --enable-native-libsKostis Sagonas
2010-02-10Merge branch 'mp/hipe_unified_loader' into ccase/r13b04_devErlang/OTP
* mp/hipe_unified_loader: hipe_unified_loader: only block SMP scheduling when necessary
2010-02-10Merge branch 'rani/inet_gethostbyname_fixes' into ccase/r13b04_devErlang/OTP
* rani/inet_gethostbyname_fixes: inet_res_SUITE: testcase fixes for legacy DNS resolver (Solaris 8) inet_res: /etc/resolv.conf: use domain as default search list inet: delayed/avoided read of /etc/resolv.conf and /etc/hosts inet_gethost_native: workaround for empty result hostname on MacOS X inet_res_SUITE: testcase fix for empty domain name inet:gethostbyname improved to parse IP strings and look up own hostname OTP-8426 The resolver routines failed to look up the own node name as hostname, if the OS native resolver was erroneously configured, bug reported by Yogish Baliga, now fixed. The resolver routines now tries to parse the hostname as an IP string as most OS resolvers do, unless the native resolver is used. The DNS resolver inet_res and file resolver inet_hosts now do not read OS configuration files until they are needed. Since the native resolver is default, in most cases they are never needed. The DNS resolver's automatic updating of OS configuration file data (/etc/resolv.conf) now uses the 'domain' keyword as default search domain if there is no 'search' keyword.
2010-02-09inet_res: /etc/resolv.conf: use domain as default search listRaimo Niskanen
When the search list option in /etc/resolv.conf was empty, the domain option was not used as default search domain. That has been fixed in this patch.
2010-02-09inet: delayed/avoided read of /etc/resolv.conf and /etc/hostsRaimo Niskanen
The 'file' and 'dns' lookup methods configuration files are now read and parsed at the time of the first lookup instead of at boot time when per default none of these lookup methods are used.
2010-02-09inet_gethost_native: workaround for empty result hostname on MacOS XRaimo Niskanen
On MacOS X the getaddrinfo function apparently can return a result without canonical hostname e.g when looking up a IPv6 address string as hostname. The receiving erlang code was not prepared for that and this patch does a workaround by using the search string as default value for canonical hostname.
2010-02-09inet:gethostbyname improved to parse IP strings and look up own hostnameRaimo Niskanen
Now inet:gethostbyname tries to parse the hostname as an IP string first if the 'native' lookup method is not used. One can also make the IP string parsing explicit using the new 'string' lookup method, or avoid it using the new pseudo lookup method 'nostring'. In R13B04 a bug was introduced when the gethostbyname code was rewritten, so if the native resolver was used and misconfigured to not be able to look up the own hostname, inet:gethostbyname also failed. This is now fixed.
2010-02-09hipe_unified_loader: only block SMP scheduling when necessaryMikael Pettersson
This avoids costly scheduling changes during module loading if native code is disabled in erts, or not present in the module being loaded. Signed-off-by: Mikael Pettersson <[email protected]>
2010-02-08Merge branch 'sc/sctp-connect-nowait' into ccase/r13b04_devErlang/OTP
* sc/sctp-connect-nowait: Implement a non-blocking SCTP connect OTP-8414 There are new gen_sctp:connect_init/* functions that initiate an SCTP connection without blocking for the result. The result is delivered asynchronously as an sctp_assoc_change event. (Thanks to Simon Cornish.)
2010-02-06Implement a non-blocking SCTP connectSimon Cornish
This patch adds a new set of functions - gen_sctp:connect_init/* that initiate an SCTP connection without blocking for the result. The result is delivered asynchronously as an sctp_assoc_change event. The new functions have the same API as documented for gen_sctp:connect/* with the following exceptions: * Timeout is only used to supervise resolving Addr (the peer address) * The possible return values are ok | {error, posix()} The caller application is responsible for receiving the #sctp_assoc_change{} event and correctly determining the connect it originated from (for example, by examining the remote host and/or port). The application should have at least {active, once} or use gen_sctp:recv to retrieve the connect result. The implementation of gen_sctp:connect suffers from a number of shortcomings which the user may avoid by using gen_sctp:connect_init and adding code to receive the connect result. First, irrespective of the Timeout value given to gen_sctp:connect, the OS attempts and retries the SCTP INIT according to various kernel parameters. If the Timeout value is shorter than the entire attempt then the application will still receive an sctp_assoc_change event after the {error, timeout} is returned from the initial call. This could be somewhat confusing (either to the application or the designer!) especially if the status is comm_up. Subsequent calls to connect before the OS has finished this process return {error, ealready} which may also be counter-intuitive. Second, there is a race-condition (documented in comments in inet_sctp.erl) that can cause the wrong sctp_assoc_change record to be returned to an application calling gen_sctp:connect. The race seriously affects connection attempts when using one-to-many sockets.
2010-02-05Fix handling of archive (.ez) files in code:clash/0Tuncer Ayaz
code:clash/0 did not take into account .ez files when listing contents of code path entries. Using erl_prim_loader:list_dir/1 instead of file:list_dir/1 fixes the problem. Signed-off-by: Tuncer Ayaz <[email protected]>
2010-01-31kernel/src/Makefile: fix broken 'clean' targetBjörn Gustavsson
2010-01-27fix hipe loader SMP non-atomicity errorMikael Pettersson
Loading native code is a multi-step operation that needs to be atomic, but the HiPE loader failed to ensure that. This caused corruption of runtime system structure in some cases. Fix by blocking multi_scheduling around main loader entry points. Signed-off-by: Mikael Pettersson <[email protected]>