Commit Graph

3145 Commits (5f7b97e84c7e2bc7682510e97996ad30147026d0)

Author SHA1 Message Date
daurnimator 8fa29bc0a2
std: fix missing operation argument to @atomicRmw 2020-11-19 00:57:35 +11:00
daurnimator eb4d93ece3
std: some more docs for std.atomic.Int 2020-11-19 00:44:38 +11:00
daurnimator 513e8161dd
std: mark std.atomic.Int as extern so it can be used in public ABIs 2020-11-19 00:41:43 +11:00
daurnimator c492ef97fd std: expose all atomic operations from std.atomic.Int 2020-11-18 15:36:40 +02:00
Vexu da84ef2a9c
make help in commands more consistent
Closes #7101

Co-authored-by: pfg <pfg@pfg.pw>
2020-11-18 13:58:27 +02:00
Alexandros Naskos 252924ae33 Added std.meta.fieldNames 2020-11-18 13:16:56 +02:00
Veikka Tuominen 6d5b76a75d
Merge pull request #7005 from jshholland/deprecate-span
Remove ArrayList.span
2020-11-18 13:14:48 +02:00
Veikka Tuominen 1e1a490600
Merge pull request #7084 from xackus/mem-volatile
std.mem: make sliceAsBytes, etc. respect volatile
2020-11-18 13:06:35 +02:00
xackus 27b73cc395 std: make meta.IntType a compile error
the function signature changed
also update langref
2020-11-18 12:57:49 +02:00
g-w1 a0226ab05b
std: openDirAbsolute and accessAbsolute (#7082)
* add more abosolutes

* added wrong files

* adding 2 tests and changing the function signatures because of lazy analysis not checking them

* fix a bug that got uncovered by lazy eval

* Add compile error when using WASI with openDirAbsolute and accessAbsolute

* typo
2020-11-18 08:42:35 +01:00
Andrew Kelley 238718b93a disable the flaky ResetEvent test
See #7009
2020-11-17 18:08:10 -07:00
Frank Denis 9c2b014ea8 std/crypto: use NAF for multi-scalar edwards25519 multiplication
Transforming scalars to non-adjacent form shrinks the number of
precomputations down to 8, while still processing 4 bits at a time.

However, real-world benchmarks show that the transform is only
really useful with large precomputation tables and for batch
signature verification. So, do it for batch verification only.
2020-11-17 17:07:32 -08:00
Frank Denis 0d9c474ecf std/crypto: implement the Hash-To-Curve standard for Edwards25519
https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve

This is quite an important feature to have since many other standards
being worked on depend on this operation.

Brings a couple useful arithmetic operations on field elements by the way.

This PR also adds comments to the functions we expose in 25519/field
so that they can appear in the generated documentation.
2020-11-17 17:06:38 -08:00
Andrew Kelley 2eee0582f8 macOS libc headers: downgrade to 10.15.7 (Catalina)
See ziglang/fetch-them-macos-headers#2 for more details. The path
forward looks like one of the following:

 * Ony provide headers for the oldest supported macOS (currently 10.13
   but soon to be bumped to 10.14).
 * Provide headers for multiple versions, and select based on the Zig
   target OS version range minimum.
 * Don't try to provide macOS headers.

If we don't tackle the version problem, we would have to re-introduce
the ability to detect and depend on native system headers if we wanted
to support C/C++ code that used newer OS definitions.

This patch also adds support for `#include <mach/mach_time.h>`.

Also related: #5236
2020-11-17 11:40:24 -08:00
Andrew Kelley e6bfa377d1 std.crypto.isap: fix callsites of secureZero 2020-11-16 18:10:41 -07:00
Frank Denis f9d209787b std/crypto: add ISAPv2 (ISAP-A-128a) AEAD
We currently have ciphers optimized for performance, for
compatibility, for size and for specific CPUs.

However we lack a class of ciphers that is becoming increasingly
important, as Zig is being used for embedded systems, but also as
hardware-level side channels keep being found on (Intel) CPUs.

Here is ISAPv2, a construction specifically designed for resilience
against leakage and fault attacks.

ISAPv2 is obviously not optimized for performance, but can be an
option for highly sensitive data, when the runtime environment cannot
be trusted.
2020-11-16 16:02:19 -08:00
Jonathan Marler 4df75645ce start.zig: call wWinMain with root's type
I have an alternative set of windows bindings I'm working on: https://github.com/marler8997/zig-os-windows.  So I'm declaring my wWinMain function with my own HINSTANCE type rather than the one from std.os.windows.  This change allows start to call wWinMain using any pointer type.
2020-11-16 16:01:18 -08:00
tgschultz 48d60834fd
Move leb128 and remove trivial *mem functions as discussed in #5588 (#6876)
* Move leb128 out of debug and remove trivial *mem functions as discussed in #5588

* Turns out one of the *Mem functions was used by MachO. Replaced with trivial use of FixedBufferStream.
2020-11-16 18:51:54 -05:00
heidezomp 9ea4ddae97 linuxWaitFd: make NetworkSubsystemFailed error unreachable
This error from os.poll is Windows-specific, so unreachable on Linux.
2020-11-16 14:03:19 -08:00
Andrew Kelley ba967ae9a1
Merge pull request #7002 from jedisct1/timingSafeEqlMinimal
Add mem.timingSafeEql() for constant-time array comparison
2020-11-16 13:39:31 -08:00
Jakub Konka cd4b54fd38 libstd: add more MachO consts and structs 2020-11-16 13:37:07 -08:00
LemonBoy 36c869dc14 std: Make windows.ReadFile allow short reads
Make it behave like the read() wrapper for unix systems.
Reading the whole buffer breaks some use-cases like buffered readers
over sockets.

Closes #7121
2020-11-16 13:35:06 -08:00
xackus 109a3ebcca std.mem: make args comptime, fix test names 2020-11-16 12:50:05 +01:00
xackus 92e45ee3a1 std.mem: make sliceAsBytes, etc. respect volatile 2020-11-14 13:59:29 +01:00
xackus c814fdbfaf std.mem: improve doc comments 2020-11-14 13:59:29 +01:00
Andrew Kelley bf03ae7acc std.fs.path.dirname: return null when input path is root
This intentionally diverges from the unix dirname command, as well as
Python and Node.js standard libraries, which all have this edge case
return the input path, unmodified. This is a footgun, and nobody should
have ever done it this way.

Even the man page contradicts the behavior. It says:
"strip last component from file name". Now consider, if you
remove the last item from an array of length 1, then you
have now an array of length 0. After you strip the last component, there
should be no components remaining. Clearly, returning the input parameter
unmodified in this case does not match the documented behavior. This is
my justification for taking a stand on this API design.

closes #6746
closes #6727
closes #6584
closes #6592
closes #6602
2020-11-13 17:36:49 -07:00
Sébastien Marie ab4b34f75f openbsd: skip tests using Dir.realpath 2020-11-13 12:30:14 -05:00
Hubert Jasudowicz bf73db71f5 std: Fix code model argument 2020-11-11 21:28:10 +02:00
Veikka Tuominen 93844a5ef9
Merge pull request #7061 from Vexu/std
std: fix HashMap.putAssumeCapacity
2020-11-11 18:50:34 +02:00
Vexu ae6f3291c0
std: fix HashMap.clearRetainingCapacity 2020-11-11 14:05:43 +02:00
Vexu f70160f89c
std: fix HashMap.putAssumeCapacity 2020-11-11 13:57:08 +02:00
Andrew Kelley 8b9195282e
Merge pull request #7044 from semarie/openbsd-simples
Simple sets of commits for OpenBSD support
2020-11-10 18:06:30 -05:00
Andrew Kelley 3110b21c4b std.Target: bump default version max for macos 2020-11-10 15:24:10 -07:00
Sébastien Marie 678bd4fc89 "ResetEvent" test seems to have a too short timeout: the test is failing randomly on OpenBSD
raise the timeout to 100ms to be sure that if it fails (timeout is returned) it is due to a real problem.
the test shouldn't be longer: it will wait more time only on failure.
2020-11-10 05:29:53 +00:00
Sébastien Marie 9d306e5c77 openbsd: mutex or cond destroy function could return EINVAL 2020-11-10 05:26:35 +00:00
Sébastien Marie 8784c7b581 openbsd: proper implementation for Thread.cpuCount() 2020-11-10 05:25:59 +00:00
Sébastien Marie 20b19d0092 openbsd: add time definitions for gettimeofday() 2020-11-10 05:24:56 +00:00
Sébastien Marie e4bc595bc6 openbsd: add sockets constants 2020-11-10 05:24:03 +00:00
Sébastien Marie 17276df488 openbsd: add dlfcn.h definitions for dlopen() 2020-11-10 05:23:13 +00:00
daurnimator 73f3f01670
Fix json parser close tracking (#6865)
* std: fix json parsing with unmatched closing tokens

* std: fix swapped json parsing errors
2020-11-09 18:29:02 -05:00
xackus 15dbab9a0c std: json: fix misleading endianness conversion 2020-11-09 18:27:07 -05:00
Frank Denis 427a212e38 Don't prevent compilation on platforms where debug info is unsupported
We don't support debug information on platforms that are not tier-1,
but it shouldn't be a hard error that completely prevents compilation.
2020-11-09 18:22:50 -05:00
Alexandros Naskos fc67e5f843 Windows TLS startup symbols are already provided by libcrt when linking against libc 2020-11-09 17:46:46 -05:00
Jakub Konka 0bc9fd5e8e
Merge pull request #7035 from ziglang/macos-posix-headers
macOS libc headers: add POSIX headers
2020-11-09 23:41:55 +01:00
Andrew Kelley 83a1523b1a std.ResetEvent: disable flaky test on Windows
See #7009
2020-11-09 15:33:40 -07:00
Jakub Konka db2ac8ae49 macOS libc headers: add objc/message.h and runtime.h 2020-11-09 19:57:07 +01:00
Jakub Konka 09cc61bfe4 Add more missing libc headers used by frameworks
See
76f22c3905.
2020-11-09 18:47:09 +01:00
Jakub Konka 267116d626 macOS libc headers: add mach/clock.h
LLVM depends on it.
2020-11-09 15:02:03 +01:00
Andrew Kelley b0cbd0ad2d macos libc headers: add more
these new files are generated by recursively including:

sysexits.h
mach/mach.h
sys/attr.h
sys/mount.h
crt_externs.h
execinfo.h

all of which are depended on by LLVM libraries.
2020-11-08 21:12:18 -08:00
Andrew Kelley cd221b9df9 macOS libc headers: add sys/sysctl.h
libcxx depends on it
2020-11-08 20:26:33 -08:00
Andrew Kelley 16b7be34a1 macOS libc headers: add sys/param.h
libcxx depends on it
2020-11-08 20:21:29 -08:00
Andrew Kelley 1213e26ba8 macOS libc headers: add mach-o/dyld.h
libcxx depends on it
2020-11-08 20:21:29 -08:00
Andrew Kelley 25e78bd007 add copyfile.h
libcxx depends on it
2020-11-08 20:21:29 -08:00
Andrew Kelley fdd775b3bf macOS libc headers: add xlocale.h and Block.h
These are both included by libcxx.
2020-11-08 20:21:29 -08:00
Andrew Kelley eed5814d75 macOS libc headers: add POSIX headers 2020-11-08 20:21:29 -08:00
Frank Denis 7f9e3e419c Use @reduce 2020-11-07 20:30:13 +01:00
Frank Denis bd07154242 Add mem.timingSafeEql() for constant-time array comparison
This is a trivial implementation that just does a or[xor] loop.

However, this pattern is used by virtually all crypto libraries and
in practice, even without assembly barriers, LLVM never turns it into
code with conditional jumps, even if one of the parameters is constant.

This has been verified to still be the case with LLVM 11.0.0.
2020-11-07 20:18:43 +01:00
Josh Holland a1ec5448c7 make ArrayList.span into a compile error 2020-11-07 11:15:47 +00:00
Josh Holland c25b157dda remove deprecated uses of ArrayList.span 2020-11-07 11:15:44 +00:00
Alexandros Naskos 5430642fa0
Merge pull request #7008 from xackus/minor-fixes
change debug.assert to testing.expect in tests
2020-11-07 11:34:51 +02:00
Andrew Kelley ceaa569bfa disable flaky file locking test on Windows
See #7010
2020-11-06 17:00:51 -07:00
Andrew Kelley c923f74fc9 std.ResetEvent: disable flaky test on macOS
See #7009
2020-11-06 16:46:30 -07:00
xackus 5c8f7f81cd change debug.assert to testing.expect in tests 2020-11-06 22:48:54 +01:00
Andrew Kelley e5fab3ba68 update musl sources to 1.2.1 2020-11-06 14:13:57 -07:00
Andrew Kelley dba94f453a update musl headers to 1.2.1 2020-11-06 13:53:47 -07:00
Jay Petacat 030f00391a std: Introduce SemanticVersion data structure
This will parse, format, and compare version strings following the
SemVer 2 specification. See: https://semver.org

Updates #6466
2020-11-06 15:07:48 -05:00
Andrew Kelley d1b1f053b0
Merge pull request #6941 from LemonBoy/floateqapprox
std: Implement more useful approxEq semantics
2020-11-06 14:09:31 -05:00
LemonBoy b9391c9564 std: Make file locking tests less fragile 2020-11-06 14:02:11 -05:00
Jeremy Huffman 9f1639a6bb
Fix std.ResetEvent.timedWait on darwin/macOS. (#6914) 2020-11-06 14:01:52 -05:00
Andrew Kelley a9e09a8be4
Merge pull request #6990 from kubkon/system-linker-hack
Re-enable system linker hack
2020-11-06 13:22:03 -05:00
Jakub Konka b7c3ebcb9e Rely on ZIG_SYSTEM_LINKER_HACK instead of input flags 2020-11-06 11:34:51 +01:00
Andrew Kelley c9551652b0
Merge pull request #6978 from LemonBoy/statshit
Decouple kernel and libc stat definitions
2020-11-05 17:27:22 -05:00
Andrew Kelley cf7505da1f
Merge pull request #6974 from daurnimator/prctl-cleanup
prctl improvements
2020-11-05 17:25:24 -05:00
Andrew Kelley f85d719952
Merge pull request #6895 from jorangreef/fallocate
linux: add fallocate()
2020-11-05 17:23:00 -05:00
Frank Denis e7b60b219b std/crypto: don't constrain Gimli hash output to a fixed length
As documented in the comment right above the finalization function,
Gimli can be used as a XOF, i.e. the output doesn't have a fixed
length.

So, allow it to be used that way, just like BLAKE3.
2020-11-05 17:21:19 -05:00
Frank Denis 2e354c387e math.shl/math.shr: add support for vectors 2020-11-05 17:20:54 -05:00
Frank Denis 73aef46f7d std.crypto: namespace constructions a bit more
With the simple rule that whenever we have or will have 2 similar
functions, they should be in their own namespace.

Some of these new namespaces currently contain a single function.

This is to prepare for reduced-round versions that are likely to
be added later.
2020-11-05 17:20:25 -05:00
Frank Denis 4417206230 Now that they support vectors, use math.rot{l,r} 2020-11-05 17:19:48 -05:00
Alexandros Naskos 3e1639c53b
Fixed mingw-w64 8.0.0 compilation
Reaplied mingw-w64 header patch
2020-11-05 20:04:25 +02:00
Jakub Konka e0e3ceac19 Re-enable system linker hack
It is now possible to force linking with system linker `ld` instead
of the LLVM `lld` linker when building natively on the target. This
can be done at each stage by specifying `--system-linker-hack` flag,
and can be useful on platforms where `lld` fails to operate properly
such as macOS 11 Big Sur on ARM64 where every binary/dylib is expected
to be codesigned.

Some example invocations for each stage of compilation of Zig
toolchain:

```
cmake .. -DCMAKE_PREFIX_PATH=/path/to/llvm -DSYSTEM_LINKER_HACK=1
```

```
build/zig build test --system-linker-hack
```

```
build/zig build --prefix $(pwd)/stage2 -Denable-llvm
--system-linker-hack
```

```
build/zig build-exe hello.zig --system-linker-hack
```
2020-11-05 18:35:51 +01:00
Alexandros Naskos 708962d51e
Updated mingw-w64 to version 8.0.0 2020-11-05 18:59:36 +02:00
LemonBoy 53c1624074 std: Make utf8CountCodepoints much faster
Make the code easier for the optimizer to work with and introduce a fast
path for ASCII sequences.

Introduce a benchmark harness to start tracking the performance of ops
on utf8.
2020-11-05 16:10:34 +01:00
LemonBoy 3a1f515e09 Address review comments 2020-11-05 16:10:34 +01:00
LemonBoy 1982e0c18a Fix typo in documentation 2020-11-05 16:10:34 +01:00
LemonBoy 0316ac959c Make std.formatBuf UTF-8 aware 2020-11-05 16:10:34 +01:00
LemonBoy 675de8d6b7 Clean up the unicode codepoint formatter a bit 2020-11-05 16:10:34 +01:00
LemonBoy 44533f10fe std: Introduce std.unicode.utf8ValidCodepoint 2020-11-05 16:10:34 +01:00
LemonBoy 6c4efab106 std: Introduce std.unicode.utf8CountCodepoints 2020-11-05 16:10:33 +01:00
LemonBoy 2cce23062b Update the API and add add error-recovery path 2020-11-05 16:10:33 +01:00
data-man 678ecc94ca Add 'u' specifier to std.format 2020-11-05 16:10:33 +01:00
LemonBoy e749ab1d63 Fix typo, remove debug leftover, rename few fns 2020-11-05 16:10:15 +01:00
LemonBoy 53433cdea2 Implement a fallback mechanism for posix_memalign
Do the alignment dance by ourselves whenever posix_memalign is not
available.
Don't try to use malloc as it has too many edge cases, figuring out
whether a block of memory is manually aligned by the mechanism above or
is directly coming from malloc becomes too hard to be valuable.
2020-11-05 16:10:15 +01:00
LemonBoy 806097c165 std: Make C allocator respect the required alignment
Use posix_memalign where available and the _aligned_{malloc,free} API on
Windows.

Closes #3783
2020-11-05 16:10:15 +01:00
LemonBoy ff14451b4a std: Implement more useful approxEq semantics
Comparisons with absolute epsilons are usually useful when comparing
numbers to zero, for non-zero numbers it's advised to switch to relative
epsilons instead to obtain meaningful results (check [1] for more
details).

The new API introduces approxEqAbs and approxEqRel, where the former
aliases and deprecated the old `approxEq`, allowing the user to pick the
right tool for the job.

The documentation is meant to guide the user in the choice of the
correct alternative.

[1] https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
2020-11-05 16:08:49 +01:00
LemonBoy cca6b11138 Label WASI stat as kernel_stat
We're using WASI syscalls, it makes sense to put the kernel_ prefix.
2020-11-05 12:44:43 +01:00
LemonBoy 0e95fa455c std: Split kernel&libc definitions of stat struct
There's no guarantee for the kernel definition to be ABI compatible with
the libc one (and vice versa).
There's also no guarantee of ABI compatibility between musl/glibc.

Fun, isn't it?
2020-11-05 09:38:50 +01:00
rageoholic e5100605e9 Add missing LONG_PTR type 2020-11-04 18:30:48 -06:00
rageoholic 04267fb1ba Fix CoInitializeEx so it can take a null pointer 2020-11-04 16:53:05 -06:00
LemonBoy 346a686b9d std: Correct stack_t definition for mips 2020-11-04 15:55:06 +01:00
LemonBoy f313c88428 std: Fix pipe syscall stub for sparc64 2020-11-04 15:54:38 +01:00
daurnimator b42ffbe9e8
std: use PR enum as only location of opcode numbers 2020-11-04 22:39:35 +11:00
daurnimator b90fb1e96b
std: add PR enum for the prctl opcode 2020-11-04 22:32:57 +11:00
daurnimator 02252f3f07
std: workaround #280 in prctl 2020-11-04 22:23:59 +11:00
Frank Denis 342ba960f7 sparc64 has a 8Kb page size 2020-11-03 17:29:20 -05:00
Andrew Kelley ede41759be std.fs.File.writeFileAll: support unseekable files
With this commit, the function tries to use more efficient syscalls, and
then falls back to non-positional reads.

The motivating use case for this change is to support something like the
following:

try io.getStdOut().writeFileAll(dest_file, .{});
2020-11-03 15:25:43 -07:00
Frank Denis 37bc6ee54a std.meta: test that const and mut variables have different addresses
We are checking that two identical, constant values, are stored at
different addresses.

But sharing a unique location doesn't look like something the compiler
wouldn't do.

It may make more sense to check that a const variable and a mutable
variable set to the same value have different addresses.
2020-11-03 16:52:51 -05:00
Andrew Kelley f2cb63c2e1
Merge pull request #6956 from jedisct1/more-gimli-be-fixes
Another big-endian fix for Gimli
2020-11-03 11:22:54 -05:00
Jakub Konka 5060497174
Merge pull request #6921 from xackus/gimmeMoreOfThoseSweetSweetFileDescriptors
stage2: ask for more file descriptors
2020-11-03 10:07:39 +01:00
Frank Denis 8d7c160fb4 Make Gimli test vector look like the python implementation 2020-11-03 09:13:14 +01:00
Joran Dirk Greef 8193f55820 Support 32-bit big-endian targets 2020-11-03 06:03:38 +02:00
Frank Denis d764636d21 Another big-endian fix for Gimli
We read and write bytes directly from the state, but in the init
function, we potentially endian-swap them.

Initialize bytes in native format since we will be reading them
in native format as well later.

Also use the public interface in the "permute" test rather than an
internal interface. The state itself is not meant to be accessed directly,
even in tests.
2020-11-03 02:01:48 +01:00
Jakub Konka 8dda64fa3e
Fix Darwin codepath
On Darwin, according to the man pages for setrlimit(), when adjusting
max number of open fds, the reported hard max by getrlimit() is only
theoretical, while the actual maximum, set in the kernel, is hardcoded
in the header file. Therefore, the reported max has to be adjusted
as `min(OPEN_MAX, lim.max)`.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-11-03 00:38:43 +01:00
LemonBoy 35a8d90e55 std: Make parseInt/parseUnsigned detect the radix 2020-11-02 14:13:06 -05:00
Andrew Kelley 00ceb592ef
Merge pull request #6932 from kubkon/fix-6318
macOS: fix linking issues on BigSur
2020-11-02 13:41:32 -05:00
Frank Denis ad9655db3a Fix Gimli for big-endian targets 2020-11-02 13:38:20 -05:00
Andrew Kelley 061ff11b2b
Merge pull request #6927 from LemonBoy/mipsbe-std
Fixes for stdlib for mips BE targets
2020-11-02 13:37:24 -05:00
Alex Cameron ecdd636605 Fix file descriptor leak in fs.openFileZ. 2020-11-02 13:28:29 -05:00
Isaac Freund 50ba018223 std/ascii: add spaces array
This may be combined with std.mem.trim to form a proper replacement for
the now deprecated std.fmt.trimWhitespace().
2020-11-02 13:20:58 -05:00
Jakub Konka 7f5c96378d Refactor the code according to Andrew's suggestions 2020-11-02 18:38:09 +01:00
Jakub Konka 317c555a5c Fix linking issues on BigSur
This commit fixes linking issue on macOS 11 BigSur by appending
a prefix path to all lib and framework search paths known as
`-syslibroot`.

The reason this is needed is that in macOS 11, the system libraries
and frameworks are no longer readily available in the filesystem.
Instead, the new macOS ships with a built-in dynamic linker cache
of all system-provided libraries, and hence, when linking with either
`lld.ld64` or `ld64`, it is required to pass in `-syslibroot [dir]`.
The latter can usually be obtained by invoking `xcrun --show-sdk-path`.
With this commit, Zig will do this automatically when compiling natively
on macOS. However, it also provides a flag `-syslibroot` which can be
used to overwrite the automtically populated value.

To summarise, with this change, the user of Zig is not required to
generate and append their own syslibroot path. Standard invocations
such as `zig build-exe hello.zig` or `zig build` for projects will
work out of the box. The only missing bit is `zig cc` and `zig c++`
since the addition of the `-syslibroot` option would be a mismatch
between the values provided by `clang` itself and Zig's wrapper.
2020-11-02 17:06:09 +01:00
LemonBoy dc872a221d std: Fix syscall stubs passing 64bit offsets for BE targets 2020-11-02 12:11:07 +01:00
LemonBoy 76e9a4ae83 std: Fix std.unicode test cases for BE targets 2020-11-02 11:48:06 +01:00
LemonBoy 02efc2236a std: Fix json utf{8,16} decoding on BE targets
Byteswap some values when LE ordering is required.
2020-11-02 11:46:50 +01:00
LemonBoy 307496fcd7 std: Re-enable ArrayHashMap test for mips targets 2020-11-02 11:46:07 +01:00
Joran Dirk Greef 78e9e131e0 Pending #5127 2020-11-02 12:37:55 +02:00
Joran Dirk Greef 067bd7e424 Switch back to writing Zig 2020-11-02 09:55:25 +02:00
Joran Dirk Greef 9dec310826 Debug unhandled errno 2020-11-02 09:52:42 +02:00
Andrew Kelley 909aae8153
Merge pull request #6792 from koachan/sparc64-linux
Initial sparc64-linux bringup
2020-11-01 22:14:56 -05:00
Andrew Kelley af60931a48
Merge pull request #6888 from jcmoyer/issues/6874
Update std.fmt docs and add test for null terminated slices with embedded null bytes
2020-11-01 18:30:09 -05:00
LemonBoy 445d808bae std: Fix early overflow in time calculation
Closes #6867
2020-11-01 17:06:14 -05:00
LemonBoy 0d6a7088dc stage1: Implement Add/Mul reduction operators 2020-11-01 14:30:31 -07:00
LemonBoy 6f3d6c1f45 std: Fix expectWithinEpsilon with negative values 2020-11-01 14:30:31 -07:00
Jakub Konka d530e7f9c7 Make std.fmt.bufPrintIntToSlice public
Deprecate `std.fmt.trim` and `std.fmt.isWhiteSpace` in favour of
`std.mem` alternatives.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-11-01 15:48:50 -05:00
xackus 6418284680 std: add {set,get}rlimit bits and improve test 2020-11-01 15:47:46 -05:00
frmdstryr 36f1788762 Add missing arg 2020-11-01 15:40:42 -05:00
Frank Denis c387f1340f std/crypto: make Hkdf functions public 2020-11-01 18:27:11 +02:00
Joran Dirk Greef c910f03a7b Swap endianness 2020-11-01 13:14:32 +02:00
Joran Dirk Greef a67f140d2f Add test 2020-11-01 11:55:27 +02:00
Joran Dirk Greef 2dd8613adc "The Traveling Wilburys' - Handle With Care"
Both `offset` and `len` are `off_t`.

Like the rest of the std lib we assume that `_FILE_OFFSET_BITS == 64`
is always true, so that `off_t` is a `u64`.

When passing to 32-bit kernels, we split these into two `u32`
parameters.
2020-11-01 11:49:08 +02:00
Joran Dirk Greef 2fdb30a571 Add definitions for FALLOC_FL_ mode flags 2020-11-01 11:47:09 +02:00
Joran Dirk Greef 888af655e0 Add libc signature 2020-11-01 11:46:08 +02:00
Joran Dirk Greef 8fd88fdb31 linux: add fallocate() 2020-10-31 13:39:33 +02:00
J.C. Moyer 788900c35c Add test for null terminated slices with embedded null bytes 2020-10-30 23:58:23 -04:00
J.C. Moyer b38dea37c7 Update doc comments to reflect current behavior 2020-10-30 23:58:23 -04:00
Travis bb6e39e274 remove extra space in .** error message 2020-10-30 21:26:05 +02:00
Andrew Kelley e59f44712d
Merge pull request #6875 from jorangreef/mips_syscalls
Add more mips syscall numbers
2020-10-30 13:31:12 -04:00
Veikka Tuominen 80dd432137
Merge pull request #6858 from travv0/no-star-after-dot-star
don't allow a token starting with an asterisk directly following .*
2020-10-30 16:08:04 +02:00
Joran Dirk Greef ab1ed93ad9 Add close_range, faccessat2 and process_madvise 2020-10-30 12:39:01 +02:00
Joran Dirk Greef 9423ed1671 Add more mips syscall numbers
As per: lib/libc/musl/arch/mips/bits/syscall.h.in

...and as promised: https://github.com/ziglang/zig/pull/6356#issuecomment-696023349

Thanks @daurnimator again for the help with #6356.
2020-10-30 11:53:45 +02:00
Koakuma 891c6ddd5f Select stat struct type based on whether we are linking with libc 2020-10-30 11:46:33 +07:00