Make some system call fixes

- Fix minor ABI issue with SIOCGIFCONF
- Fix ABI translation issues with statfs() on BSDs
- Fix SQLite angled header line
This commit is contained in:
Justine Tunney 2023-02-12 22:16:34 -08:00
parent 0eb621f75e
commit 2b6261a52d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
11 changed files with 88 additions and 37 deletions

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/str/blake2.h"
#include "libc/str/path.h"
@ -38,7 +39,9 @@ const char *sem_path_np(const char *name, char *buf, size_t size) {
const char *path, *a;
uint8_t digest[BLAKE2B256_DIGEST_LENGTH];
a = "/tmp/", n = 5;
if (IsLinux()) a = "/dev/shm/", n = 9;
if (IsLinux() && isdirectory("/dev/shm")) {
a = "/dev/shm/", n = 9;
}
if (n + BLAKE2B256_DIGEST_LENGTH * 2 + 4 < size) {
BLAKE2B256(name, strlen(name), digest);
p = mempcpy(buf, a, n);