Commit Graph

187 Commits

Author SHA1 Message Date
alaviss
bcb6d9a763 posix_other: add define to force time_t to 64 bit [backport] (#14753)
This is a temporary remedy for time_t transition to 64 bit on newer
Linux libc (musl >= 1.2.0, glibc >= 2.32).

In the future we might want to move away from libc, or figure out a way
to reliably detect the real size of C types at compile time, both of
which are difficult.

(cherry picked from commit c8554ebc0c)
2020-06-24 06:55:56 +02:00
Juan Carlos
46ca19ff18 Deprecate DCE:on (#13839) 2020-04-02 02:58:43 +02:00
Juan Carlos
9102ac8c7d Documentation and Code Style inotify (#13836) 2020-04-02 01:05:55 +02:00
Juan Carlos
4816984726 Documentation, add more examples (#13825) 2020-04-01 19:39:58 +02:00
Juan Carlos
42d2c3088e Add Documentation (#13811)
* Add more Docs and runnableExamples
2020-03-31 15:47:57 +02:00
Hiroki Noda
86b9435138 Add EPOLLEXCLUSIVE (#13718) 2020-03-21 22:52:44 +01:00
Tomohiro
2a4aa24620 Add sideEffect pragma to importC procs in posix, winlean and time module (#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
2020-02-08 20:09:49 +01:00
Federico Ceratto
1c001fe583 Add link to posix_utils.html in posix.nim (#13111) 2020-01-12 13:36:37 +01:00
Timothee Cour
3383985c44 osx: support nanosecond resolution for file stat (eg getLastModificationTime) (#12794) 2019-12-04 08:12:55 +01:00
Euan
7e689873e2 Fix #12135 and #12109 (#12137)
* Fix #12135 and fix #12109 - fix OpenBSD type defs

* Fix Mode definition as in #12132
2019-11-11 16:18:08 +01:00
Arne Döring
99078d80d7 introduce csize_t instead of fixing csize (#12497) 2019-10-31 19:18:12 +01:00
Nindaleth
34dbc5699e fix several typos in documentation and comments (#12553) 2019-10-30 09:08:45 +01:00
Jjp137
93461aee34 Fix many broken links
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.
2019-10-22 17:59:12 -07:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
pgkos
5a8fddf29b Fix mode_t posix definitions (fixes #12119) (#12132)
* fixes #12119
2019-09-06 20:15:07 +02:00
Araq
dd7dd1b6dc styleCheck fixes [bugfix] 2019-07-15 13:16:02 +02:00
Araq
ad67a46e5d styleCheck fixes [bugfix] 2019-07-15 12:03:21 +02:00
Araq
52cbd0c558 styleCheck fixes [bugfix] 2019-07-15 10:56:55 +02:00
Araq
87a2ced1ba there is only one style -- my style 2019-07-10 19:17:06 +02:00
Araq
bc7733827d make more parts of the stdlib compile with --styleCheck:error 2019-07-10 15:48:30 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
Jacek Sieka
9e7d885f35 dynlib: use posix module (#11623) 2019-07-08 09:14:35 +02:00
Andreas Rumpf
02b9af2f75 ABI fixes for OSX/BSD; fixes #6860 (#11666) 2019-07-06 13:00:29 +02:00
Akito13
0a501932c2 Corrected example shown in documentation (#11654) [ci skip]
Used template within example was added to imports.
2019-07-04 15:59:29 +02:00
John Paul Adrian Glaubitz
5c5df61071 Additional platform definitions for sparc64 (#11387)
* lib/posix: Define SO_REUSEPORT for sparc64 as 0x0200 from kernel ABI

* lib/system: Add platform support for sparc64
2019-06-03 08:20:00 +02:00
Oscar Nihlgård
de5c0d3aa9 Make range checks in semConv (#7164)
* 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
2019-05-10 11:10:11 +02:00
Federico Ceratto
7d7cd69070 Improved posix module, added new posix_utils module (#10723) 2019-02-28 23:03:49 +01:00
c-blake
b2a5195e92 Add a standard Rusage type definition and wait4, getrusage declarations (#10484) 2019-01-29 21:25:08 +01:00
Federico Ceratto
2fa35126b0 Fix getAddrInfo, add IPPROTO_ICMPV6 Closes #10198 2019-01-06 20:23:44 +00:00
Andreas Rumpf
88dcad7c01 Merge pull request #9862 from zevv/posix-cmsg
Added CMSG_SPACE and CMSG_LEN macros to posix.nim
2018-12-05 08:11:27 +01:00
Ico Doornekamp
c37fdbf843 Added CMSG_SPACE and CMSG_LEN macros to posix.nim 2018-12-04 21:17:22 +01:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Sebastian Schmidt
621ef18478 inject sig from anonymous proc instead of for loop 2018-09-24 23:49:13 +02:00
Vindaar
4c6382a334 fix posix.onSignal example, inject current signal as s 2018-09-24 11:21:45 +02:00
LemonBoy
a27429304e Convert *_family fields to cushort
Fixes #9008
2018-09-19 12:33:11 +02:00
LemonBoy
62e3579655 Fix regression due to type change
The change is technically correct but requires too much type juggling
and the effort outweighs the gains.
2018-09-16 20:29:45 +02:00
LemonBoy
a2a06d43f2 Fix connectUnix/bindUnix with abstract socket paths
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.
2018-09-15 20:43:08 +02:00
LemonBoy
2c8361bd39 Constant folding for integer casts (#8095) 2018-08-31 13:45:42 +02:00
alaviss
7ef268274f Haiku support for Nim (#8542)
* 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
2018-08-14 09:35:07 +02:00
Jeff Ciesielski
f8723cd1e3 Add extended baud rates to posix/termios (#8322)
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.
2018-07-16 15:15:47 -04:00
Vindaar
681d8e0749 Deprecate 'c', 'C' prefix for octal literals, fixes #8082 (#8178)
* 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.
2018-07-03 01:56:36 +02:00
Joey
559a7615ad Nintendo switch support (#8069)
* 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
2018-06-27 12:35:09 +02:00
Oscar Nihlgård
05b447374b Use higher time resolution when available in os.nim (#7709) 2018-06-04 14:56:56 +02:00
Jacek Sieka
72dfe176f5 remove dead code elimination option (#7669) 2018-04-23 11:02:38 +02:00
Oscar Nihlgård
fdf1d12380 Change type of Timeval.tv_sec to posix.Time (#7646) 2018-04-18 21:24:28 +02:00
aguspiza
63160855aa Move RLimit and getrlimit to posix.nim and add setrlimit to easily limit FD allocation (#7564) 2018-04-12 17:42:33 +02:00
Jacek Sieka
9e51e737b6 RLIMIT_NOFILE as posix const 2018-04-01 20:17:32 +08:00
Dominik Picheta
22cc7c62e5 Fixes times module compilation on cpp backend. (#7004) 2018-01-03 12:46:55 +01:00
GULPF
a879973081 Better times module (#6552)
* 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
2017-12-18 23:11:28 +01:00
Dominik Picheta
d3394be555 Async upcoming (#6585)
* Merge upcoming async with current.
* Various improvements to selectors (mostly docs).

Two changes to highlight:

* Renamed ``setEvent`` to ``trigger``
* Reused setBlocking from nativesockets.
* Various changes/fixes to asyncdispatch after upcoming merge.
* Make some attempts to be compatible with older selectors.
* Reuse epoll module in ioselectors_epoll.
2017-11-22 15:43:10 +01:00