OILS / doc / portability.md View on Github | oils.pub

83 lines, 50 significant
1---
2default_highlighter: oils-sh
3---
4
5Portability
6===========
7
8What does your platform need to run Oils?
9
10These are some notes that supplement [INSTALL](INSTALL.html).
11
12<div id="toc">
13</div>
14
15## Issues in the core of Oils
16
17### libc - `FNM_EXTMATCH` is not in POSIX
18
19To match extended globs like `@(*.cc|*.h)`, OSH relies on `FNM_EXTMATCH` from
20GNU libc.
21
22This is unlike bash, which has its own extended glob library.
23
24TODO: when using other libc, using this syntax should be an error.
25
26### libc - `GLOB_PERIOD` is not in POSIX
27
28To implement the bash feature `shopt -s dotglob`, OSH relies on `GLOB_PERIOD`,
29which some libc's implement.
30
31This is unlike bash, which has its own glob library.
32
33### Atomic Assignments
34
35The signal handler assumes that int and pointer assignments are atomic. This
36is a common and widespread assumption.
37
38- Related: [Atomic vs. Non-Atomic
39 Operations](https://preshing.com/20130618/atomic-vs-non-atomic-operations/)
40 by Jeff Preshing
41
42<!--
43As of 2024, the GC object layout doesn't depend on endian-ness.
44
45Tagged pointers may change this. A value may be either a pointer, which
46implies its least significant bits are zero, or an immediate value.
47
48We will have some #ifdef for it.
49-->
50
51## Extra Features
52
53### USDT - Userland Statically-Defined Tracing
54
55Our C++ code has `DTRACE_PROBE()` macros, which means we can use tools like
56`bpftrace` on Linux to make low-overhead queries of runtime behavior.
57
58The probe names and locations aren't stable across releases.
59
60## "Enums" that are often extended
61
62Different Unix implementations often extend:
63
64- the list of signals
65- the list of [ulimit][] resources, which correspond to flags
66
67[ulimit]: ref/chap-builtin-cmd.html#ulimit
68
69## Unicode
70
71Strings in Oils are byte strings, which are often UTF-8 encoded.
72
73We use `libc` functions that may depend on the global locale setting, like
74`glob()`. We currently assume your libc is configured to use UTF-8.
75
76See the [Unicode doc][] for details on Unicode-aware operations.
77
78[Unicode doc]: unicode.html
79
80<!--
81
82TODO: ./configure could detect some of these
83-->