Polyfill statfs() and fstatfs() on BSD distros

This commit is contained in:
Justine Tunney 2022-08-17 13:41:21 -07:00
parent e3fe127ccd
commit f7ee9d7d99
42 changed files with 968 additions and 287 deletions

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon splice,SEEK_DATA,3,4,3,-1,-1,-1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon splice,SEEK_HOLE,4,3,4,-1,-1,-1

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_APPEND,0x0100,0,0,0,0,0
.syscon statfs,ST_APPEND,0x0100,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_IMMUTABLE,0x0200,0,0,0,0,0
.syscon statfs,ST_IMMUTABLE,0x0200,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_MANDLOCK,0x0040,0,0,0,0,0
.syscon statfs,ST_MANDLOCK,0x0040,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NOATIME,0x0400,0,0,0x04000000,0,0
.syscon statfs,ST_NOATIME,0x0040,0x10000000,0x10000000,0x00008000,0x04000000,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NODEV,4,0,0,0,0x00000010,0
.syscon statfs,ST_NODEV,4,16,0,16,16,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NODIRATIME,0x0800,0,0,0,0,0
.syscon statfs,ST_NODIRATIME,0x0800,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NOEXEC,8,0,0,0,4,0
.syscon statfs,ST_NOEXEC,8,4,4,4,4,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NOSUID,2,2,2,2,2,0
.syscon statfs,ST_NOSUID,2,8,8,8,8,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_RDONLY,1,1,1,1,1,0
.syscon statfs,ST_RDONLY,1,1,1,1,1,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_RELATIME,0x1000,0,0,0,0x00020000,0
.syscon statfs,ST_RELATIME,0x1000,0,0,0,0x00020000,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_SYNCHRONOUS,16,0,0,0,2,0
.syscon statfs,ST_SYNCHRONOUS,16,2,2,2,2,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_WRITE,0x0080,0,0,0,0,0
.syscon statfs,ST_WRITE,0x0080,0,0,0,0,0

16
libc/sysv/consts/seek.h Normal file
View file

@ -0,0 +1,16 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_SEEK_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_SEEK_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const int SEEK_DATA;
extern const int SEEK_HOLE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define SEEK_DATA SYMBOLIC(SEEK_DATA)
#define SEEK_HOLE SYMBOLIC(SEEK_HOLE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_SEEK_H_ */