Commit Graph

428 Commits

Author SHA1 Message Date
emekoi
3ff9ab332c fixed type signature 2019-01-11 09:56:37 -06:00
emekoi
51fff9fa82 fixed initializer and typos 2019-01-11 09:56:36 -06:00
emekoi
35d93d22db removed nullables 2019-01-11 09:56:36 -06:00
emekoi
9385127052 changed pointer types 2019-01-11 09:56:35 -06:00
emekoi
bb31695fbf fixed mutex on windows 2019-01-11 09:56:35 -06:00
emekoi
207fa3849c moved to InitializeCriticalSection to init 2019-01-11 09:56:34 -06:00
emekoi
25d7f5b654 switching back to EnterCriticalSection 2019-01-11 09:56:34 -06:00
emekoi
aaae2f5705 switching from EnterCriticalSection to TryEnterCriticalSection 2019-01-11 09:56:33 -06:00
emekoi
b61bce254c added mutex for windows 2019-01-11 09:56:32 -06:00
Marcio
5f26d1dddb freebsd: fix wrong call to clock_getres (#1871)
Reported-by: daurnimator
2019-01-05 13:34:47 -05:00
Marcio Giaxa
5c2a1055a0 freebsd: add sockaddr structs 2019-01-04 16:31:57 -05:00
Marcio Giaxa
4d9547ff2e freebsd: implement clock related functions
- clock_gettime
 - clock_getres
2019-01-04 16:31:57 -05:00
Marcio Giaxa
1e781a30f6 freebsd: add clock const definitions 2019-01-04 16:31:57 -05:00
Andrew Kelley
d8b6fa9134
Merge pull request #1859 from mgxm/fbsd2
Progress towards tier 1 support for FreeBSD x86_64
2018-12-29 12:49:23 -05:00
Andrew Kelley
a918ce26b8
fixups 2018-12-26 15:25:54 -05:00
Marcio Giaxa
52be7d7404 freebsd: fix flags for opening files
Prior to this fix, the compare-outputs test suite was showing a strange
behavior, the tests always stopped between tests 6-8 and had a stack track
similar to each other.

```
Test 8/68 compare-output multiple files with private function (ReleaseSmall)...OK
/usr/home/mgxm/dev/zig/zig-cache/source.zig:7:2: error: invalid token: '&'
}&(getStdOut() catch unreachable).outStream().stream;
 ^
The following command exited with error code 1:

```

With the wrong O_* flags, the source code was being written in append mode which
resulted in an invalid file

```zig
use @import("foo.zig");
use @import("bar.zig");

pub fn main() void {
	foo_function();
	bar_function();
}&(getStdOut() catch unreachable).outStream().stream;
	stdout.print("OK 2\n") catch unreachable;
}

fn privateFunction() void {
	printText();
}
```
2018-12-24 11:45:55 -02:00
Marcio Giaxa
de473d4423
freebsd: implement std.os.time.sleep 2018-12-24 10:27:08 -02:00
nebulaeonline
fdea12b2d9 msvc subsystem option handling; added uefi os type 2018-12-23 22:44:02 -05:00
Marcio Giaxa
682815f6e9
freebsd: remove syscall and use libc
Use libc interface for:
 - getdents
 - kill
 - openat
 - setgid
 - setuid
2018-12-23 23:30:31 -02:00
Marcio Giaxa
773bf80133 Merge branch 'master' into fbsd2 2018-12-23 23:21:59 -02:00
Andrew Kelley
0eba5b6744
I observed open() return EBUSY on linux
when trying to open for writing a tty fd that is already opened with
screen
2018-12-21 19:50:21 -05:00
Marcio Giaxa
a6f33e3dc5
freebsd: add realpath to freebsd/index.zig 2018-12-20 21:05:31 -02:00
Marcio Giaxa
46a0f60e4c
freebsd: use realpath() to resolve symbolic links 2018-12-20 20:57:58 -02:00
Greg V
76efc462e7 Add preadv/pwritev on FreeBSD 2018-12-20 23:55:44 +03:00
Marcio Giaxa
9900f94afe freebsd: use sysctl to get the current executable path
FreeBSD doesn't mount procfs as default on the base system, so we can't
depend on it to get the current path, In this case, we use sysctl(3) to
retrieves the system information and get the same information.

 - CTL_KERN: High kernel limits

 - KERN_PROC: Return selected information about specific running
   processes.

 - KERN_PROC_PATHNAME: The path of the process

 - Process ID: a process ID of -1 implies the current process.
2018-12-19 18:42:00 -02:00
Marcio Giaxa
1811e7e6c9 freebsd: remove getrandom dependency from libc
The system call getrandom(2) just landed on FreeBSD 12, so if we want to
support some earlier version or at least FreeBSD 11, we can't depend on
the system call.
2018-12-19 18:42:00 -02:00
Marcio Giaxa
11ced4f99d freebsd: use libc interface instead system calls
Remove all syscalls references

 * dup2()
 * chdir()
 * execve()
 * fork()
 * getcwd()
 * isatty()
 * readlink()
 * mkdir()
 * mmap()
 * munmap()
 * read()
 * rmdir()
 * symlink()
 * pread()
 * write()
 * pwrite()
 * rename()
 * open()
 * close()
 * lseek()
 * exit()
 * unlink()
 * waitpid()
 * nanosleep()
 * setreuid()
 * setregid()
 * raise()
 * fstat()
 * pipe()
 * added pipe2() extern c fn
2018-12-19 18:42:00 -02:00
Marcio Giaxa
0273fbf710 freebsd: add access 2018-12-19 18:42:00 -02:00
Marcio Giaxa
5ea37f6e8c freebsd: add getdirentries 2018-12-19 18:41:59 -02:00
Marcio Giaxa
666b153144 freebsd: remove syscall files 2018-12-19 18:41:40 -02:00
Andrew Kelley
fff6e47125
fixups 2018-12-13 17:13:10 -05:00
Andrew Kelley
457f03e37d
Merge branch 'windows-wide-imports' of https://github.com/suirad/zig into suirad-windows-wide-imports 2018-12-13 15:57:24 -05:00
Andrew Kelley
7417f2e4b3
freebsd: fix issues with syscalls 2018-12-13 00:33:13 -05:00
Andrew Kelley
d770333827
freebsd: fix os_self_exe_path function and update std lib 2018-12-12 22:28:15 -05:00
Andrew Kelley
b883bc873d
breaking API changes to all readInt/writeInt functions & more
* add `@bswap` builtin function. See #767
 * comptime evaluation facilities are improved to be able to
   handle a `@ptrCast` with a backing array.
 * `@truncate` allows "truncating" a u0 value to any integer
   type, and the result is always comptime known to be `0`.
 * when specifying pointer alignment in a type expression,
   the alignment value of pointers which do not have addresses
   at runtime is ignored, and always has the default/ABI alignment
 * threw in a fix to freebsd/x86_64.zig to update syntax from
   language changes
 * some improvements are pending #863

closes #638
closes #1733

std lib API changes
 * io.InStream().readIntNe renamed to readIntNative
 * io.InStream().readIntLe renamed to readIntLittle
 * io.InStream().readIntBe renamed to readIntBig
 * introduced io.InStream().readIntForeign
 * io.InStream().readInt has parameter order changed
 * io.InStream().readVarInt has parameter order changed
 * io.InStream().writeIntNe renamed to writeIntNative
 * introduced io.InStream().writeIntForeign
 * io.InStream().writeIntLe renamed to writeIntLittle
 * io.InStream().writeIntBe renamed to writeIntBig
 * io.InStream().writeInt has parameter order changed
 * mem.readInt has different parameters and semantics
 * introduced mem.readIntNative
 * introduced mem.readIntForeign
 * mem.readIntBE renamed to mem.readIntBig and different API
 * mem.readIntLE renamed to mem.readIntLittle and different API
 * introduced mem.readIntSliceNative
 * introduced mem.readIntSliceForeign
 * introduced mem.readIntSliceLittle
 * introduced mem.readIntSliceBig
 * introduced mem.readIntSlice
 * mem.writeInt has different parameters and semantics
 * introduced mem.writeIntNative
 * introduced mem.writeIntForeign
 * mem.writeIntBE renamed to mem.readIntBig and different semantics
 * mem.writeIntLE renamed to mem.readIntLittle and different semantics
 * introduced mem.writeIntSliceForeign
 * introduced mem.writeIntSliceNative
 * introduced mem.writeIntSliceBig
 * introduced mem.writeIntSliceLittle
 * introduced mem.writeIntSlice
 * removed mem.endianSwapIfLe
 * removed mem.endianSwapIfBe
 * removed mem.endianSwapIf
 * added mem.littleToNative
 * added mem.bigToNative
 * added mem.toNative
 * added mem.nativeTo
 * added mem.nativeToLittle
 * added mem.nativeToBig
2018-12-12 20:35:04 -05:00
Andrew Kelley
a40d160a5c
introduce std.io.SeekableStream
Relevant #764

dwarf debug info is modified to use this instead of std.os.File
directly to make it easier for bare metal projects to take advantage
of debug info parsing
2018-12-02 18:36:18 -05:00
Suirad
cf266ff80a Update tests 2018-11-30 02:15:33 -06:00
Suirad
e8e6ae57d4 Find CI env variables 2018-11-30 02:08:34 -06:00
Suirad
1fa2217c10 Simplify implementation 2018-11-30 02:08:34 -06:00
Suirad
24592d0216 Add more padding to parse buffer 2018-11-30 02:08:34 -06:00
Suirad
0abd5520bd Platform specific tests 2018-11-30 02:08:34 -06:00
Suirad
5dfca87a65 Update windows imports 2018-11-30 02:08:33 -06:00
Josh Wolfe
11e8afb37c fix child_process piped streams not getting closed 2018-11-28 18:33:55 -05:00
Andrew Kelley
dd2450b1b2
tier 2 support for freebsd 2018-11-27 20:56:43 -05:00
Andrew Kelley
e3bf40742d
Merge branch 'master' into freebsd2 2018-11-27 20:36:44 -05:00
Andrew Kelley
4d747d452f
update zen os std lib for latest zig changes 2018-11-24 16:51:52 -05:00
Andrew Kelley
56a8f2b018
fix @intCast not catching negative numbers to unsigned 2018-11-24 14:36:16 -05:00
Andrew Kelley
b953e322a8
std.os.path.realC: make overflow more clearly impossible 2018-11-21 13:41:10 -05:00
Andrew Kelley
bb3ac177a8
fix incorrect buf len 2018-11-20 12:37:42 -05:00
Andrew Kelley
4dafdc00d5
zig fmt 2018-11-19 17:28:18 -05:00