aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
AgeCommit message (Collapse)Author
2016-06-08Remove internal state BOUND from inet_drvRaimo Niskanen
2016-06-02Merge branch 'saleyn/uds/PR-612/OTP-13572'Raimo Niskanen
* saleyn/uds/PR-612/OTP-13572: AF_UNIX is more portable
2016-06-02AF_UNIX is more portableRaimo Niskanen
Fix dialyzer warning for improper list in prim_inet by not using an improper list.
2016-06-02Merge branch 'saleyn/uds/PR-612/OTP-13572'Raimo Niskanen
* saleyn/uds/PR-612/OTP-13572: Rewrite inet* for address family 'local' Rewrite inet_drv for AF_LOCAL Assign externally open fd to gen_tcp (UDS support) Conflicts: erts/preloaded/ebin/prim_inet.beam lib/kernel/doc/src/gen_tcp.xml lib/kernel/doc/src/gen_udp.xml lib/kernel/src/inet6_sctp.erl lib/kernel/test/inet_SUITE.erl
2016-06-01Rewrite inet_drv for AF_LOCALRaimo Niskanen
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-07Merge branch 'bjorn/erts/huge-file-fix/OTP-13461'Björn Gustavsson
* bjorn/erts/huge-file-fix/OTP-13461: Handle multi-giga byte writes to files
2016-04-04Handle multi-giga byte writes to filesBjörn Gustavsson
Test cases that write 4Gb to a file at once would fail on OS X and FreeBSD. By running a simple test program on OS X (El Capitan 10.11.4/Darwin 15.4.0), I found that writev() can handle more than 4Gb of data, while write() only can handle less than 2Gb. (Note that efile_drv.c will use write() if there is only one element in the io vector, and writev() if there is more than one.) It is tempting to attempt to piggy-back on the existing mechanism for segmenting write operations in efile_drv.c, but because of the complex code I find it too dangerous, both from a correctness and performance perspective. Instead do the change in unix_efile.c, which is considerably simpler.
2016-03-31Refactor time_t in efile_drvBjörn-Egil Dahlberg
2016-03-30erts: Fix "hanging" VM caused by exiting tty_sl driverSverker Eriksson
Bug introduced on master in a31eab5469b7740d.
2016-03-15Fix ttsl_drv logging without TERMCAPBjörn-Egil Dahlberg
2016-03-15update copyright-yearHenrik Nord
2016-03-15Merge branch 'egil/fix-fdatasync-mac/OTP-13411'Björn-Egil Dahlberg
* egil/fix-fdatasync-mac/OTP-13411: erts: Use fcntl(fd, F_FULLFSYNC) instead of fdatasync on Mac OSX
2016-03-15erts: Use fcntl(fd, F_FULLFSYNC) instead of fdatasync on Mac OSXBjörn-Egil Dahlberg
The syscall fdatasync does not work as intended on Mac OSX. Both the function fsync and fdatasync now uses fcntl(fd, F_FULLFSYNC) on Mac OSX.
2016-03-14erts: Increase ttsl_drv logging capabilitiesBjörn-Egil Dahlberg
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-02Merge branch 'maint'Rickard Green
* maint: Fix inet driver multi timers using new time API
2016-02-02Merge branch 'rickard/tcp-accept-tmo-bug/OTP-13254' into maintRickard Green
* rickard/tcp-accept-tmo-bug/OTP-13254: Fix inet driver multi timers using new time API
2016-01-27Merge branch 'maint'Lukas Larsson
* maint: erts: Fix sendfile:ing of large files on FreeBSD
2016-01-27Merge branch 'theom/freebsd-sendfile-patch-2/OTP-13271' into maintLukas Larsson
* theom/freebsd-sendfile-patch-2/OTP-13271: erts: Fix sendfile:ing of large files on FreeBSD
2016-01-27erts: Fix sendfile:ing of large files on FreeBSDJP
If the file was larger than the OS send buffer the call would fail before this patch.
2016-01-27Merge branch 'maint'Lukas Larsson
* maint: efile_drv: logic error in compressed file write
2016-01-21Fix inet driver multi timers using new time APIRickard Green
2016-01-12Assign externally open fd to gen_tcp (UDS support)Serge Aleynikov
When a AF_LOCAL file descriptor is created externally (e.g. Unix Domain Socket) and passed to `gen_tcp:listen(0, [{fd, FD}])`, the implementation incorrectly assigned the address family to be equal to `inet`, which in the inet_drv driver translated to AF_INET instead of AF_LOCAL (or AF_UNIX), and an `einval` error code was returned. This patch fixes this problem such that the file descriptors of the `local` address family are supported in the inet:fdopen/5, gen_tcp:connect/3, gen_tcp:listen/2, gen_udp:open/2 calls
2015-12-20efile_drv: logic error in compressed file writeMikael Pettersson
Compiling OTP 18.2.1 with gcc-5.3 shows the following warning: drivers/common/efile_drv.c:1538:23: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] The code in question is: if (! (status = erts_gzwrite((ErtsGzFile)d->fd, iov[i].iov_base, iov[i].iov_len)) == iov[i].iov_len) { d->errInfo.posix_errno = d->errInfo.os_errno = errno; /* XXX Correct? */ break; } If we hoist the assignment out of the if for clarity, it becomes: status = erts_gzwrite(..., iov[i].iov_len); if (! status == iov[i].iov_len) { ...; break; } iov_len is > 0 here, and status will equal iov_len if erts_gzwrite succeeded, but will be less than iov_len if an error occurred. "! status" is 0 or 1, which can only equal iov_len if iov_len is 1 and erts_gzwrite detected an error and returned 0. The effect of this mistake is that any error when iov_len >= 2 will skip the conditional code and break statement. In particular, partial writes (0 < status && status < iov_len) will not be flagged as errors. All releases since OTP R8B-0 are affected. The variable "status" is really a boolean, which is to be set to zero on error. The fix is to set status to 1 if erts_gzwrite() returned iov_len and 0 otherwise, and to change the condition to "if (! status) ...". I'm also hoisting the assignment out of the condition since it obscures the code while providing not benefit (the condition in a while or for loop would be a different matter).
2015-12-04Merge branch 'maint'Henrik Nord
2015-12-04Merge branch 'maint-17' into maintHenrik Nord
Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/kernel/doc/src/notes.xml lib/kernel/src/kernel.appup.src lib/kernel/vsn.mk lib/ssl/doc/src/notes.xml lib/ssl/src/ssl.appup.src lib/ssl/src/ssl_cipher.erl lib/ssl/vsn.mk otp_versions.table
2015-11-27Merge branch 'maint'Sverker Eriksson
2015-11-27Merge branch 'sverk/cpool_fetch-dc_list-fix' into maintSverker Eriksson
OTP-13147 * sverk/cpool_fetch-dc_list-fix: erts: Reduce alloc_SUITE:rbtree runtime for valgrind erts: Remove double free in efile_drv erts: Improve alloc_SUITE:migration test erts: Pass free mem and build type to alloc_SUITE tests erts: Fix snprintf in alloc_SUITE for windows erts: Workaround for strange crash on win64 in alloc_SUITE test code erts: Refactor alloc_SUITE to use NIFs instead of drivers erts: Add enif_getenv erts: Make key argument constant for erl_drv_{get|put}env erts: Add alloc_SUITE:migration erts: Add TEST allocator erts: Fix confusion of callbacks destroying_mbc() vs remove_mbc() erts: Fix resurrection of carriers from dc_list
2015-11-26erts: Remove double free in efile_drvSverker Eriksson
That double free is probably very seldom invoked as the port is already gone leading to free_data being called instead of file_async_ready.
2015-11-19Fix error propagate from setoptsRaimo Niskanen
2015-10-26erts: Add {line_delimiter, byte()} option to inet:setopts/2Serge Aleynikov
A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'.
2015-10-26Update primary bootstrapIngela Anderton Andin
2015-10-26erts: Add {line_delimiter, byte()} option to inet:setopts/2Serge Aleynikov
A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'.
2015-09-17Merge branch 'maint'Rickard Green
* maint: erts: Make sure to deal with EINTR write failures
2015-09-17Merge branch 'lukas/erts/ttsl_eintr/OTP-12987' into maintRickard Green
* lukas/erts/ttsl_eintr/OTP-12987: erts: Make sure to deal with EINTR write failures
2015-09-16erts: Make sure to deal with EINTR write failuresLukas Larsson
2015-09-10Merge branch 'maint'Ingela Anderton Andin
2015-09-10Merge branch 'sverk/inet-packet-ssl_tls-passive' into maintSverker Eriksson
* sverk/inet-packet-ssl_tls-passive: erts: Fix inet packet mode ssl_tls for passive mode
2015-09-09Merge branch 'maint'Rickard Green
* maint: Add configure switch --disable-saved-compile-time Fix ethread events with timeout Improve choice of clock sources at build time
2015-09-07erts: Fix inet packet mode ssl_tls for passive modeSverker Eriksson
Caused stack corruption leading to VM crash on windows. {packet,ssl_tls} is undocumented by the way.
2015-08-27Fix ethread events with timeoutRickard Green
Lots of pthread platforms unnecessarily falled back on the pipe/select solution. This since we tried to use the same monotonic clock source for pthread_cond_timedwait() as used by OS monotonic time. This has been fixed on most platforms by using another clock source. Darwin can however not use pthread_cond_timedwait() with monotonic clock source and has to use the pipe/select solution. On darwin we now use select with _DARWIN_UNLIMITED_SELECT in order to be able to handle a large amount of file descriptors.
2015-08-20Merge branch 'maint'Henrik Nord
Conflicts: OTP_VERSION erts/vsn.mk
2015-08-18erts: Fix binary memory leak in ttsl driverLukas Larsson
2015-07-10ose: Remove all code related to the OSE portLukas Larsson
The OSE port is no longer supported and this commit removed it and any changes related to it. The things that were general improvements have been left in the code.
2015-06-24erts: Remove HALFWORD_HEAP definitionBjörn-Egil Dahlberg
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-17Merge branch 'nybek/fix_so_linger_zero__simple'Raimo Niskanen
* nybek/fix_so_linger_zero__simple: Update prim_inet.beam Fix socket option {linger, {true, 0}} to abort TCP connections Apply 'show_econnreset' socket option to send errors as well Add 'show_econnreset' TCP socket option
2015-06-09Fix socket option {linger, {true, 0}} to abort TCP connectionsRory Byrne
Up until now, if {linger, {true, 0}} is set on the socket and there is data in the port driver queue, the connection is not aborted until the port queue is empty and close() is called on the underlying file descriptor. This bug allows an idle TCP client to prevent a server from terminating the connection and freeing resources. This patch fixes the problem by discarding the port queue if the socket is closed when {linger, {true, 0}} is set.