| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* io: make file descriptors non-inheritable by default
This prevents file descriptors/handles leakage to child processes
that might cause issues like running out of file descriptors, or potential
security issues like leaking a file descriptor to a restricted file.
While this breaks backward compatibility, I'm rather certain that not
many programs (if any) actually make use of this implementation detail.
A new API `setInheritable` is provided for the few that actually want to
use this functionality.
* io: disable inheritance at file creation time for supported platforms
Some platforms provide extension to fopen-family of functions to allow
for disabling descriptor inheritance atomically during File creation.
This guards against possible leaks when a child process is spawned
before we managed to disable the file descriptor inheritance
(ie. in a multi-threaded program).
* net, nativesockets: make sockets non inheritable by default
With this commit, sockets will no longer leak to child processes when
you don't want it to. Should solves a lot of "address in use" that might
occur when your server has just restarted.
All APIs that create sockets in these modules now expose a `inheritable`
flag that allow users to toggle inheritance for the resulting sockets.
An implementation of `setInheritance()` is also provided for SocketHandle.
While atomically disabling inheritance at creation time is supported on
Windows, it's only implemented by native winsock2, which is too much for
now. This support can be implemented in a future patch.
* posix: add F_DUPFD_CLOEXEC
This command duplicates file descriptor with close-on-exec flag set.
Defined in POSIX.1-2008.
* ioselectors_kqueue: don't leak file descriptors
File descriptors internally used by ioselectors on BSD/OSX are now
shielded from leakage.
* posix: add O_CLOEXEC
This flag allows file descriptors to be open() with close-on-exec flag
set atomically.
This flag is specified in POSIX.1-2008
* tfdleak: test for selectors leakage
Also simplified the test by using handle-type agnostic APIs to test for
validity.
* ioselectors_epoll: mark all fd created close-on-exec
File descriptors from ioselectors should no longer leaks on Linux.
* tfdleak: don't check for selector leakage on Windows
The getFd proc for ioselectors_select returns a hardcoded -1
* io: add NoInheritFlag at compile time
* io: add support for ioctl-based close-on-exec
This allows for the flag to be set/unset in one syscall. While the
performance gains might be negliable, we have one less failure point
to deal with.
* tfdleak: add a test for setInheritable
* stdlib: add nimInheritHandles to restore old behaviors
* memfiles: make file handle not inheritable by default for posix
* io: setInheritable now operates on OS file handle
On Windows, the native handle is the only thing that's inheritable, thus
we can assume that users of this function will already have the handle
available to them. This also allows users to pass down file descriptors
from memfiles on Windows with ease, should that be desired.
With this, nativesockets.setInheritable can be made much simpler.
* changelog: clarify
* nativesockets: document setInheritable return value
* posix_utils: atomically disable fd inheritance for mkstemp
|
|
|
|
|
|
|
|
|
|
| |
* posix: add full Haiku support
This commit provides a posix_haiku derived from posix_other, with types
following Haiku's definition. This fixes cases where the compiler
generates type check for the wrong types (ie. checks where generated for
an int-derived type but it's actually implemented as an uint instead).
* tools/kochdocs: welcome posix_haiku to the blacklist
|
| |
|
| |
|
| |
|
|
|
|
| |
* Add more Docs and runnableExamples
|
| |
|
|
|
|
|
|
|
|
|
| |
(#13370)
* Add sideEffect pragma to procs in winlean
* Add sideEffect pragma to procs in posix
* Add test for #13306
* Add sideEffect pragma to procs in times
* Fixes #13306
|
| |
|
|
|
|
| |
getLastModificationTime) (#12794)
|
|
|
|
|
|
| |
* Fix #12135 and fix #12109 - fix OpenBSD type defs
* Fix Mode definition as in #12132
|
| |
|
| |
|
|
|
|
|
|
| |
Note that contrary to what docgen.rst currently says, the ids have
to match exactly or else most web browsers will not jump to the
intended symbol.
|
| |
|
|
|
|
|
| |
* fixes #12119
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
--styleCheck:error
|
| |
|
| |
|
|
|
| |
Used template within example was added to imports.
|
|
|
|
|
|
| |
* lib/posix: Define SO_REUSEPORT for sparc64 as 0x0200 from kernel ABI
* lib/system: Add platform support for sparc64
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove NaN/Inf/NegInf magic
* Make range checks in semConv
* fix the failing line
* fix `firstOrd` and `lastOrd`
* fix `localError`
* remove debug comment
* Cleanup, fix failing test
* make tests green
|
| |
|
| |
|
| |
|
|\
| |
| | |
Added CMSG_SPACE and CMSG_LEN macros to posix.nim
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
| |
Fixes #9008
|
|
|
|
|
| |
The change is technically correct but requires too much type juggling
and the effort outweighs the gains.
|
|
|
|
|
|
|
| |
The only way to make this work for both abstract and non-abstract
sockets is to send the kernel an incomplete structure.
Reported by Epictek on the forum.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* posix_other: Haiku now has spawn.h
This is added per https://dev.haiku-os.org/ticket/13446
* posix_other: Add Haiku specific Dirent members
* cpuinfo: Add an implementation for Haiku
* distros: Add basic Haiku support
* encodings: update Haiku support
* fenv, math: Haiku now provides libm
* times: Add Haiku struct members
* ansi_c, osalloc: Add Haiku constants
* threads: Add Haiku support
* testament: Haiku uses LIBRARY_PATH
* nim.cfg: Update Haiku support
libnetwork should only be linked if network functions are used
* threads: Haiku does not support -pthread switch
* tworkingdir: Haiku's env is in /bin
* posix_other: add SIGKILLTHR for Haiku
* sockets: link with libnetwork on Haiku
* coro: correct ucontext.h location
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/ucontext.h.html
* coro: ucontext backend is not available on Haiku
Haiku doesn't provide the <ucontext.h> header, as it was removed from POSIX
* coro: fix setjmp backend
The compiler does not allow statements after a noreturn function
* nativesockets: Haiku doesn't support AI_V4MAPPED
* system: hostOS can contains "haiku"
* os: add support for Haiku's packagefs
packagefs is read-only, but there are writable holes to the underlying
file system as well
* os: update constant for Haiku
|
|
|
|
| |
115200 is really common. I'd like to get support in nimserial, but
I'm guessing it would help to have support in the stdlib first.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* deprecate `0c`, `0C` prefix for octal literals
Deprecates the previously allowed syntax of `0c` and `0C` as a prefix for
octal literals to bring the literals in line with the behavior of
`parseOct` from parseutils.
* add `msgKind` arg to `lexMessageLitNum` for deprecation messages
* change literal tests to check all valid integer literals
Also adds the `tinvaligintegerlit3` test to test for the (still)
invalid `0O` prefix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add config section for Nintendo Switch
* Add compiler configuration for Nintendo Switch and it's CPU
* Add specific lib code for Nintendo Switch
* Add GC support for Nintendo Switch
* Update changelog for Nintendo Switch
* Update changelog with more info about fixed paths
* Cleaned up GC memory management a bit
* Relocate docs for Switch
* Rename aarch64NoneElfGcc to nintendoSwitchGCC
* Remove armv8a57
* Fix installer.ini
* Reuse code in linux and amd64
* Add posix defs for nintendo switch
* Add more defined sections for nintendo switch
* Remove old comment
* Add what's not supported for Nintendo Switch docs
* Make nintendoswitch == posix
* Remove DEVKITPRO references from nim.cfg
* Make PR extccomp changes
* Remove Result type alias
* Add separate switch consts file
* Update docs for nintendo switch
* Fix travis errors with undefined consts and add correct wait.h procs
|
| |
|
| |
|
| |
|
|
|
|
| |
allocation (#7564)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* First work on better timezones
* Update tests to new api.
Removed tests for checking that `isDst` was included when formatting, since `isDst` no longer affects utc offset (the entire utc offset is stored directly in `utcOffset` instead).
* Deprecate getLocaltime & getGmTime
* Add `now()` as a shorthand for GetTIme().inZone(Local)
* Add FedericoCeratto's timezone tests (#6548)
* Run more tests in all timezones
* Make month enum start at 1 instead of 0
* Deprecate getDayOfWeekJulian
* Fix issues with gc safety
* Rename TimeInfo => DateTime
* Fixes #6465
* Improve isLeapYear
* FIx handling negative adjTime
* Cleanup:
- deprecated toSeconds and fromSeconds, added fromUnix and toUnix instead (that returns int64 instead of float)
- added missing doc comments
- removed some unnecessary JS specific implementations
* Fix misstake in JS `-` for Time
* Update usage of TimeEffect
* Removed unecessary use of `difftime`
* JS fix for local tz
* Fix subtraction of months
* Fix `days` field in `toTimeInterval`
* Style and docs
* Fix getDayOfYear for real this time...
* Fix handling of adding/subtracting time across dst transitions
* Fix some bad usage of the times module in the stdlib
* Revert to use proper time resoultion for seeding in random.nim
* Move deprecated procs to bottom of file
* Always use `epochTime` in `randomize`
* Remove TimeInterval normalization
* Fixes #6905
* Fix getDayOfWeek for year < 1
* Export toEpochDay/fromEpochDay and change year/month/monthday order
* Add asserts for checking that the monthday is valid
* Fix some remaining ambiguous references to `Time`
* Fix ambiguous reference to Time
|