aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common
AgeCommit message (Collapse)Author
2014-03-13erts: Fix long windows paths for compressed filesSverker Eriksson
2014-02-24Merge branch 'lukas/ose/master/OTP-11334'Lukas Larsson
* lukas/ose/master/OTP-11334: (71 commits) erts: Fix unix efile assert ose: Use -O2 when building ose: Expand OSE docs ose: Add dummy ttsl driver ose: Cleanup cleanup of mutex selection defines ose: Polish mmap configure checks ose: Add ose specific x-compile flags ose: Updating fd_driver and spawn_driver for OSE ose: Updating event and signal API for OSE ose: Cleanup of mutex selection defines win32: Compile erl_log.exe ose: Remove uneccesary define ose: Fix ssl configure test for osx erts: Fix sys_msg_dispatcher assert ose: Fix broken doc links ose: Thread priorities configurable from lmconf ose: Yielding the cpu is done "the OSE" way ose: Start using ppdata for tse key ose: Do not use spinlocks on OSE ose: Fix support for crypto ... Conflicts: lib/crypto/c_src/crypto.c
2014-02-24ose: OSE port related cleanup and fixesJonas Karlsson
Some OSE cross-chains have problems with system includes being used, so for atleast OSE specific parts we use "" instead of <>.
2014-02-24ose: efile driver updates.Jonas Karlsson
2014-02-24ose: Convert EFILE_SEEK to unistd seek for gzioLukas Larsson
This is needed because OSE does not have the same integers as unix/win32 for SEEK_ST and friends.
2014-02-24Added support for ENEA OSELukas Larsson
This port has support for both non-smp and smp. It contains a new way to do io checking in which erts_poll_wait receives the payload of the polled entity. This has implications for all linked-in drivers.
2014-02-04gzio.c: Remove unnecessary usage of the OF() macroBjörn Gustavsson
Daniel Goertzen reported that commit 8a147a7365 broke building of Erlang/OTP on Gentoo Linux because the macro OF() was missing. Apparently, on Gentoo the OF() macro in zconf.h has been renamed to _Z_OF() (to avoid polluting the global namespace). Don't use the OF() macro in gzio.c since it no longer serves any useful purpose (it provided compatibility with pre-ANSI/ISO C compilers, but the rest of Erlang/OTP requires an ANSI/ISO C compiler anyway).
2014-01-28Merge branch 'lukas/erts/sendfile_no_async_pool/OTP-11639'Lukas Larsson
* lukas/erts/sendfile_no_async_pool/OTP-11639: erts/kernel: sendfile no longer uses async threads
2014-01-27Merge branch 'lukas/erts/sendfile_passive_mode_fix/OTP-11614'Lukas Larsson
* lukas/erts/sendfile_passive_mode_fix/OTP-11614: erts: fix bug when using passive mode and sendfile
2014-01-27erts: fix bug when using passive mode and sendfileLukas Larsson
The bug incorrectly issued driver_select when un-ignoring an fd for a socket in passive mode, which caused an incorrect error tuple to be returned when the remote end closed the connection.
2014-01-27erts/kernel: sendfile no longer uses async threadsLukas Larsson
This has been done because a slow client attack is possible if the async thread pool is used. The scenario is: Client does a request for a file and then slowly receives the file one byte at a time. This will eventually fill the async thread pool with blocking sendfile operations and thus starving the vm of all file operations. If you still want to use the async threads pool for sendfile an option to enable it has been introduced.
2014-01-14Don't make gzio.c dependent on the zutil.h header fileBjörn Gustavsson
gzio.c is our own replacement for zlib's gzopen() etc (based on a version of gzio.c that was included in an old version of zlib). Unfortunately, gzio.c still depends on the *internal* zlib header file zutil.h which is not supposed to be used outside of the zlib source code. The dependencies are the use of the gzFile typedef and the F_OPEN() macro. Instead of gzFile, define and use our own ErtsGzFile. To get rid of the F_OPEN() macro, call open() of _wfopen() directly.
2013-12-13erts: Fix compiler warningSverker Eriksson
2013-11-29Merge branch 'sv/file-osync/OTP-11498'Lukas Larsson
* sv/file-osync/OTP-11498: Add sync option to file:open/2 Conflicts: erts/preloaded/ebin/prim_file.beam
2013-11-26Merge branch 'maint'Raimo Niskanen
Conflicts: erts/preloaded/ebin/prim_inet.beam lib/kernel/test/gen_sctp_SUITE.erl
2013-11-26Merge branch 'maint-r16' into maintRaimo Niskanen
2013-11-20Suppress false valgrind warnings caused by sctp_getpaddrsSverker Eriksson
2013-11-15Add sync option to file:open/2Joseph Blomstedt
The sync option adds the POSIX O_SYNC flag to the open system call on platforms that support the flag or its equivalent, e.g., FILE_FLAG_WRITE_THROUGH on Windows. For platforms that don't support it, file:open/2 returns {error, enotsup} if the sync option is passed in. The semantics of O_SYNC are platform-specific. For example, not all platforms guarantee that all file metadata are written to the disk along with the file data when the flag is in effect. This issue is noted in the documentation this commit adds for the sync option. Add a test for the sync option. Note however that the underlying OS semantics for O_SYNC can't be tested automatically in any practical way, so the test assumes the OS does the right thing with the flag when present. For manual verification, dtruss on OS X and strace on Linux were both run against beam processes to watch calls to open(), and file:open/2 was called in Erlang shells to open files for writing, both with and without the sync option. Both the dtruss output and the strace output showed that the O_SYNC flag was present in the open() calls when sync was specified and was clear when sync was not specified.
2013-11-11Clean up address family handling towards ErlangRaimo Niskanen
2013-11-07Implement prim_inet:socknames/1,2 and prim_inet:peernames/1,2Raimo Niskanen
2013-10-15Merge branch 'maint'Sverker Eriksson
Conflicts: erts/preloaded/ebin/erlang.beam
2013-09-30erts: Refactor the ASSERT macroSverker Eriksson
Introduce unconditional ERTS_ASSERT and use that for both ASSERT and ASSERT_EXPR.
2013-09-23add {active,N} socket option for TCP, UDP, and SCTPSteve Vinoski
Add the {active,N} socket option, where N is an integer in the range -32768..32767, to allow a caller to specify the number of data messages to be delivered to the controlling process. Once the socket's delivered message count either reaches 0 or is explicitly set to 0 with inet:setopts/2 or by including {active,0} as an option when the socket is created, the socket transitions to passive ({active, false}) mode and the socket's controlling process receives a message to inform it of the transition. TCP sockets receive {tcp_passive,Socket}, UDP sockets receive {udp_passive,Socket} and SCTP sockets receive {sctp_passive,Socket}. The socket's delivered message counter defaults to 0, but it can be set using {active,N} via any gen_tcp, gen_udp, or gen_sctp function that takes socket options as arguments, or via inet:setopts/2. New N values are added to the socket's current counter value, and negative numbers can be used to reduce the counter value. Specifying a number that would cause the socket's counter value to go above 32767 causes an einval error. If a negative number is specified such that the counter value would become negative, the socket's counter value is set to 0 and the socket transitions to passive mode. If the counter value is already 0 and inet:setopts(Socket, [{active,0}]) is specified, the counter value remains at 0 but the appropriate passive mode transition message is generated for the socket. This commit contains a modified preloaded prim_inet.beam due to changes in prim_inet.erl. Add tests for {active,N} mode for TCP, UDP, and SCTP sockets. Add documentation for {active,N} mode for inet, gen_tcp, gen_udp, and gen_sctp.
2013-09-05Merge branch 'raimo/fix-signedness-flaws-in-efile_drv' into maintRaimo Niskanen
* raimo/fix-signedness-flaws-in-efile_drv: Fix EV_* macros and functions signedness flaws
2013-09-04Merge branch 'raimo/linux-network-namespace-sockopt/OTP-11157' into maintRaimo Niskanen
* raimo/linux-network-namespace-sockopt/OTP-11157: Document socket option 'netns' Rudimentary test Make netns option value a string Implement netns for SCTP + bugfixes Implement netns option for TCP and UDP Implement emulator netns support for TCP and UDP
2013-09-02Fix EV_* macros and functions signedness flawsRaimo Niskanen
2013-08-23Create better distribution of files over async threadsPatrik Nyblom
The actual port id is used to create a key from the pointer value which is the ErlDrvPort. To do this a new driver api function driver_async_port_key is added and the driver API minor version is updated. The documentation is updated and the faulty description of how to spread ports over async threads is updated to use the new API. Testcase also added.
2013-08-23Add debug functionality to retrieve async keyPatrik Nyblom
2013-08-20erts: Fix bug in translating ev macros to functionsLukas Larsson
2013-08-13erts: Refactor non-pure macros to functionsLukas Larsson
This is needed as some gcc versions seems to optimize this undefined behaviour in a way which breaks this code.
2013-07-17Implement netns for SCTP + bugfixesRaimo Niskanen
2013-07-17Implement emulator netns support for TCP and UDPRaimo Niskanen
2013-06-12Update copyright yearsBjörn-Egil Dahlberg
2013-05-31kernel: Fix bug in file:pwrite for large data setsSverker Eriksson
Bug introduced in a73414d2e8ad03538 and never released.
2013-05-16Merge branch 'rickard/inet_opts/OTP-11075' into maintRickard Green
* rickard/inet_opts/OTP-11075: Make high_msgq_watermark and low_msgq_watermark generic inet options Conflicts: erts/preloaded/ebin/prim_inet.beam
2013-05-06Make high_msgq_watermark and low_msgq_watermark generic inet optionsRickard Green
2013-03-27Merge branch 'lukas/erts/efile_delayed_write_fix/OTP-10984' into maintLukas Larsson
* lukas/erts/efile_delayed_write_fix/OTP-10984: Do driver_deq in worker threads instead of async_ready
2013-03-13Do driver_deq in worker threads instead of async_readyLukas Larsson
Doing it in async_ready was needed before the pdl was introduced, but now with the pdl the deq no longer needs the port lock to protect it. This was not an issue when async_ready was called in the worker thread, but now (R15B) that it is signalled back to the scheduler, some very nasty race conditions could occur when using driver_timer and async jobs.
2013-03-04erts: Fix void * arithmeticBjörn-Egil Dahlberg
2013-03-04erts: gcc ansi does not allow 'inline'Björn-Egil Dahlberg
2013-03-04erts: Use block comments - ansi styleBjörn-Egil Dahlberg
2013-02-22Merge branch 'egil/win-efile-bugfix/OTP-10890'Björn-Egil Dahlberg
* egil/win-efile-bugfix/OTP-10890: erts: Use correct type for ReadFile bytes read
2013-02-22Update copyright yearsBjörn-Egil Dahlberg
2013-02-22erts: Use correct type for ReadFile bytes readBjörn-Egil Dahlberg
Using a 64bit type for bytes read will not always clear the higher bits.
2013-02-21Merge branch 'sverk/tcp-exit_on_close-false'Sverker Eriksson
* sverk/tcp-exit_on_close-false: inet_drv: Fix condition to reject INET_REQ_IGNOREFD for UDP and SCTP A stab at fixing bug with {exit_on_close,false} not working
2013-02-15invoke_read_line now remembers read_ahead settingsLukas Larsson
2013-02-11erts: Fix memory leak in efile_drv.cSverker Eriksson
Seems to happen with async threads and when user closes the file explicitly before the port is closed.
2013-02-07inet_drv: Fix condition to reject INET_REQ_IGNOREFD for UDP and SCTPSverker Eriksson
2013-01-29A stab at fixing bug with {exit_on_close,false} not workingSverker Eriksson
when invalid packets are received.
2013-01-25Merge branch 'pan/fix-compiler-warnings-clang-and-new-gcc'Patrik Nyblom
* pan/fix-compiler-warnings-clang-and-new-gcc: Fix compiler warnings from GCC 4.7.1 on ARCH Linux Fix clang compiler warnings on FreeBSD in erts